The Double Pendulum
Two rigid rods, two point masses, one Lagrangian — and a phase space that refuses to be predicted. The motion is fully deterministic yet exponentially sensitive to initial conditions: perturb θ₁ by half a milliradian and within a few swings the trajectories are unrecognisable. Drag either bob to set the starting pose, then release and watch the system choose its own path.
The system
The generalised coordinates are the two rod angles (θ₁, θ₂) measured from the downward vertical. The Lagrangian L = T − V is, with m₁, m₂ the bob masses and L₁, L₂ the rod lengths,
T = ½ m₁ L₁² θ̇₁² + ½ m₂ ( L₁² θ̇₁² + L₂² θ̇₂² + 2 L₁ L₂ θ̇₁ θ̇₂ cos(θ₁ − θ₂) )
V = −(m₁ + m₂) g L₁ cos θ₁ − m₂ g L₂ cos θ₂
Applying the Euler–Lagrange equations and solving the 2×2 mass matrix for θ̈₁, θ̈₂ gives the
closed-form accelerations used below. A linear viscous term −b θ̇ᵢ is added to model air drag
when damping is nonzero.
Δ = θ₁ − θ₂, D = 2m₁ + m₂ − m₂ cos(2Δ)
θ̈₁ = [ −g(2m₁+m₂) sin θ₁ − m₂ g sin(θ₁ − 2θ₂) − 2 sin Δ · m₂ (θ̇₂² L₂ + θ̇₁² L₁ cos Δ) ] / (L₁ D)
θ̈₂ = [ 2 sin Δ · ( θ̇₁² L₁ (m₁+m₂) + g (m₁+m₂) cos θ₁ + θ̇₂² L₂ m₂ cos Δ ) ] / (L₂ D)
Ghosts & the Lyapunov fingerprint
Two faint trails follow copies of the primary system with its initial angles perturbed by 5×10⁻⁴ rad
— less than a thirtieth of a degree. In the low-energy regime (small swings) the trails track the
primary for a long time; crank up g or start near the inverted pose with Chaos burst
and the ghosts fan out within a handful of seconds. That separation is the Lyapunov exponent made visible.
Numerical note
Integration is classical 4th-order Runge–Kutta with Δt = 0.005. The |ΔE| readout tracks
drift from the initial total energy — a conservative system with zero damping should keep this tiny
even over millions of steps. If you see it grow, either damping is engaged or the dynamics have pushed
past where RK4 at this step size stays honest. Drop the integration speed to tighten the budget.
Try this
Grab the outer bob and hoist it near the top. Let go. The inner rod will appear to hesitate, then
whip around. Tune m₂ up while keeping the pose — the outer bob becomes the tail wagging
the dog, and the inner rod starts spinning freely. Add a whisper of damping and watch the trajectory
spiral inward toward the only fixed point that matters: straight down.