Module 10
Hamiltonian mechanics
A control room with two monitors, both watching the same pendulum. Monitor A shows the pendulum itself: bob, rod, swing. Familiar, and strangely hard to read. Is it slowing? Was that swing as wide as the last one? You squint at A and hedge.
Monitor B shows no pendulum. It shows a single dot, gliding along an oval track, steady as a train. The operator watching B answers instantly: exact swing width, exact speed at bottom, where the bob will be in eleven seconds. The dot never hesitates, never doubles back on its own trail, never surprises her.
Both monitors carry the same information; only B makes it visible. What would you have to plot for one moving point to carry everything there is to know?
The takeaway
Plot position against momentum and every complete state becomes one point on a map called phase space. Histories become curves that never cross; energy becomes altitude; and a single function, the Hamiltonian, steers every point with two symmetric equations.
The map of every possible world
Module 01 promised that the state, the complete description, would earn its keep. Module 04 fixed its contents: position and velocity, or, tilted slightly, position and momentum. Here is the tilt's reward. Take those two numbers and stop treating them as a list; treat them as coordinates. Position across, momentum up. The result is phase space, and it is Monitor B: one point of that plane is not part of the state, it is the whole state, the entire world of the system compressed to a dot.
Everything this volume has built translates onto the map. A possible history is a curve. Determinism, module 01's coin rule, becomes geometry: through every point passes exactly one curve, because one state has one future, and by reversibility one past. Curves never merge and never cross. And energy conservation, module 07's untouchable total, pins each curve in place: the dot can only ride a contour line of constant energy.
Phase space is a topographic map, with energy as the altitude, and for these one-particle worlds the dot behaves like a hiker forbidden to climb or descend: it walks its contour line forever. State the crack in the same breath: a real hiker can change altitude, and even our dot could, if friction or an outside push entered the books. Pinned-to-the-contour is the frictionless, closed-system idealization, the same one modules 06 and 07 bought their theorems with. Inside that idealization the map is absolute.
Why bother redrawing mechanics a third time, after Newton's forces and Lagrange's paths? Because questions that are awkward about one trajectory become obvious about the map. The oscillator's portrait is a nest of circles: read off instantly that every orbit repeats, none decays, none escapes. The pendulum's portrait, which you built by hand in module 01's figure library and will now meet properly, shows swinging worlds as closed loops, spinning worlds as open waves, and the knife-edge between them as a single vermilion curve. One picture answers every question of the form "what kinds of fate exist here?" The demon has been following one dot; the map shows it all dots at once.
The math
Define momentum from the Lagrangian, as module 09 hinted:
Define the Hamiltonian as module 09's energy function, rewritten to speak only and , never :
The total energy, wearing map coordinates. Now the equations of motion, one pair, almost mirror images:
Check them against everything you know. The first: , which is . The definition of momentum, returned. The second: , so . Newton's second law, returned. Two first-order equations replace one second-order equation, and the trade buys the map: together they assign every point of phase space one arrow, the flow the figure shows.
Now watch conservation become a two-line identity. Along the flow:
Substitute the equations into the chain rule and the two terms annihilate by pure symmetry. No integration, no cleverness: energy conservation is built into the shape of the equations themselves. Run the oscillator, : , the equations read , , and the solutions are circles traversed clockwise, exactly the figure's green contours.
Play with it
The pendulum's full atlas. Tap anywhere on the map to create that world: the dot rides its curve while the actual pendulum swings beside it in sync. Start inside the vermilion curve, then outside it, then as close to it as your finger dares.
Check yourself
Problem 1. Oscillator with m = k = 1, started at (x, p) = (0, 2). Describe its entire future from the map alone.
Reveal the solution
H = ½(0 + 4) = 2, so the dot rides the circle of radius 2 forever. At (0, 2) the equations give dx/dt = 2 and dp/dt = 0: it sets off rightward, so the circle is traversed clockwise. Nothing else can ever happen to it.
Problem 2. A free particle has H = p²/2m. What does its phase portrait look like?
Reveal the solution
dp/dt = -∂H/∂x = 0: momentum never changes, so every curve is a horizontal line. dx/dt = p/m: ridden rightward on the top half of the map, leftward on the bottom, faster the farther from the axis. Module 05's first law, drawn.
Problem 3. Can two phase-space curves cross?
Reveal the solution
No. A crossing point would be one state with two futures. At the crossing, both curves obey the same equations from the same (x, p), so their next step is identical, and identical forever after: they are the same curve. Module 01's coin rule, now a fact of geometry.
What this did to the demon
The demon owns the perfect map at last: every possible world a point, every fate a curve no other fate may touch. Module 11 walks onto that map carrying the volume's original question, spreads a blob of honest ignorance across it, and watches what the flow does to the blob's area. The answer settles whether the demon can exist.
Liouville's theorem