Skip to content
Tutorials Center
My learning

Topics

Lesson 27 of 44 Β· Hamiltonian Mechanics

Phase Space and Liouville's Theorem

Learn to read phase portraits of the oscillator and the pendulum, see why trajectories never cross, and prove that Hamiltonian flow preserves phase-space area.

In Hamilton's description, the complete state of a system is a point in phase space: the space whose axes are the coordinates q and the momenta p. For one degree of freedom that is a plane. Motion becomes a curve in that plane, and the whole behavior of the system can be read from a single picture, the phase portrait.

This lesson shows how to read phase portraits, why they have the shape they do, and then proves a beautiful result: the flow of a Hamiltonian system moves a cloud of states around like an incompressible fluid. That is Liouville's theorem, a cornerstone of statistical mechanics.

Phase portrait of the pendulum with libration, rotation and the separatrix
Caption: each curve is one energy of H = pΒ²/2 βˆ’ cosΞΈ; the pink separatrix divides swinging from rotation.

What you will learn

  • What phase space is and how a state becomes a point.
  • Why two trajectories never cross.
  • How to read libration, rotation and the separatrix on a pendulum portrait.
  • What Liouville's theorem states and a short proof of it.

Key terms

Phase space: the space of all pairs (q, p) (for n degrees of freedom, 2n dimensions).

Phase portrait: a drawing of many trajectories in phase space.

Separatrix: the trajectory that separates qualitatively different kinds of motion.

Liouville's theorem: Hamiltonian flow preserves phase-space volume.

States as points

In Newtonian mechanics you need a position and a velocity at one instant to predict the future. Hamilton's equations are first order, so a point (q, p) is all you need. It follows that through every point of phase space passes exactly one trajectory. Two trajectories cannot cross, since a crossing point would have two different futures, which would break determinism. (For a system that depends explicitly on time, the statement holds in the extended space (q, p, t).)

For conservative systems, H is constant along a trajectory, so each trajectory is a piece of a level curve H(q, p) = E. Drawing the phase portrait is the same as drawing the contour map of H.

The harmonic oscillator

For H = p²/2m + kx²/2 the level curves are ellipses with semi-axes √(2E/k) in x and √(2mE) in p. The state circles the origin once per period, clockwise: when x > 0, the force is negative, so p decreases.

The pendulum

For H = pΒ²/(2mlΒ²) βˆ’ mgl cosΞΈ the portrait (in units where m = l = g = 1) has three regions:

  • Libration (swinging). For βˆ’mgl < E < mgl, the level curves are closed loops around the stable equilibrium (ΞΈ, p) = (0, 0).
  • Rotation. For E > mgl the pendulum goes over the top and keeps circling. The curve is wavy and runs from left to right (or right to left) forever; ΞΈ keeps increasing.
  • Separatrix. At exactly E = mgl the curve p = Β±2cos(ΞΈ/2) passes through the unstable equilibria ΞΈ = Β±Ο€. A pendulum on it takes infinitely long to reach the top: it is the dividing line between swinging and rotating.

The points (Β±Ο€, 0) are unstable: nearby curves are pushed away. The point (0, 0) is stable: nearby curves circle it.

Liouville's theorem

Imagine many copies of a system, starting at nearby states that fill a small region of phase space. As time passes, each point follows Hamilton's equations, and the region moves and deforms. The area of the region does not change.

Proof for one degree of freedom. Hamilton's equations define a velocity field (qΜ‡, αΉ—) = (βˆ‚H/βˆ‚p, βˆ’βˆ‚H/βˆ‚q). A region's area changes at a rate given by the divergence of this field:

Text
βˆ‚qΜ‡/βˆ‚q + βˆ‚αΉ—/βˆ‚p = βˆ‚Β²H/βˆ‚qβˆ‚p βˆ’ βˆ‚Β²H/βˆ‚pβˆ‚q = 0

The mixed second derivatives of a smooth function are equal, so the divergence is zero. A flow with zero divergence is incompressible. The same argument works with n pairs: the divergence is a sum of such cancelling terms, so the 2n-dimensional volume is conserved.

The shape can change dramatically. In a nonlinear system, a round blob is stretched into a long, thin filament, and shorter-period parts shear away from longer-period parts. But the area stays the same.

Two consequences:

  1. No attractors in Hamiltonian systems. A region cannot shrink onto a point or a curve. That is why dissipation (friction) is needed to make something settle down.
  2. Statistical mechanics. A probability cloud in phase space keeps its density along the flow, the starting point of equilibrium statistical mechanics.

If you add friction, for example αΉ— = βˆ’βˆ‚H/βˆ‚q βˆ’ Ξ³p, the divergence becomes βˆ’Ξ³, so areas shrink as e^(βˆ’Ξ³t). That formula is a good check of the theorem: it is not magic, it is exactly the divergence.

Common misconceptions

  • "Liouville means the shape of a cloud stays the same." No. Only its area (volume) stays the same; shapes shear and stretch.
  • "Phase space is the same as ordinary space." No. A point of phase space is a whole state, positions and momenta together.
  • "Trajectories can cross at the equilibrium points." The separatrix seems to cross itself at (Β±Ο€, 0), but those points are themselves trajectories (rest states), and the other curves approach them only as t β†’ ±∞.

Try it

The first TryIt draws the pendulum portrait with matplotlib: the contour lines of H, the flow arrows from ΞΈΜ‡ = p, αΉ— = βˆ’sinΞΈ (units with m = l = g = 1), and the separatrix E = 1 in pink.

Python Pendulum phase portrait with flow

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 second TryIt tests Liouville's theorem. It starts with a small disk of initial states around (ΞΈ, p) = (1.0, 0) (units with m = l = g = 1), moves every boundary point with a Runge-Kutta integrator and measures the area by the shoelace formula. The area stays at π·0.3Β² even as the shape is sheared. A second run adds friction βˆ’Ξ³p with Ξ³ = 0.3, and the area must then shrink by e^(βˆ’Ξ³t). This is a numerical experiment with a finite polygon, so the last digits are approximate.

Python Does the blob keep its area?

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 last TryIt is an interactive version. Move the slider to choose a starting angle and watch the state travel around its energy curve. This is a model in dimensionless units (m = l = g = 1), not a measurement.

Watch a state travel through phase space

Check your understanding

Quick check Β· 5 questions

of 5 answered You scored / 5 Β· perfect!

  1. 1. Why can two phase-space trajectories not cross (for time-independent H)?

    Hamilton's equations are first order, so a point (q, p) determines the whole trajectory. A crossing would have two futures.
  2. 2. In the pendulum portrait, what does the separatrix E = mgl represent?

    At E = mgl the pendulum approaches the unstable upright position and takes infinite time to arrive.
  3. 3. What is βˆ‚qΜ‡/βˆ‚q + βˆ‚αΉ—/βˆ‚p for a Hamiltonian system?

    βˆ‚Β²H/βˆ‚qβˆ‚p βˆ’ βˆ‚Β²H/βˆ‚pβˆ‚q = 0, so the flow is incompressible.
  4. 4. What happens to a phase-space area under a damped flow with αΉ— = βˆ’βˆ‚H/βˆ‚q βˆ’ Ξ³p?

    The divergence of the flow is βˆ’Ξ³, so area scales as e^(βˆ’Ξ³t).
  5. 5. For E > mgl the pendulum's phase curve is...

    That is rotation: the pendulum swings over the top again and again.

Summary

  • A phase-space point (q, p) is a complete state; trajectories follow level curves of H and never cross.
  • The pendulum portrait has libration loops, rotation waves and a separatrix through the unstable equilibria.
  • Liouville's theorem: Hamilton's flow has zero divergence, so phase-space area (volume) is preserved.
  • With friction the area shrinks as e^(βˆ’Ξ³t); this is how dissipation differs from Hamiltonian motion.

Next: Poisson brackets and canonical transformations