# Math Insight

### Visualizing the solution to a two-dimensional system of linear ordinary differential equations

Below are two applets through which you can explore the solution a system of two linear ODEs, i.e., a system of the form \begin{align*} \diff{\vc{x}}{t} &= A \vc{x}\\ \vc{x}(0) &= \vc{x}_0, \end{align*} where $\vc{x}$ is a two-dimensional vector, $\vc{x}=(x,y)$, $A$ is a $2 \times 2$ matrix, and the initial condition is $\vc{x}_0=(x_0,y_0)$.

#### Interactive phase plane applet

The first applet shows the solution to $\diff{\vc{x}}{t} = A \vc{x}$, plotted both as functions as time and in the phase plane. The applet demonstrates how the phase plane represents the solution trajectory $(x(t),y(t))$ through time. It also illustrates the link between the solution and the eigenvalues and eigenvectors of $A$.

Control panel (Show)
Eigenvalues and eigenvectors (Show)
Equilibrium classification (Show)
Solution (Show)

A linear system with phase plane and versus time.

Illustration of the solution to a system of two linear ordinary differential equations. The system is of the form $\diff{\vc{x}}{t} = A\vc{x}$ with prescribed initial conditions $\vc{x}(0)=\vc{x}_0$, where $\vc{x}(t)=(x(t),y(t))$. The solution trajectory $(x(t),y(t))$ is plotted as a cyan curve on the phase plane in the left panel. In the right panel, the components of the solution $x(t)$ (top axes, solid cyan curve) and $y(t)$ (bottom axes, dashed cyan curve) are plotted versus time.

To visualize how the solution changes as a function of time in the phase plane, one can change the time $t$ with the slider in the right panel or press the play button (triangle) in the lower left of one of the panels to start the animation of $t$ increasing. The red points in both panel move with $t$ to correspond to the solution $(x(t),y(t))$.

Values of the matrix $A$ can be changed in the top control panel. The initial condition $\vc{x}(0)= (x_0,y_0)$ can be changed by dragging the cyan points in either panel or by entering numbers in the control panel.

If the eigenvalues of $A$ are real, then one can check the “show eigenvectors” box to show the directions of the eigenvectors of $A$ in the left phase plane. If the corresponding eigenvalue is not zero, arrows along the eigenvector indicates the direction the solution moves along the eigenvector direction. Checking the “show vector” box displays a vector from the origin to $(x(t),y(t))$, allowing one to track the direction of the solution even when the point $(x(t),y(t))$ moves out of view. Checking the “show decompositions” box, shows the decomposition of $(x(t),y(t))$ as a sum of components along the eigenvectors.

If you check the box “show eigenvalues”, then the phase plane plot shows an overlay of the eigenvalues, where the axes are reused to represent the real and imaginary axes of the complex plane. The eigenvalues appear as two points on this complex plane, and will be along the x-axis (the real axis) if the eigenvalues are real. If both eigenvalues are in the left half of the plane (which becomes shaded when the box is checked), then the equilibrium at the origin is stable.

The solution, eigenvalues, eigenvectors, and characterization of the equilibrium at the origin are shown in the sections at the bottom of the applet. These calculations depend on values of $A$ and initial condition chosen.

#### MIT cursor entry mathlet

The second applet, from the MIT Mathlet collections, is the Linear Phase Portraits: Cursor Entry Mathlet (distributed under a Creative Commons Attribution-NonCommercial-ShareAlike 3.0 Unported license). In this applet, you specify the matrix by changing the trace and the determinant of the matrix $A$ (lower left), which determine the eigenvalues of the matrix $A$, and hence type of the system. The eigenvalues, however, don't fully determine the entries of the matrix. In the upper left, you can change two more quantities that determine the rotation and the asymmetry of the solutions in the phase plane. Combined with the eigenvalues, these quantities completely specify the entries of $A$.

LINEAR PHASE PORTRAITS: CURSOR ENTRY

The graphing window at right displays a few trajectories of the linear system x' = Ax. Below the window the name of the phase portrait is displayed, along with the matrix A and the eigenvalues of A.

To control the matrix one first sets the trace and the determinant by dragging the cursor over the diagram at bottom left or by grabbing the sliders below or to the left of that diagram. Select from among the matrices with given trace and determinant by dragging the cursor over the window at upper left, or by grabbing the sliders below and to the left of that window. The bottom slider conjugates the matrix A by a rotation matrix; the effect is to rotate the phase portrait. The left slider controls the "asymmetry" of A, half the difference of between its off-diagonal entries. When the eigenvalues are not real, the asymmetry is at least the imaginary part of the eigenvalue in absolute value, so the upper left window splits into two portions (corresponding to clockwise or counterclockwise spirals).

Depress the mousekey over the graphing window to display a trajectory through that point. The trajectory can be dragged by moving the cursor with the mousekey depressed. Releasing it will leave the trajectory in place. Click on [Clear] to clear all the trajectories.

© 2001 H. Hohn and H. Miller

Another applet that may be of interest is the Linear Phase Portraits: Matrix Entry Mathlet, also from the MIT Mathlet collections.