Physlib

Physlib.ClassicalMechanics.Pendulum.SimplePendulum.Hamiltonian

The Hamiltonian formulation of the simple pendulum

i. Overview

This module gives the Hamiltonian formulation of the simple gravity pendulum, on the same one-dimensional Euclidean lift of the angle as `SimplePendulum.Basic`. The canonical momentum conjugate to the angle is the gradient of the Lagrangian in the angular velocity, the angular momentum `p = I θ̇` about the pivot; since the moment of inertia is positive, taking the canonical momentum is a linear equivalence between velocities and momenta. The Hamiltonian is the Legendre transform `H = ⟪p, θ̇⟫ - L` of the Lagrangian, which works out to the energy written on momentum-angle phase space, `H(t, p, θ) = ½ (1/I) ‖p‖² + V(θ)`; along any lift of the angle it is the energy of the lift. Hamilton's equations for the pendulum are packaged, as for the harmonic oscillator, into the vanishing of an operator on phase space, and for a smooth lift of the angle they are equivalent to the equation of motion of `SimplePendulum.Basic`.

ii. Key results

- `SimplePendulum.canonicalMomentum` is the canonical momentum `p = ∂L/∂θ̇ = I θ̇`, as a linear equivalence between velocities and momenta, with its value recorded by `canonicalMomentum_eq`. - `SimplePendulum.hamiltonian` is the Legendre transform of the Lagrangian, computed by `hamiltonian_eq` to be `½ (1/I) ‖p‖² + V(θ)`, smooth by `hamiltonian_contDiff`, with the two partial gradients `gradient_hamiltonian_position_eq` and `gradient_hamiltonian_momentum_eq`. - `SimplePendulum.hamiltonian_eq_energy` identifies the Hamiltonian, evaluated along any lift of the angle on its canonical momentum, with the energy of the lift. - `SimplePendulum.hamiltonEqOp` is the operator on momentum-angle phase space whose vanishing is Hamilton's equations, and `SimplePendulum.equationOfMotion_iff_hamiltonEqOp_eq_zero` proves that, for a smooth lift of the angle, Hamilton's equations are equivalent to the equation of motion. - `SimplePendulum.equationOfMotion_tfae` gathers the formulations into a single equivalence: for a smooth lift of the angle the equation of motion, its scalar form `θ̈ + ω² sin θ = 0`, Hamilton's equations, and the Lagrangian and Hamiltonian variational principles are all equivalent.

iii. Table of contents

- A. The canonical momentum and the Hamiltonian - A.1. The canonical momentum - A.2. The Hamiltonian - A.2.1. Equality for the Hamiltonian - A.2.2. Smoothness of the Hamiltonian - A.2.3. Gradients of the Hamiltonian - A.3. Relation between Hamiltonian and energy - A.4. Hamilton equation operator - A.5. Equation of motion if and only if Hamilton's equations - B. Equivalences between the formulations

iv. References

References for the Hamiltonian formulation of the simple pendulum include: - Landau & Lifshitz, Mechanics, 3rd ed., §40, for the canonical momentum, the Hamiltonian as the Legendre transform of the Lagrangian, and Hamilton's equations. - The module `Physlib.ClassicalMechanics.Pendulum.SimplePendulum.Basic`, whose Lagrangian, energy and equation of motion this module reformulates.

A. The canonical momentum and the Hamiltonian

We now turn to the Hamiltonian formulation of the simple pendulum. We define the canonical momentum and the Hamiltonian, relate the Hamiltonian to the energy, and show that the equation of motion is equivalent to Hamilton's equations.

A.1. The canonical momentum

We define the canonical momentum as the gradient of the Lagrangian with respect to the angular velocity. By `gradient_lagrangian_velocity_eq` this is the angular momentum `I θ̇` about the pivot, and since the moment of inertia is positive it is a linear equivalence between velocities and momenta.

A.2. The Hamiltonian

The Hamiltonian is defined as a function of time, canonical momentum and angle, as the Legendre transform ``` H = ⟪p, θ̇⟫ - L(t, θ, θ̇) ``` where the angular velocity `θ̇` is a function of `p` and `θ` through the inverse of the canonical momentum.

#### A.2.1. Equality for the Hamiltonian

We prove a simple equality for the Hamiltonian, to help in computations: it is the kinetic energy written in terms of the momentum, plus the potential energy.

#### A.2.2. Smoothness of the Hamiltonian

We show that the Hamiltonian is smooth in all its arguments jointly.

#### A.2.3. Gradients of the Hamiltonian

We now write down the gradients of the Hamiltonian with respect to the angle and the momentum. These are the two sides of Hamilton's equations.

A.3. Relation between Hamiltonian and energy

We show that the Hamiltonian, evaluated along any lift of the angle on the canonical momentum of the lift, is the energy. This is independent of whether the lift satisfies the equation of motion or not.

A.4. Hamilton equation operator

We define the operator on momentum-angle phase space whose vanishing is equivalent to Hamilton's equations.

A.5. Equation of motion if and only if Hamilton's equations

We show that, for a smooth lift of the angle, the equation of motion is equivalent to Hamilton's equations for the lift and its canonical momentum, that is to the vanishing of the Hamilton equation operator on the pair. The equation for the angle recovers the angular velocity, and the equation for the momentum is the balance of the rate of change of the angular momentum against the torque.

B. Equivalences between the formulations

We gather the formulations of the dynamics of the simple pendulum into a single equivalence. For a smooth lift of the angle the equation of motion, its scalar form, Hamilton's equations, the Lagrangian variational principle and the Hamiltonian variational principle are all equivalent. The equation of motion is itself the Newtonian formulation: the pointwise law is the rotational form of Newton's second law, so, unlike for the harmonic oscillator, no separate entry restates it. The equivalence of the equation of motion with the vanishing of the variational derivative of the action lives in section G.1 of the `Basic` module; the fourth entry states the same variational principle through the variational calculus directly.

11 declarations

definition

Canonical momentum linear equivalence p=Ivp = I v for a simple pendulum

For a simple pendulum at time tt and angular position xx in a one-dimensional Euclidean space ER1E \cong \mathbb{R}^1, the canonical momentum is defined as the linear equivalence between the space of angular velocities and the space of angular momenta (both represented by EE). The mapping takes a velocity vv to the momentum pp via the gradient of the Lagrangian with respect to velocity: p=vL(t,x,v)=Iv p = \nabla_v L(t, x, v) = I v where II is the moment of inertia. The inverse of this map is given by v=1Ipv = \frac{1}{I} p.

theorem

Canonical Momentum p=Ivp = I v of a Simple Pendulum

For a simple pendulum at time tt with angular position xR1x \in \mathbb{R}^1 and angular velocity vR1v \in \mathbb{R}^1, the canonical momentum is equal to IvI v, where II is the moment of inertia of the pendulum.

definition

Hamiltonian H(t,p,θ)=p,θ˙L(t,θ,θ˙)H(t, p, \theta) = \langle p, \dot{\theta} \rangle - L(t, \theta, \dot{\theta}) of a simple pendulum

The Hamiltonian H(t,p,θ)H(t, p, \theta) of a simple pendulum is a function of time tt, canonical momentum pp, and angular position θ\theta (modeled in a one-dimensional Euclidean space). It is defined as the Legendre transform of the Lagrangian LL: H(t,p,θ)=p,θ˙L(t,θ,θ˙) H(t, p, \theta) = \langle p, \dot{\theta} \rangle - L(t, \theta, \dot{\theta}) where the angular velocity θ˙\dot{\theta} is obtained from the momentum pp via the inverse of the canonical momentum linear equivalence at time tt and position θ\theta.

theorem

The Hamiltonian of a simple pendulum is H(t,p,θ)=12Ip2+V(θ)H(t, p, \theta) = \frac{1}{2I} \|p\|^2 + V(\theta)

The Hamiltonian H(t,p,θ)H(t, p, \theta) of a simple pendulum, as a function of time tt, canonical momentum pp, and angular position θ\theta (represented in a one-dimensional Euclidean space), is equal to the kinetic energy expressed in terms of the momentum plus the potential energy V(θ)V(\theta). Specifically, it is given by: H(t,p,θ)=12Ip,p+V(θ) H(t, p, \theta) = \frac{1}{2I} \langle p, p \rangle + V(\theta) where II is the moment of inertia of the pendulum, VV is the potential energy function, and ,\langle \cdot, \cdot \rangle denotes the standard inner product on the one-dimensional Euclidean space.

theorem

The Hamiltonian of the Simple Pendulum is Smooth (CC^\infty)

For any nN{}n \in \mathbb{N} \cup \{\infty\}, the Hamiltonian H(t,p,θ)H(t, p, \theta) of the simple pendulum is nn-times continuously differentiable (CnC^n) with respect to time tt, canonical momentum pp, and angular position θ\theta jointly.

theorem

θH=V\nabla_{\theta} H = \nabla V for the simple pendulum

For a simple pendulum with Hamiltonian H(t,p,θ)H(t, p, \theta) and potential energy V(θ)V(\theta), the gradient of the Hamiltonian with respect to the angular position θ\theta at any time tt and momentum pp is equal to the gradient of the potential energy with respect to θ\theta: θH(t,p,θ)=V(θ) \nabla_{\theta} H(t, p, \theta) = \nabla V(\theta) Physically, this gradient represents the negative of the torque acting on the pendulum.

theorem

pH=1Ip\nabla_p H = \frac{1}{I} p for the Simple Pendulum

For a simple pendulum with moment of inertia II, the gradient of the Hamiltonian H(t,p,θ)H(t, p, \theta) with respect to the canonical momentum pp at any time tt and angular position θ\theta is given by pH(t,p,θ)=1Ip, \nabla_p H(t, p, \theta) = \frac{1}{I} p, where pp and θ\theta are represented as elements of a one-dimensional Euclidean space R1\mathbb{R}^1. This gradient corresponds to the angular velocity θ˙\dot{\theta} recovered from the momentum.

theorem

The Hamiltonian of the simple pendulum equals the energy along any trajectory

For any trajectory of the angular position θ:TimeR1\theta : \text{Time} \to \mathbb{R}^1 of a simple pendulum, let p(t)p(t) be the canonical momentum at time tt corresponding to the angular velocity θ˙(t)\dot{\theta}(t), defined by the linear equivalence p(t)=Iθ˙(t)p(t) = I \dot{\theta}(t) (where II is the moment of inertia). The Hamiltonian H(t,p,θ)H(t, p, \theta) evaluated along this trajectory and its canonical momentum is equal to the total energy E(t)E(t) of the trajectory: H(t,p(t),θ(t))=E(t). H(t, p(t), \theta(t)) = E(t). This equality holds for any trajectory θ\theta, regardless of whether it satisfies the pendulum's equation of motion.

definition

Hamilton equation operator hamiltonEqOp(p,θ)\text{hamiltonEqOp}(p, \theta) of the simple pendulum

For a momentum trajectory p:TimeR1p: \text{Time} \to \mathbb{R}^1 and an angular position trajectory θ:TimeR1\theta: \text{Time} \to \mathbb{R}^1 of a simple pendulum, the Hamilton equation operator is the function mapping each time tt to the pair: (dθdt(t)pH(t,p(t),θ(t)), dpdt(t)θH(t,p(t),θ(t))) \left( \frac{d\theta}{dt}(t) - \nabla_p H(t, p(t), \theta(t)), \ -\frac{dp}{dt}(t) - \nabla_\theta H(t, p(t), \theta(t)) \right) where HH is the Hamiltonian of the simple pendulum, dθdt\frac{d\theta}{dt} and dpdt\frac{dp}{dt} are the time derivatives of the trajectories, and pH\nabla_p H and θH\nabla_\theta H are the gradients of the Hamiltonian with respect to momentum and position, respectively. The vanishing of this operator characterizes the trajectories that satisfy the classical Hamilton's equations.

theorem

EquationOfMotion(θ)    hamiltonEqOp(p,θ)=0\text{EquationOfMotion}(\theta) \iff \text{hamiltonEqOp}(p, \theta) = 0 for the Simple Pendulum

Let θ:TimeR1\theta : \text{Time} \to \mathbb{R}^1 be a smooth (CC^\infty) trajectory representing the angular position of a simple pendulum. Let p(t)p(t) be the canonical momentum trajectory defined by p(t)=Iθ˙(t)p(t) = I \dot{\theta}(t), where II is the moment of inertia. Then, θ\theta satisfies the pendulum's equation of motion Iθ¨(t)=τ(θ(t))I \ddot{\theta}(t) = \tau(\theta(t)) if and only if the Hamilton equation operator vanishes on the pair (p,θ)(p, \theta), which corresponds to the satisfaction of Hamilton's equations: dθdt=Hpanddpdt=Hθ\frac{d\theta}{dt} = \frac{\partial H}{\partial p} \quad \text{and} \quad \frac{dp}{dt} = -\frac{\partial H}{\partial \theta} where HH is the Hamiltonian of the system.

theorem

Equivalence of Dynamical Formulations for the Simple Pendulum

Let θ:TimeR1\theta: \text{Time} \to \mathbb{R}^1 be a smooth trajectory of a simple pendulum. The following formulations of the dynamics are equivalent: 1. **Newtonian Equation of Motion:** The pointwise rotational Newton law balancing the rate of change of angular momentum against the gravitational torque: Iθ¨(t)=τ(θ(t))I \ddot{\theta}(t) = \tau(\theta(t)). 2. **Scalar Equation of Motion:** The mass-independent second-order differential equation: θ¨(t)+ω2sin(θ(t))=0\ddot{\theta}(t) + \omega^2 \sin(\theta(t)) = 0, where ω=g/\omega = \sqrt{g/\ell} is the angular frequency. 3. **Hamilton's Equations:** The vanishing of the Hamilton equation operator for the trajectory θ\theta and its conjugate canonical momentum p(t)=Iθ˙(t)p(t) = I \dot{\theta}(t). 4. **Lagrangian Variational Principle:** The vanishing of the variational gradient of the action integral S[θ]=L(t,θ(t),θ˙(t))dtS[\theta] = \int L(t, \theta(t), \dot{\theta}(t)) \, dt, where LL is the Lagrangian of the system. 5. **Hamiltonian Variational Principle:** The vanishing of the variational gradient of the phase-space action S[p,θ]=(p(t),θ˙(t)H(t,p(t),θ(t)))dtS[p, \theta] = \int (\langle p(t), \dot{\theta}(t) \rangle - H(t, p(t), \theta(t))) \, dt, evaluated at the pair of the canonical momentum pp and the trajectory θ\theta.