The previous page reviewed the Lagrangian half of Section 1.2 of Stewart's notes. This page covers the Hamiltonian half (notes pp. 8–12), which the course builds on heavily in Chapters 4 and 5. It follows the notes' order, in its own words, with its own worked example.
Momenta as coordinates#
In Hamiltonian mechanics the canonical momenta
In words
p sub i is defined as partial L over partial q sub i dot
become independent variables, just as important as the themselves (notes p. 8). The pairs are canonical variables, and the space they span is phase space. In this language the Euler–Lagrange equations just say . The canonical momentum need not be the familiar : it differs whenever the potential depends on the velocities, as for a charge in a magnetic field below.
From here on the notes use the summation convention: an index that appears twice in a term is summed over, unless stated otherwise.
The Legendre transformation#
The Hamiltonian is built from the Lagrangian by a Legendre transformation:
In words
H(q, p, t) equals q sub i dot p sub i minus L(q, q dot, t)
where the velocities on the right are to be written in terms of , and . The motion then obeys Hamilton's equations, first-order equations in place of second-order ones:
In words
q sub i dot equals partial H over partial p sub i, p sub i dot equals minus partial H over partial q sub i
and the explicit time dependence passes over with a sign change:
In words
partial H over partial t equals minus partial L over partial t
The notes prove all three at once, for one coordinate, by comparing two expressions for the small change . On one side, is a function of , and :
In words
d H equals partial H over partial q, times d q plus partial H over partial p, times d p plus partial H over partial t, times d t
On the other side, from the definition, . The two terms cancel because ; that cancellation is the point of the Legendre transformation, and it leaves
In words
d H equals q dot d p minus partial L over partial q, times d q minus partial L over partial t, times d t
Since , and can be varied independently, their coefficients must agree: , (using the Euler–Lagrange equation), and .
The two Hamilton equations play different roles at first sight. The first, , just undoes the definition , giving the velocities back. The second, , carries the dynamics, Newton's law. Yet the Hamiltonian view gives positions and momenta the same status, so neither equation is more basic than the other. In practice the definition of is needed only once, to construct ; after that the Lagrangian plays no further part.
Constraints first, then the Hamiltonian#
For the particle in a cone from the previous page, the notes sketch the possible routes (notes p. 9). From the Lagrangian in one can impose to get a Lagrangian in , and then either find the Euler–Lagrange equations or pass to and Hamilton's equations. One could also pass first to a Hamiltonian in all three coordinates and their momenta, but that route is never taken here: in 8.09 constraints are always applied to the Lagrangian, before any Hamiltonian is formed. (Stewart points the curious to Dirac's short book Lectures on Quantum Mechanics, which handles constraints in Hamiltonians, including more general ones.)
The two formalisms are equivalent, but each has its strengths. For the Hamiltonian one they include the geometry of phase space with Liouville's theorem, Poisson brackets and the link to quantum mechanics, and the Hamilton–Jacobi theory of transformations, all promised for later in the course. (Poisson brackets and Hamilton–Jacobi theory follow in Chapter 4; the posted notes have no section on Liouville's theorem.)
When H is the energy#
Suppose the kinetic energy is quadratic in the velocities, with a symmetric matrix , and , with (notes p. 9). Then
In words
q sub i dot p sub i equals q sub i dot partial L over partial q sub i dot equals one half q sub i dot capital T i k q sub k dot plus one half q sub j dot capital T sub j i q sub i dot equals 2 capital T
(a special case of Euler's theorem for functions that are homogeneous of degree 2), and so
In words
H equals q sub i dot p sub i minus L equals capital T plus capital V equals capital E
A general recipe for H#
A wider class of Lagrangians has terms of degree 0, 1 and 2 in the velocities (notes pp. 9–10):
In words
L(q, q dot, t) equals L nought plus a sub j q sub j dot plus one half q sub j dot capital T sub j k q sub k dot
where , and the symmetric may all depend on and . (The notes also write this with arrows, treating , and as columns of numbers, even though their entries may have different units, such as a length and an angle.) The momenta are
In words
p sub j equals partial L over partial q sub j dot equals a sub j plus capital T sub j k q sub k dot
Kinetic energy is positive for any motion, so the matrix is positive definite and has an inverse; then , and works out to
In words
H equals one half the quantity p sub j minus a sub j, ( capital T to the power minus 1 ) sub j k the quantity p sub k minus a sub k, all minus L nought (q, t)
So for any Lagrangian of this form, inverting one matrix gives the Hamiltonian at once.
A charge in electromagnetic fields. For a charge in a scalar potential and vector potential (SI units), . In Cartesian coordinates , and , so
In words
H equals 1 over the quantity 2 m, times the quantity vector p minus e vector capital A, all squared plus e phi
which, as shown in earlier courses, gives the Lorentz force .
A pendulum hanging from a sliding block#
The notes' main example (notes pp. 10–12) is the system mentioned on the previous page: a block of mass slides without friction along a horizontal rail (the axis), and from it hangs a pendulum, a bob of mass on a rigid massless rod of length . Two constraints, and a fixed rod length,
In words
y one equals 0, the quantity y one minus y two, all squared plus the quantity x one minus x two, all squared equals ell squared
reduce four coordinates to two. Before the constraints,
In words
L equals m one over 2, times x one dot squared plus m two over 2, times the quantity x two dot squared plus y two dot squared, all minus m two g y two minus m one g y one
Take the block's position and the rod's angle from the downward vertical. Then , , with velocities and , and, simplifying with ,
In words
L equals the quantity m one plus m two, all over 2, times x dot squared plus m two ell cos theta x dot theta dot plus m two ell squared over 2, times theta dot squared plus m two g ell cos theta
The momenta are
In words
p sub x equals the quantity m one plus m two, x dot plus m two ell cos theta theta dot, p theta equals m two ell cos theta x dot plus m two ell squared theta dot
is not just a mass times ; it is the total momentum of block and bob. This Lagrangian is of the general form with , and the velocity matrix
In words
capital T equals m one plus m two m two ell cos theta; m two ell cos theta m two ell squared, capital T to the power minus 1 equals 1 over the quantity m two ell squared the quantity m one plus m two sine squared theta, m two ell squared minus m two ell cos theta; minus m two ell cos theta m one plus m two
(the determinant is ). The recipe then gives
In words
H equals the quantity m two ell squared p sub x squared plus the quantity m one plus m two, p theta squared minus 2 m two ell cos theta p sub x p theta, all over the quantity 2 m two ell squared the quantity m one plus m two sine squared theta, minus m two g ell cos theta
Hamilton's equations for the pair are
In words
x dot equals p sub x over the quantity m one plus m two sine squared theta, minus cos theta p theta over the quantity ell the quantity m one plus m two sine squared theta, p x dot equals minus partial H over partial x equals 0
The total momentum is conserved, as it must be with no horizontal external force. The pair gives a longer pair of coupled non-linear equations, which a computer can integrate:
In words
theta dot equals the quantity the quantity m one plus m two, p theta minus m two ell cos theta p sub x, all over the quantity m two ell squared the quantity m one plus m two sine squared theta, p theta dot equals sine theta cos theta the quantity m two ell squared p sub x squared plus the quantity m one plus m two, p theta squared minus 2 m two ell cos theta p sub x p theta, over the quantity ell squared the quantity m one plus m two sine squared theta, all squared, minus m two g ell sine theta minus sine theta p sub x p theta over the quantity ell the quantity m one plus m two sine squared theta
(In the last term of the notes print the denominator as ; differentiating shows that the square on belongs there, as written here.)
To check them by hand, take small angles, and , and work in the frame where the total momentum is zero, . For small swings is small too, so the term is of higher order and can be dropped. What remains is
In words
x dot equals minus p theta over the quantity ell m one, theta dot equals p theta over the quantity mu ell squared, p theta dot equals minus m two g ell theta
where is the reduced mass of block and bob. Combining the last two, : simple harmonic motion with
In words
omega squared equals m two g over the quantity mu ell, equals g over ell, times the quantity 1 plus m two over m one
(the second form is ours). A heavy block, , is a fixed pivot and gives the familiar . A light block lets the pivot swing back and forth against the bob, both moving about their common centre of mass, and the oscillation is faster.
A spherical pendulum, the quick way
A bob of mass on a light rod of length can swing in any direction about a fixed pivot. Use the recipe above to write down its Hamiltonian, with the angle from the downward vertical and the azimuth. Then find how fast it must go round to circle steadily at when m.
The Lagrangian
The bob's speed squared is and its height is , so . This has , , and a diagonal velocity matrix with entries and .
The Hamiltonian
Inverting a diagonal matrix inverts its entries, so . It is quadratic in the momenta with depending only on , so is the energy.
Hamilton's equations
does not appear, so : is constant. For , .
Steady circling
A steady circle needs . Putting in, , so . At , and , so rad/s: one turn every s. This is the conical pendulum of first-year mechanics, found here without drawing a force diagram.
Summary#
- The canonical momenta join the coordinates as phase-space variables; they need not equal .
- The Legendre transformation gives Hamilton's equations , , and .
- This course imposes constraints on the Lagrangian first and only then passes to .
- If is quadratic in the velocities and , then .
- For , ; a charge in fields has .
- A pendulum hanging from a freely sliding block conserves the total momentum and oscillates with , the reduced mass.