Skip to content
Tutorials Center
My learning

Topics

Lesson 21 of 39 ยท Systems and Phase Planes

Phase Portraits

Read the phase plane: draw vector fields and trajectories for linear systems, recognize nodes, saddles, spirals and centers, and plot them with Matplotlib.

A formula for x(t) and y(t) tells you the position at every moment. A phase portrait tells you the story all at once. It draws the plane whose axes are the unknowns themselves and sketches the paths that solutions follow. Time disappears from the axes and becomes the direction of travel along each curve.

For a linear 2D system u' = A u, only a handful of portrait shapes exist, and the eigenvalues of A choose which one you get. Learning to recognize them lets you describe the long-term behavior of a system without solving it.

Five shapes to know

Stable node Everything flows into the origin.
Unstable node Everything flows away.
Saddle Only one line leads in.
Spiral Rotation plus decay or growth.

A center is the borderline case: closed loops.

1 / 3

Reading a portrait

Every point (x, y) of the plane carries a velocity vector A (x, y). A trajectory is a curve that is tangent to these vectors everywhere. Because the system is autonomous, two trajectories never cross: through each point there is exactly one path. The origin is special. Since A 0 = 0, it is an equilibrium (also called a fixed point or critical point): a solution that just sits there.

Things to look for:

  • Equilibria: points where the velocity vector is zero.
  • Eigenvector lines: straight-line solutions along which the system moves directly toward or away from the origin.
  • Arrows: which way is the flow, and how fast (long arrows mean fast).

The classification

Let ฮป1, ฮป2 be the eigenvalues of A.

Eigenvalues Name Behavior
real, both negative stable node (sink) all paths go into the origin
real, both positive unstable node (source) all paths leave
real, opposite signs saddle one stable and one unstable direction
complex, real part negative stable spiral rotates inward
complex, real part positive unstable spiral rotates outward
purely imaginary center closed loops around the origin
repeated real degenerate or star node paths bend, or straight lines for a star

A saddle is always unstable. A center is stable but not asymptotically stable: nearby solutions stay nearby without converging.

The trace-determinant plane condenses this. With T = tr(A) and D = det(A): D < 0 is a saddle; D > 0 and T^2 > 4D is a node (stable if T < 0); D > 0 and T^2 < 4D is a spiral (stable if T < 0); D > 0 with T = 0 is a center.

Drawing portraits with Matplotlib

The function streamplot draws trajectories directly from a vector field. Below, four matrices are drawn side by side.

Python Four phase portraits

Press Run (or Ctrl + Enter) to see the result here.

Program input ยท what you'd type while the program runs

Type the answers before you press Run, one per line. Each time the program reads a line (with input()), it gets the next line from this box.

Tracing one trajectory

Pictures are great, but sometimes you want numbers. Here a spiral is integrated and its distance from the origin, r = sqrt(x^2 + y^2), is printed. For a stable spiral the distance shrinks, and the rotation counts how many times the path winds around.

Python Distance from the origin along a spiral

Press Run (or Ctrl + Enter) to see the result here.

Program input ยท what you'd type while the program runs

Type the answers before you press Run, one per line. Each time the program reads a line (with input()), it gets the next line from this box.

The radius follows 2 e^(-0.3 t) exactly because the real part of the eigenvalues is -0.3, and the angle moves by about 2 radians per time unit because the imaginary part is 2.

Orientation: clockwise or counterclockwise?

For a spiral or center, the sign of the lower-left entry of A (the coefficient of x in y') tells the direction at the point (1, 0): if y' > 0 there, the motion is counterclockwise. In the example above, A[1][0] = 2 > 0, so the spiral runs counterclockwise.

Sketching by hand

  1. Find the equilibrium, usually the origin.
  2. Compute the eigenvalues and decide the type.
  3. For real eigenvalues, find the eigenvector lines and mark the arrows toward or away from the origin.
  4. Evaluate the field at one point not on those lines, for example (1, 0), to see how curves bend between them.
  5. For spirals, decide the direction with the same test.

Whatever you find also tells you about nonlinear systems: near an equilibrium they behave like their linear approximation.

Common mistakes

  • Thinking trajectories cross in a saddle. They approach the origin and turn away without crossing; only the equilibrium itself is shared.
  • Reading time off the plot. A phase portrait has no time axis; speed is shown only by arrow length.
  • Forgetting that a center is not robust: a tiny change in A turns it into a slow spiral.

Check your understanding

Quick check ยท 4 questions

of 4 answered You scored / 4 ยท perfect!

  1. 1. A 2x2 matrix has trace -3 and determinant 2. What is the origin?

    The eigenvalues satisfy l^2 + 3l + 2 = 0, so they are -1 and -2: both real and negative, a stable node.
  2. 2. Which condition describes a saddle?

    A negative determinant means the real eigenvalues have opposite signs.
  3. 3. Purely imaginary eigenvalues give:

    With zero real part there is neither growth nor decay, so paths close up into loops.
  4. 4. What does the time axis of a phase portrait show?

    Both axes are state variables. Time only appears as direction of travel along the curves.

Summary

  • A phase portrait plots the unknowns against each other; solutions are non-crossing curves.
  • Equilibria sit where the velocity vector is zero.
  • Eigenvalues give the type: nodes, saddles, spirals, centers.
  • det < 0 is a saddle; T^2 < 4D with D > 0 is a spiral; the sign of T sets stability.
  • streamplot draws portraits; solve_ivp gives numbers along a trajectory.

Next: Nonlinear Systems and Linearization