From Lagrange to Hamilton
The starting point is the Lagrangian $L(q,\dot q,t)=T-V$. To each coordinate $q_i$ belongs a canonical momentum
Hamilton changes the independent variables: instead of $(q,\dot q)$ he uses $(q,p)$. The mathematical tool is a Legendre transformation – the same one that in thermodynamics leads from internal energy to enthalpy and free energy. The Hamiltonian is
For most mechanical systems (where $T$ is quadratic in the velocities and $V$ depends only on position) $H = T+V$: the total energy, written as a function of positions and momenta. Lagrange's $n$ second-order differential equations become $2n$ first-order equations, Hamilton's equations:
The first equation says how velocity depends on momentum; the second is Newton's second law: the momentum is changed by the force $-\partial V/\partial q$. The difference in sign between the two equations is the whole secret. It makes energy conserved whenever $H$ does not depend explicitly on time:
Phase space
Hamilton's equations are first order, so the state is completely fixed by one point $(q,p)$. The space of all such points is called phase space. For a pendulum it is two-dimensional: the angle horizontally and the angular momentum vertically. Hamilton's equations draw an arrow at every point, and the system follows the arrows like a droplet in a flowing liquid. Two paths in phase space can never cross – otherwise the same state would have two futures – and for a system with conserved energy each path lies on a level curve $H(q,p)=E$. So you can draw all the solutions without solving a single differential equation: they are just the contour lines on a map of $H$.
The pendulum's phase space – try it yourself
For a pendulum of length $\ell$ and mass $m$, $q=\theta$, $p=m\ell^2\dot\theta$ and (in units where $m\ell^2=1$ and $g/\ell=1$)
Small energies give closed curves around $(0,0)$: the pendulum swings to and fro (libration). Large energies give wavy lines that go all the way round: the pendulum turns somersaults (rotation). Between them lies the separatrix at $E=1$, on which the pendulum takes infinitely long to reach the top. Click in phase space to set a pendulum going – or release a whole droplet of 2000 pendulums with almost the same initial conditions.
- Release a droplet near the separatrix and let it run for a while. It is drawn out into long, thin threads. Why do its points move differently when they have almost the same energy? (Hint: the period depends on the energy.)
- The "fine" area is conserved (Liouville) – but the coarse-grained area that a crude measurement would see grows. What has that to do with entropy? See The arrow of time.
- Press "Reverse". The leapfrog method is exactly time-reversible, so the droplet gathers itself up again – Loschmidt's objection to Boltzmann in one animation.
- Switch on friction. Now the droplet shrinks towards a point. Why can that never happen in a Hamiltonian system?
The energy landscape in 3D
Draw $H(\theta,p)$ as a surface over phase space. The pendulum's paths are the curves where the surface is cut by a horizontal plane at height $E$. The bottom of the valley at $(0,0)$ is the pendulum at rest; the two saddle points at $\theta=\pm\pi$ are the pendulum balancing upside down. Slide the plane up and down with the slider, and watch the path change character as the plane passes the saddle.
- Set $E$ just below 1 and just above 1. What happens to the period (shown at the top) near the separatrix?
- For small $E$ the cut is almost an ellipse. Why? (Hint: expand $-\cos\theta$ to second order.)
Worked examples
1. The harmonic oscillator
$$H=\frac{p^2}{2m}+\tfrac12 kq^2,\qquad \dot q=\frac pm,\quad \dot p=-kq .$$The level curves are ellipses with semi-axes $\sqrt{2mE}$ and $\sqrt{2E/k}$. The area of the ellipse is $\oint p\,\mathrm dq=2\pi E/\omega$ with $\omega=\sqrt{k/m}$. Bohr and Sommerfeld set exactly this area equal to $nh$ – and obtained Planck's energy steps $E=nh\nu$.
2. A planet in polar coordinates
$$H=\frac{p_r^2}{2m}+\frac{p_\varphi^2}{2mr^2}-\frac{GMm}{r}.$$$\varphi$ does not appear, so $\dot p_\varphi=-\partial H/\partial\varphi=0$: angular momentum is conserved. The radial motion becomes a one-dimensional problem with the effective potential $p_\varphi^2/(2mr^2)-GMm/r$ – the centrifugal barrier that keeps the planet away from the Sun.
3. A charged particle in a magnetic field
$$H=\frac{(\mathbf p-e\mathbf A)^2}{2m}+e\phi .$$The canonical momentum $\mathbf p$ is not $m\mathbf v$ but $m\mathbf v+e\mathbf A$. In quantum mechanics it is $\mathbf p$ that becomes the operator $-i\hbar\nabla$, and that explains the Aharonov–Bohm effect: electrons feel the potential $\mathbf A$ even where the magnetic field is zero.
4. The double pendulum
Phase space is four-dimensional $(\theta_1,\theta_2,p_1,p_2)$, and the energy surface is three-dimensional. At low energy the paths lie on two-dimensional tori (KAM tori) and are regular. At high energy the tori break up, and the paths wander chaotically. See it on the Lagrange page.
Liouville's theorem: the phase-space fluid cannot be compressed
Imagine many copies of the same system with slightly different initial conditions – a cloud of points in phase space. The velocity field in phase space is $(\dot q,\dot p)=(\partial H/\partial p,\,-\partial H/\partial q)$, and its divergence is
The flow is therefore divergence-free, and the cloud's volume in phase space is conserved, however it is deformed (Joseph Liouville, 1838). The consequences are far-reaching:
- A Hamiltonian system has no attractors. A frictionless pendulum never comes to rest; that requires friction, which is not Hamiltonian (try it in the simulation above).
- Poincaré's recurrence theorem (1890): a bounded Hamiltonian system sooner or later returns arbitrarily close to its initial state.
- The fine-grained (Gibbs) entropy is constant. The entropy increase of thermodynamics appears only when phase space is viewed coarse-grained – exactly like the droplet's threads in the simulation. See The arrow of time, Entropy and Gibbs' paradox.
- That is why statistical mechanics can use a uniform distribution on the energy surface: it is not changed by the motion.
Symplectic integrators: calculate the way nature does
Liouville's theorem is a geometrical property: Hamilton's flow preserves area (more precisely the symplectic form $\mathrm dq\wedge\mathrm dp$). A numerical method that also preserves area is called symplectic. The best known is Störmer–Verlet ("leapfrog"), in which momentum and position are updated alternately:
The method is only second order, but the energy error does not grow with time – it oscillates. The classical fourth-order Runge–Kutta is far more accurate per step, but it is not symplectic, so the energy slowly leaks away. The simple Euler method adds energy at every step, and the planet spirals outwards. That is why symplectic methods are used for the evolution of the Solar System over billions of years, for molecular dynamics and for particle accelerators. Newton's impulse construction in Principia, Prop. 1 is, incidentally, exactly a symplectic Euler method: that is why the areas are exactly equal.
- Which planet keeps to its orbit after many revolutions? What does the energy error do for each method?
- Make $h$ very small. Which method is now most accurate – and why is that not enough in a long run?
- The Verlet orbit slowly turns (a spurious perihelion advance), but it remains an ellipse. Why is that less serious than a spiral?
Poisson brackets – and the road to quantum mechanics
For two quantities $f(q,p)$ and $g(q,p)$ the Poisson bracket is defined as
A quantity is conserved precisely when its bracket with $H$ is zero. The fundamental brackets are $\{q_i,p_j\}=\delta_{ij}$, and for the components of angular momentum $\{L_x,L_y\}=L_z$ and cyclically – the same structure as the quaternions' $ij=k$.
In 1925 the 23-year-old Paul Dirac read Heisenberg's first paper on matrix mechanics and saw that Heisenberg's commutation relation was a quantum version of the Poisson bracket:
Heisenberg's equation of motion $\mathrm d\hat f/\mathrm dt=\tfrac{1}{i\hbar}[\hat f,\hat H]$ is Hamilton's in new clothes, and the Hamiltonian became the Hamiltonian operator $\hat H$ of Schrödinger's equation. It was not Newton's forces or Lagrange's action but Hamilton's phase space that survived the passage into the quantum world – with the difference that $q$ and $p$ can no longer be known at the same time: a region of phase space smaller than $h$ has no meaning.
The Hamilton–Jacobi equation and the optical–mechanical analogy
Hamilton did not begin with mechanics but with optics. In "Theory of Systems of Rays" (1827–1832) he described light rays by a single characteristic function whose surfaces of constant value are the wavefronts, with the rays perpendicular to them. From the theory he predicted in 1832 conical refraction in biaxial crystals, which his colleague Humphrey Lloyd confirmed a few months later. Afterwards he applied exactly the same mathematics to mechanics. In the form Carl Jacobi gave it in 1837, the action $S(q,t)$ is determined by
The particle paths are perpendicular to the surfaces $S=$ constant – just as light rays are to wavefronts. Hamilton saw that mechanics resembled ray optics. What corresponded to wave optics, nobody asked for 90 years. In 1926 Erwin Schrödinger took the step: he wrote the wave function as $\psi=e^{iS/\hbar}$ and looked for the wave equation that in the limit $\hbar\to0$ gives the Hamilton–Jacobi equation. The result was the Schrödinger equation.
History
- 1805William Rowan Hamilton is born in Dublin. As a child he learns a dozen languages; at 17 he finds an error in Laplace's Mécanique céleste.
- 1827Aged 21 and still a student, he becomes Professor of Astronomy at Trinity College and Royal Astronomer of Ireland at Dunsink Observatory. The same year: "Theory of Systems of Rays".
- 1832The prediction of conical refraction makes him famous.
- 1834–35"On a General Method in Dynamics" (two parts in the Philosophical Transactions): Hamilton's principle, the characteristic function and Hamilton's equations.
- 1837–38Jacobi develops Hamilton–Jacobi theory; Liouville proves the conservation of volume.
- 1843Hamilton discovers the quaternions at Broom Bridge and devotes the rest of his life to them.
- 1890Henri Poincaré shows in his prize memoir on the three-body problem that Hamiltonian systems can be unpredictable: chaos theory is born.
- 1925–26Dirac, Heisenberg and Schrödinger build quantum mechanics on Hamilton's formalism.
- 1954–63Kolmogorov, Arnold and Moser (KAM): weakly perturbed regular systems keep most of their regular orbits.
Exercises
- Find the Hamiltonian for a particle falling vertically in a uniform gravitational field, and solve Hamilton's equations. Draw the paths in phase space $(z,p)$.
- Show that the area enclosed by the harmonic oscillator's path in phase space is $2\pi E/\omega$.
- Show that $\{L_x,L_y\}=L_z$, where $L_x=yp_z-zp_y$ etc.
- Show that the Euler method $q_{n+1}=q_n+hp_n$, $p_{n+1}=p_n-hkq_n$ for the harmonic oscillator multiplies the phase-space area by $1+h^2k$ at every step, while the symplectic Euler method (use $q_{n+1}$ instead of $q_n$ in the second equation) preserves it.
Sources and further reading
- W. R. Hamilton: "On a General Method in Dynamics", Phil. Trans. R. Soc. 124 (1834) 247–308 and 125 (1835) 95–144.
- H. Goldstein, C. Poole, J. Safko: Classical Mechanics, 3rd ed. Addison-Wesley, 2002, ch. 8–10.
- V. I. Arnold: Mathematical Methods of Classical Mechanics, 2nd ed. Springer, 1989.
- P. A. M. Dirac: "The Fundamental Equations of Quantum Mechanics", Proc. R. Soc. A 109 (1925) 642–653.
- E. Hairer, C. Lubich, G. Wanner: "Geometric numerical integration illustrated by the Störmer–Verlet method", Acta Numerica 12 (2003) 399–450.
- T. L. Hankins: Sir William Rowan Hamilton. Johns Hopkins University Press, 1980.
Related pages: The three-body problem · Least time and least action · Lagrangian mechanics · Quaternions · Newton's Principia · The arrow of time · Entropy · Gibbs' paradox.