Plotting a system of linear ODE

graphing-functionsordinary differential equations

I would like to plot a system of following ODE:

\begin{equation}
\mathbf{\dot{x}} = \mathbf{Ax} \text{ where } \mathbf{A} = \begin{bmatrix}
-2 & 1 \\
-1 & 0
\end{bmatrix}
\end{equation}

with general solution:

\begin{equation}
\vec{x}(t)=C_1 \begin{bmatrix} 1 \\ 1 \end{bmatrix} e^{-t}+C_2 \left(\begin{bmatrix} 0 \\ 1 \end{bmatrix}+\begin{bmatrix} 1 \\ 1 \end{bmatrix} t \right) e^{-t}
\end{equation}

I know that this system is stable so arrows will be inward-pointing, also it has double eigenvalue at -1 so there will be an constant line for an eigenvalue crossing the plot but I am not sure how to fill the rest of the phase diagram. Could someone help me? Thanks in advance.

Best Answer

If you write your solution now as $$\vec{x}(t)=\left(C_1\begin{bmatrix} 1 \\ 1 \end{bmatrix}+C_2\begin{bmatrix} 0 \\ 1\end{bmatrix}\right)e^{-t}+C_2\begin{bmatrix}1 \\ 1\end{bmatrix}te^{-t}$$

it may be a little easier to see what's going on. As $t\to\pm\infty$, the equation is dominated by the second term, so $$\vec{x}(t)\approx C_2\begin{bmatrix} 1 \\ 1\end{bmatrix}te^{-t}\;\;\;\;\;\;\;\;\;\;\;t\to\pm\infty$$

As $t\to\infty$, the whole thing decays to $0$, so it makes sense that all solution curves begin to look like they fall along this eigenvector as they decay to $0$. Applying the same logic as $t\to-\infty$, it would seem that solutions grow along this vector as well, but this is only true on a macroscopic scale, as the solutions are growing exponentially in both directions. The first term, no longer decaying to $0$, shifts the solution away from the eigenvector and is growing large, but not as large as the second term. This means that when zoomed in, solutions look like they are leaving the eigenvector, but zoomed out solutions look like they are along the eigenvector (that is, until you let time grow large enough, in which you will see it move away slowly).

The last thing to consider is the direction of the curve. Suppose that $\vec{x}$ is in the first quadrant as $t\to\infty$. This means that $C_2$ is positive, so if $t\to-\infty$, then the sign on the second term is now negative, and the solution turns around to enter the third quadrant. This means that solutions sort of "spin" by turning $180^\circ$ around while still growing away from the origin.

The vector $\begin{bmatrix} 0 \\ 1\end{bmatrix}$ tells you which way the solution spins. If $C_2$ is positive, then that means that at $t=0$, the solution is above (in the xy-plane) of the line through the vector $\begin{bmatrix} 1 \\ 1\end{bmatrix}$ and the origin, so the solution must remain on this side of said line. The dominating term is in the first quadrant as $t\to\infty$, so the solution must spin clockwise to decay this way. It turns out that if solutions spin clockwise on one side of the eigenvector, they do the same on the other side as well; the same is true if they spin counterclockwise.

This type of equilibrium is called a Degenerate Node, in case you were curious. Here is an example of what one might look like.

An example of a degenerate node