Phase Portraits of Linear Systems
Visualize direction fields and trajectories for \(\dot{\mathbf{x}}=A\mathbf{x}\). Click the canvas to integrate trajectories from any initial condition.
The Linear System
A planar linear autonomous system has the form \(\dot{\mathbf{x}}=A\mathbf{x}\), where \(A\) is a constant \(2\times2\) matrix and \(\mathbf{x}=(x,y)^T\). The origin is always an equilibrium. The qualitative behaviour of all solutions — whether they spiral in, radiate outward, oscillate, or approach along straight lines — is determined entirely by the eigenvalues of \(A\).
Classification by Eigenvalues
Let \(\tau=\operatorname{tr}A=a+d\), \(\delta=\det A=ad-bc\), and \(\Delta=\tau^2-4\delta\).
Numerical Method
Trajectories are integrated forward and backward from the click point with a choice of one-step methods:
- RK4 — classical explicit Runge–Kutta, 4th order. Good general default for non-stiff systems.
- Tsit5 — Tsitouras 5(4) explicit Runge–Kutta, 6 stages, 5th-order accuracy. Smoother curves than RK4 at the same step size; same stability footprint (no benefit on stiff problems).
- SDIRK2 — singly-diagonally-implicit Runge–Kutta, 2 stages, 2nd order with \(\gamma = 1-\tfrac{1}{\sqrt{2}}\). The method is L-stable, so it remains accurate on stiff linear systems where explicit methods would either blow up or require a tiny step.
In Auto mode the page picks SDIRK2 whenever the linear system is "obviously stiff" — both eigenvalues real, the same sign, with a magnitude ratio \(|\lambda_\text{fast}/\lambda_\text{slow}|\ge 50\) — and falls back to RK4 otherwise. Centers are integrated separately with a fixed-step explicit scheme to keep closed orbits closed (an implicit method would introduce numerical damping).
How to Use
- Enter the matrix entries \(a,b,c,d\) in the matrix cells. The direction field and classification update automatically after a short pause.
- Select an example from the dropdown to load a preset matrix with strategic trajectories illustrating the classification.
- Click anywhere on the phase plane to integrate a trajectory through that initial condition (forward and backward). Trajectories are colour-coded.
- Use Generate to redraw the field and clear trajectories; Clear trajectories removes curves while keeping the field.
- Adjust arrow count, scale, opacity, and colour. Toggle grid and initial point markers using the checkboxes.
- Open the Time Series panel to plot \(x(t)\) and/or \(y(t)\) for all current trajectories.
- Download a PNG of the current portrait using Download PNG.