Theory

Double Pendulum

OscillationsSimple and physical pendulums

Introduction

A double pendulum is a second pendulum arm hung from the bob of a first one, both swinging from a single fixed pivot under gravity alone. The simulator runs that geometry with arms of length L₁ = 1.0 m and L₂ = 1.0 m, point bobs of mass m₁ = m₂ = 1 kg, and a 30-second hard stop on the Time readout. Released from θ₁ = 120° and θ₂ = 60° measured from the downward vertical, the lower bob immediately begins tracing a tangle of loops across the canvas that never repeats and never settles into a recognisable rhythm.

The system matters because it is the simplest mechanical setup in which deterministic equations produce motion that no one can predict in detail. Lagrangian mechanics writes down two coupled, nonlinear, second-order differential equations for θ₁ and θ₂; those equations have no closed-form solution and must be integrated numerically. The double pendulum became the standard demonstration of chaos in classical physics, and the same coupled-nonlinear-oscillator template reappears in robotics, biomechanics, and weather modelling.

A common first guess is that the simulator must be using random numbers somewhere, because two runs with almost the same starting angles diverge so quickly. The simulator demonstrates otherwise: the equations are entirely deterministic, the integrator is a fourth-order Runge-Kutta scheme with no noise, and the Energy readout sits near 4.91 J for the full 30 s, confirming that nothing stochastic is being injected — the chaos is built into the equations themselves.


The Physics Explained

Each arm contributes one degree of freedom — its angle from the downward vertical — so the full state of the system is the vector (θ₁, θ₂, θ₁', θ₂'). Lagrangian mechanics derives the equations of motion from a single scalar function, the Lagrangian L = KE − PE. With m₁ = m₂ = 1 kg, L₁ = L₂ = 1.0 m, and g ≈ 9.81 m/s², plugging the kinetic and potential expressions into the Euler-Lagrange procedure produces two coupled second-order ODEs that mix θ₁'' and θ₂'' through cos(θ₁ − θ₂) terms. The simulator solves them as a four-dimensional first-order system using RK4 at a 1/240-second substep.

The nonlinearity has two sources. First, gravity contributes sin(θ) terms rather than the linear θ approximation that turns a single pendulum into a clean sinusoid. Second, the coupling itself is nonlinear: the cos(θ₁ − θ₂) and sin(θ₁ − θ₂) factors mean the upper arm's effect on the lower depends on their relative orientation in a way that cannot be reduced to a constant spring-like coefficient. At the default release of θ₁ = 120° and θ₂ = 60°, both effects are large, and the trajectory the lower bob traces fills a roughly annular region of the canvas rather than repeating a closed curve.

Energy is the one quantity that stays predictable. With θ₁ = 120°, θ₂ = 60°, and the system released from rest, the kinetic energy is zero and the potential energy is roughly 4.91 J relative to the bobs' lowest point, which is exactly what the Energy readout displays at t = 0.00 s. Because gravity is the only force and there is no damping, total mechanical energy is conserved exactly under the Lagrangian flow; the simulator's RK4 step preserves it to the level of numerical noise. After the 30-second run, the Energy readout still sits near 4.91 J, drifting at most by a few hundredths of a joule.

What makes the system chaotic is the positive Lyapunov exponent λ. Two trajectories whose initial angles differ by δ(0) separate roughly as |δ(t)| ≈ |δ(0)|·exp(λ·t). For this configuration λ falls in the range of about 1 to 3 inverse seconds, so a 1° offset grows to order 10° within a few seconds and saturates at the system size shortly after. Resetting the simulator, changing Initial Angle 1 from 120° to 121° and leaving every other slider untouched, then comparing against the first run produces two trails that are visually identical for the first second or so and share no recognisable feature by the end of the 30-second window.


Key Equations

Total kinetic energy of both bobs KE = ½·(m₁ + m₂)·L₁²·θ₁'² + ½·m₂·L₂²·θ₂'² + m₂·L₁·L₂·θ₁'·θ₂'·cos(θ₁ − θ₂)

At t = 0.00 s the simulator is released from rest, so θ₁' = θ₂' = 0 and the entire KE expression evaluates to zero. The Energy readout therefore reflects only the potential term at the start, with no kinetic contribution.

Total gravitational potential energy of both bobs PE = −(m₁ + m₂)·g·L₁·cos(θ₁) − m₂·g·L₂·cos(θ₂)

For m₁ = m₂ = 1 kg, L₁ = L₂ = 1.0 m, g ≈ 9.81 m/s², θ₁ = 120°, θ₂ = 60°: PE = −(2)·9.81·1.0·cos(120°) − 1·9.81·1.0·cos(60°) = −19.62·(−0.5) − 9.81·0.5 = 9.81 − 4.91 ≈ 4.91 J relative to the lowest-point reference. The Energy readout shows 4.91 J before Start is pressed, matching this calculation exactly.

Conservation of total mechanical energy E = KE + PE = constant (no friction, no air resistance)

Lagrangian mechanics conserves total mechanical energy exactly when the only forces are conservative, which is the case here. After running the default configuration for the full 30 s, the Energy readout still displays a value within a few hundredths of a joule of the initial 4.91 J, with the small drift arising entirely from finite-step numerical integration rather than from real physics.

Exponential divergence of nearby trajectories |δ(t)| ≈ |δ(0)|·exp(λ·t), where λ is the Lyapunov exponent

For this configuration λ is roughly 1 to 3 s⁻¹. With δ(0) = 1° (the difference between θ₁ = 120° and θ₁ = 121°), the predicted separation at t = 5 s is somewhere between 1°·e⁵ ≈ 148° and 1°·e¹⁵ — orders of magnitude larger than the system size, which simply means the bound saturates. The simulator confirms this: the two runs' lower-bob trails share no recognisable feature past the first few seconds.


Key Variables

Symbol Name Unit Meaning
θ₁Upper arm angleradAngle of the upper arm from the downward vertical
θ₂Lower arm angleradAngle of the lower arm from the downward vertical
θ₁'Upper angular velocityrad/sRate of change of the upper arm's angle
θ₂'Lower angular velocityrad/sRate of change of the lower arm's angle
m₁, m₂Bob masseskgPoint masses at the ends of the upper and lower arms
L₁, L₂Arm lengthsmLengths of the upper and lower massless rigid rods
gGravitational accelerationm/s²9.81 m/s² downward at Earth's surface
ETotal mechanical energyJSum of kinetic and potential energy; conserved
λLyapunov exponent1/sRate at which nearby trajectories diverge

Real World Examples

Why does a gymnast's release timing matter so much on the high bar?

A gymnast swinging on the high bar and releasing into a somersault behaves approximately like a driven double pendulum: the body's torso forms one arm, the legs and hips form the other, and the hands at the bar act as the pivot. Because the system is in a chaotic regime once the swing amplitude is large, the angle of the body at any future moment depends sensitively on the joint angles at the moment of release. Coaches train release timing to the millisecond because a delay of even a few hundredths of a second changes the rotation count by a measurable fraction.

The simulator quantifies what "sensitive" means here. With the default geometry of L₁ = 1.0 m, L₂ = 1.0 m and angles θ₁ = 120°, θ₂ = 60°, a 1° change in Initial Angle 1 produces trails that are visually identical for the first second and share no recognisable structure by the time the Time readout reaches 30.00 s. A gymnast's timing tolerance is the analogue of that 1° offset, and the Lyapunov exponent λ ≈ 1 to 3 s⁻¹ that governs the simulator is the same order of magnitude as the divergence rate that limits how repeatable a routine can be.

How accurate can a long-range weather forecast really be?

The atmosphere is far more complex than a double pendulum, but it shares the same structural property: a small set of nonlinear differential equations whose solutions exhibit positive Lyapunov exponents. Edward Lorenz's 1963 weather-model paper made this connection explicit, and the modern figure of about two weeks as the practical predictability horizon for the global atmosphere comes from the same exp(λ·t) scaling that controls the double pendulum, just with a much smaller λ on the order of 1 per few days rather than 1 per second.

The simulator gives a hands-on feel for what that scaling implies. Holding the default configuration with arm lengths of 1.0 m and angles 120° and 60°, the Energy readout stays within hundredths of a joule of 4.91 J across the full 30-second run, so nothing stochastic is being added — yet a 1° tweak to Initial Angle 1 produces a totally different lower-bob trail. Weather models behave the same way: the equations are exactly known, total mass and energy are conserved, but the initial state is measured to finite precision and that finite precision sets a hard ceiling on the forecast horizon.

Why do two-link robotic arms need such elaborate control software?

A two-segment robotic arm with rotary joints at the shoulder and elbow is geometrically a double pendulum. Without active control, the arm's free dynamics are chaotic at any meaningful working amplitude, so the controller cannot operate as a feed-forward planner; it must close a feedback loop fast enough to suppress the divergence between the actual joint state and the planned trajectory before the Lyapunov-driven error accumulates. This is why industrial robot controllers run at kilohertz update rates and why their software stacks include real-time operating systems.

The simulator illustrates the worst-case open-loop behaviour the controller has to fight. With L₁ = 1.0 m, L₂ = 1.0 m and the system released from θ₁ = 120° and θ₂ = 60°, the lower bob's trail by t = 30.00 s covers a roughly annular region of the canvas with no repeating structure. A controller running once per second would already be hopeless under these dynamics, since λ ≈ 1 to 3 s⁻¹ amplifies any uncorrected error by a factor of e to e³ between updates. The kilohertz rate brings the per-update growth factor close to one, which is precisely what makes feedback control feasible.


Further Reading