← SciSim / Mathematics

Phase Portraits of Linear Systems

Set a 2×2 matrix and watch the flow: nodes, saddles, spirals, and centers — all decided by the eigenvalues.
🎓 Tier: Standard Undergraduate -- Differential Equations / Linear Algebra

📊 Section 1 -- Interactive Simulation

Below: the trace–determinant plane — the dot is your current system.
Trace T = a+d
--
Det D = ad-bc
--
Discriminant T²-4D
--
λ₁
--
λ₂
--
Type
--

Controls

Preset Systems

Matrix A entries

Display

💡 Section 2 -- The Idea, Step by Step

Start -- a marble in a bowl, on a hill, and on a saddle

Drop a marble into a round bowl and it rolls to the bottom and stays: that resting point is stable. Balance one on top of a smooth hill and the tiniest nudge sends it rolling away: unstable. Now picture a Pringle chip, or a horse's saddle — from front to back it curves up like a bowl, but side to side it curves down like a hill. A marble placed at the center will sit there in theory, but almost any push sends it sliding off sideways. Those three pictures — bowl, hill, saddle — are exactly the behaviors this page is about.

Build -- a rule for how a point drifts

Instead of one marble, imagine an arrow at every point of the plane telling a particle which way to drift next. For a linear system the rule is simple: $x' = ax + by$ and $y' = cx + dy$. The four numbers $a,b,c,d$ form a matrix $A$, and the whole motion is just $\mathbf{x}' = A\mathbf{x}$. The origin never moves (plug in $x=y=0$ and both rates are zero), so it is the fixed point. Two summary numbers tell you almost everything: the trace $T = a+d$ and the determinant $D = ad - bc$. As a first taste, the one-line system $x' = -x$ just decays smoothly to zero, the simplest stable behavior there is.

Deepen -- eigenvalues name the picture

The honest answer to "what happens?" comes from the eigenvalues $\lambda = \dfrac{T \pm \sqrt{T^2 - 4D}}{2}$. Their real part says grow or shrink; any imaginary part says rotate. Two real same-sign eigenvalues give a node (the bowl or the hill); opposite signs give a saddle; a complex pair gives a spiral; a purely imaginary pair ($T=0$) gives a center of closed loops. The sliders are literally the matrix: $a$ and $d$ are the self-feedback of $x$ and $y$, while $b$ and $c$ are the cross-coupling that tilts and twists the flow.

Try this in the sim above

Load the Center preset and watch trajectories close into perfect loops; then nudge slider $a$ a hair away from zero and see the loops unwind into a spiral — that is how fragile a center is. Switch to Saddle and notice the two straight eigenvector lines: one feeds into the origin, the other shoots away. Finally take any stable case and flip the sign of $a$ and $d$ together: the trace changes sign and every arrow reverses, turning a sink into a source.

📐 Section 3 -- Classifying Linear Systems

Classification Theorem (2×2 linear systems)

For $\mathbf{x}'=A\mathbf{x}$ with $A=\begin{pmatrix}a&b\\c&d\end{pmatrix}$, let $T=a+d$, $D=ad-bc$, and $\Delta=T^2-4D$. Eigenvalues: $\lambda_{1,2}=\tfrac{1}{2}\!\left(T\pm\sqrt{\Delta}\right)$.

$D<0$: saddle (always unstable).   $D>0,\ \Delta>0$: node ($T<0$ stable, $T>0$ unstable).   $D>0,\ \Delta<0$: spiral ($T<0$ stable, $T>0$ unstable).   $D>0,\ T=0$: center.   $\Delta=0$: star / degenerate node.

Step 1 -- Trace and determinant

From the eigenvalue product and sum, $D=\lambda_1\lambda_2$ and $T=\lambda_1+\lambda_2$. So a negative determinant forces eigenvalues of opposite sign (a saddle), while a positive determinant with negative trace forces both real parts negative (stable). This is why two numbers classify the whole system.

Step 2 -- The discriminant splits real from complex

$\Delta=T^2-4D$. When $\Delta>0$ the square root is real, giving two real eigenvalues (node or saddle). When $\Delta<0$ the eigenvalues are a complex conjugate pair $\alpha\pm i\beta$ with $\alpha=T/2$ and $\beta=\tfrac{1}{2}\sqrt{4D-T^2}$ — rotation, hence a spiral or center. The boundary $\Delta=0$ is the repeated-root star.

Step 3 -- Worked example (stable spiral)

$A=\begin{pmatrix}-0.5&-1\\1&-0.5\end{pmatrix}$: $T=-1$, $D=(-0.5)(-0.5)-(-1)(1)=0.25+1=1.25$, $\Delta=1-5=-4<0$. Eigenvalues $\lambda=\tfrac{1}{2}(-1\pm\sqrt{-4})=-0.5\pm i$. Negative real part and nonzero imaginary part $\Rightarrow$ a stable spiral winding into the origin. This is the default system on the page.

Step 4 -- Eigenvectors as invariant lines

For a real eigenvalue $\lambda$, an eigenvector $\mathbf{v}$ solves $(A-\lambda I)\mathbf{v}=0$; a convenient choice is $\mathbf{v}=(b,\ \lambda-a)$ when $b\neq0$. Trajectories starting on that line stay on it, moving out if $\lambda>0$ and in if $\lambda<0$. In a node, generic trajectories enter tangent to the eigendirection of the smaller-magnitude eigenvalue (the "slow" direction).

Step 5 -- Stability summary

The origin is asymptotically stable iff both eigenvalues have negative real part, i.e. $T<0$ and $D>0$. It is unstable if any eigenvalue has positive real part ($T>0$, or $D<0$). The borderline cases — centers ($T=0,D>0$) and zero-eigenvalue lines ($D=0$) — are not asymptotically stable and are destroyed by small nonlinear or parameter perturbations.

Reference: Strogatz -- Nonlinear Dynamics and Chaos Ch.5-6; Boyce & DiPrima -- ODE §9.1; MIT OCW 18.03.

❓ Section 4 -- FAQ

🧮Conceptual  How do eigenvalues determine the phase portrait?

The two eigenvalues of the matrix decide everything. Two real eigenvalues of the same sign give a node (stable if both negative, unstable if both positive). Two real eigenvalues of opposite sign give a saddle (always unstable). A complex pair with nonzero real part gives a spiral (stable if the real part is negative, unstable if positive). A purely imaginary pair gives a center with closed orbits.

Key takeaway: real same-sign = node, real opposite-sign = saddle, complex = spiral, imaginary = center.
🔬Simulation  What does the trace-determinant plane show?

Every $2\times2$ system collapses to one point $(T,D)$ where $T$ is the trace and $D$ the determinant. The parabola $D=T^2/4$ separates nodes (below it, real eigenvalues) from spirals (above it, complex eigenvalues). Everything with $D<0$ is a saddle. The positive $D$-axis ($T=0,\ D>0$) is the thin line of centers, and the sign of $T$ splits stable (left) from unstable (right).

Key takeaway: one point in the trace-determinant plane tells you the type and stability at a glance.
🌍Applied  Real applications?

Linearizing any nonlinear system near an equilibrium gives a $2\times2$ matrix whose phase portrait predicts local behavior: predator-prey models (centers/spirals), competing species (saddles and nodes), coupled spring-mass and RLC circuits (spirals), control-system stability (eigenvalues in the left half-plane), chemical reaction kinetics, and neuron membrane models.

Key takeaway: classifying the linear system is the universal first step in analyzing any equilibrium of a nonlinear model.
💡Non-Obvious  Why are centers so fragile?

A center needs purely imaginary eigenvalues, which requires $T=0$ exactly. That is a single line in the trace-determinant plane, so any tiny perturbation nudges $T$ off zero and turns the center into a slowly winding spiral. Centers are "structurally unstable" — they survive only in idealized, frictionless models. This is why a real pendulum eventually spirals to rest instead of orbiting forever.

Key takeaway: centers live on the knife-edge $T=0$; real friction makes them spirals.
📐Computational  Classify $x'=x+2y,\ y'=3x+2y$.

The matrix is $A=\begin{pmatrix}1&2\\3&2\end{pmatrix}$. Trace $T=1+2=3$, determinant $D=(1)(2)-(2)(3)=2-6=-4$. Since $D<0$ it is a saddle. Eigenvalues: $\lambda=\frac{3\pm\sqrt{9-4(-4)}}{2}=\frac{3\pm\sqrt{25}}{2}=\frac{3\pm5}{2}$, giving $\lambda_1=4$ and $\lambda_2=-1$. Opposite signs confirm the saddle.

Key takeaway: compute $T$ and $D$ first; $D<0$ instantly means saddle.
🎓Deep  How do eigenvectors relate to the trajectories?

For real eigenvalues each eigenvector marks an invariant straight line through the origin: a trajectory that starts on it stays on it forever, moving outward if its eigenvalue is positive and inward if negative. In a node every other trajectory comes in tangent to the slow (smaller-magnitude) eigendirection. In a saddle one eigenvector is the stable manifold (incoming) and the other the unstable manifold (outgoing). The dominant eigenvalue — the one with the largest real part — sets the long-term direction of flow.

Key takeaway: real eigenvectors are invariant lines; trajectories align with the dominant eigendirection.
Best resources: 3Blue1Brown -- Differential equations (phase space); Strogatz -- Nonlinear Dynamics and Chaos; MIT OCW 18.03; Paul's Online Math Notes.

⚠️ Section 5 -- Misconceptions & Common Errors

A · Conceptual Misconceptions
❌ Misconception: A saddle point can be stable if you start close enough.✅ Correction: A saddle is always unstable. It has one positive and one negative eigenvalue; only trajectories starting exactly on the stable eigenvector (a measure-zero line) reach the origin. Every other nearby start is eventually flung away along the unstable direction.📖 Strogatz Ch.5.
❌ Misconception: The sign of the determinant alone tells you stability.✅ Correction: $D>0$ only rules out a saddle; stability is then set by the trace. $D>0,\ T<0$ is stable; $D>0,\ T>0$ is unstable. And $D<0$ is a saddle no matter what $T$ is. You need both numbers.📖 Boyce & DiPrima §9.1.
❌ Misconception: A center is just a very slow inward spiral.✅ Correction: A true center has purely imaginary eigenvalues and perfectly closed, periodic orbits — trajectories neither approach nor leave the origin. A spiral has a nonzero real part. They look similar near the boundary but are mathematically distinct cases.📖 Strogatz Ch.6.
B · Common Procedural Errors
❌ Error: Computing the determinant as $ad+bc$.✅ Correct: $D=ad-bc$ (minus, not plus). For $A=\begin{pmatrix}1&2\\3&2\end{pmatrix}$ this is $2-6=-4$, not $2+6=8$. The sign flip changes a saddle into a node, so the error reverses the whole classification.🔍 Why: students confuse the determinant with a sum of products or mis-remember the cross-multiply rule.
❌ Error: Dropping the factor of $\tfrac{1}{2}$ in the eigenvalue formula.✅ Correct: $\lambda=\tfrac{1}{2}\!\left(T\pm\sqrt{T^2-4D}\right)$. The whole expression $T\pm\sqrt{\Delta}$ is divided by 2. Forgetting it doubles every eigenvalue and corrupts any timescale you compute from it.🔍 Why: students recall the quadratic-formula shape but omit the denominator $2a$ with $a=1$.
❌ Error: Reading the trace as $a-d$ instead of $a+d$.✅ Correct: The trace is the sum of the diagonal, $T=a+d$. With $a=-0.5,\ d=-0.5$ the trace is $-1$ (stable), not $0$ (a false center). A sign error here flips stable and unstable.🔍 Why: students confuse the trace with a diagonal difference seen in shear/rotation decompositions.
Education research: Rasmussen, C. -- "New directions in differential equations" JMTE 4(1) (2001); Trigueros, M. -- studies on student reasoning about phase plane analysis.