Given an ODE
Then for
Consider a pendulum (a massive bob on a weightless rod), see a diagram on Wikipedia. Its motion is given by
Let us introduce
- We need to solve
$y=0$ ,$-\sin x=0$ . - The solutions are
$(x, y)=(\pi k, 0)$ ,$k\in\mathbb Z$ . - All the solutions
$(2\pi k, 0)$ correspond to the bottom point of the circle, and all the solutions$((2k+1)\pi, 0)$ correspond to the top point of the circle.
The jacobian matrix is given by $$ J=\left.\begin{bmatrix} \frac{\partial y}{\partial x} & \frac{\partial y}{\partial y}\ \frac{\partial (-\sin x)}{\partial x} & \frac{\partial (-\sin x)}{\partial y} \end{bmatrix}\right|{x=0, y=0} = \left.\begin{bmatrix} 0 & 1\ -\cos x & 0 \end{bmatrix}\right|{x=0, y=0} = \begin{bmatrix} 0 & 1 \ -1 & 0 \end{bmatrix}. $$
The eigenvalues are
The jacobian matrix is given by $$ J=\left.\begin{bmatrix} \frac{\partial y}{\partial x} & \frac{\partial y}{\partial y}\ \frac{\partial (-\sin x)}{\partial x} & \frac{\partial (-\sin x)}{\partial y} \end{bmatrix}\right|{x=\pi, y=0} = \left.\begin{bmatrix} 0 & 1\ -\cos x & 0 \end{bmatrix}\right|{x=\pi, y=0} = \begin{bmatrix} 0 & 1 \ 1 & 0 \end{bmatrix}. $$
The eigenvalues are
Since
import numpy as np
import matplotlib.pyplot as plt
Y, X = np.mgrid[-3:3:1000j, -4:5:1000j]
U, V = Y, -np.sin(X)
fig, (ax1, ax2) = plt.subplots(1, 2, figsize=(10, 4))
ax1.streamplot(X, Y, U, V)
ax2.contour(X, Y, Y ** 2 / 2 - np.cos(X), 15)
Let's add some friction (damping) to our system. The new equation is
Let us introduce
- We need to solve
$y=0$ ,$-\sin x-y=0$ ; adding equations we get$-\sin x=0$ . - The solutions are
$(x, y)=(\pi k, 0)$ ,$k\in\mathbb Z$ . - All the solutions
$(2\pi k, 0)$ correspond to the bottom point of the circle, and all the solutions$((2k+1)\pi, 0)$ correspond to the top point of the circle.
The jacobian matrix is given by $$ J=\left.\begin{bmatrix} \frac{\partial y}{\partial x} & \frac{\partial y}{\partial y}\ \frac{\partial (-\sin x-y)}{\partial x} & \frac{\partial (-\sin x-y)}{\partial y} \end{bmatrix}\right|{x=0, y=0} = \left.\begin{bmatrix} 0 & 1\ -\cos x & -1 \end{bmatrix}\right|{x=0, y=0} = \begin{bmatrix} 0 & 1 \ -1 & -1 \end{bmatrix}. $$
The eigenvalues are
The jacobian matrix is given by $$ J=\left.\begin{bmatrix} \frac{\partial y}{\partial x} & \frac{\partial y}{\partial y}\ \frac{\partial (-\sin x-y)}{\partial x} & \frac{\partial (-\sin x-y)}{\partial y} \end{bmatrix}\right|{x=\pi, y=0} = \left.\begin{bmatrix} 0 & 1\ -\cos x & -1 \end{bmatrix}\right|{x=\pi, y=0} = \begin{bmatrix} 0 & 1 \ 1 & -1 \end{bmatrix}. $$
The eigenvalues are
Since
import numpy as np
import matplotlib.pyplot as plt
Y, X = np.mgrid[-3:3:1000j, -4:5:1000j]
U, V = Y, -np.sin(X)-Y
plt.streamplot(X, Y, U, V)