Double Pendulum SimulatorBeta
Watch hundreds of nearly identical pendulums diverge into chaos
This tool is a beta version still being stabilized. Please let us know if a result looks off.
Drag a bob to set the starting angles. With many pendulums they move as one at first, then suddenly scatter.
Working…
0.0
It hasn't frozen — the result will appear when the calculation finishes.
About Double Pendulum Simulator
This simulator does not run one double pendulum; it runs up to 1,000 of them side by side. They all share the same upper angle θ₁, but pendulum number i starts with its lower angle θ₂ nudged by i times the initial offset. With the defaults (100 pendulums, θ₁ = 126°, θ₂ = 149°, offset 10⁻⁶ rad) the two most different pendulums start about 10⁻⁴ rad apart, roughly six thousandths of a degree. For the first few seconds they look like a single pendulum drawn with a thick pen.
The equations of motion are the standard Lagrangian equations for two massless rods with point masses at their ends. Each 1/60-second frame is split into eight fourth-order Runge–Kutta (RK4) steps. There is no friction, so the Energy readout should stay flat; the engine's own test checks that energy drifts by less than 0.01% over 100 seconds. The Divergence readout, the standard deviation of the lower bobs' horizontal positions in metres, does the opposite: it sits near zero and then shoots up. That contrast between a conserved energy and an exploding spread is the whole point of the page.
Experiment 1: what a thousand times more precision buys you
Restart with the offset slider at −3, −6, −9 and −12. Integrating the same equations for a single pair of pendulums at the default angles and timing when their lower bobs' horizontal positions first differ by 10 cm gives these results: with a 10⁻³ rad offset that took about 4.3 s; with 10⁻⁶, 7.3 s; with 10⁻⁹, 10.3 s; with 10⁻¹², 14.7 s.
Every thousandfold improvement in the starting accuracy buys only about three more seconds. That is the signature of exponential error growth, δ(t) ≈ δ₀e^{λt}: since ln(1000) ≈ 6.9, three seconds per factor of 1,000 means λ is a little over 2 per second here. Improving a measurement by a factor of a million extends the forecast by a handful of seconds, which is what “sensitive dependence on initial conditions” means in practice. The on-screen ensemble scatters slightly earlier than these pair timings, because its outermost pendulum starts 99 offsets away from the first.
Experiment 2: small swings are not chaotic
Set θ₁ = θ₂ = 10°. Even after 120 simulated seconds the pendulums stay bunched together, and the same was true at 30°. At small angles sin θ ≈ θ, the equations become nearly linear, and the motion is a sum of two normal modes. For equal masses and 1 m arms the mode frequencies are ω² = (g/l)(2 ± √2), giving periods of about 2.62 s (arms swinging together) and 1.09 s (arms opposed). Their ratio is irrational, so the motion never exactly repeats, but a small error stays small. That is quasi-periodic motion, not chaos.
Raise both angles to 90° and the ensemble breaks up after roughly 18 seconds. The default 126°/149° start has enough energy for the lower arm to whip over the top, and it separates faster still. So the accurate statement is not “the double pendulum is chaotic” but “a double pendulum with enough energy is chaotic for most starting positions.”
Experiment 3: mass ratio, length ratio and gravity
Mass ratio sets the lower bob's mass while the upper bob stays at 1 kg. Length ratio is lower arm divided by upper arm, and the total length is held at 2 m. At a mass ratio of 0.05 the upper arm behaves almost like a simple pendulum while the light lower bob is flung around underneath it; with the default angles and a 10⁻⁶ rad offset, the lower bobs drift 10 cm apart after about 11.9 s while the upper arms hold out until about 14.7 s, because the light bob barely pulls back on them.
Gravity only rescales time. Quadruple g and every motion runs twice as fast, so the ensemble also scatters in about half the time. The shapes you see are identical.
Why constant energy does not mean predictable
Energy conservation tells you which states are allowed, not which one you will be in. At the defaults the total mechanical energy is about 19.9 J (measured from the pivot), and every one of the 100 pendulums has essentially that value. A few seconds later they are spread over completely different poses that all share it. Deterministic (same input, same output) and predictable (similar input, similar output) are different properties, and this system has the first without the second.
Real hardware behaves the same way. Shinbrot, Grebogi, Wisdom and Yorke (1992) measured the growth of uncertainties in a physical double pendulum and reported an exponent of λ = 7.5 ± 1.5 per second. Their pendulum was smaller than the 1 m arms used here, and because the natural rate scales roughly as √(g/l), shorter pendulums diverge faster.
What this model leaves out
The rods are massless and the bobs are points; a real double pendulum made of bars has large rotational inertia and different coefficients. There is no air drag or bearing friction, so nothing ever settles. Double-precision arithmetic also introduces rounding at the 10⁻¹⁶ level on every step, so with offsets as tiny as 10⁻¹² rad the exact moment of separation depends a little on the integration scheme. The conclusion that the pendulums separate does not.
Worked examples
Initial offset vs. time to separate
- Input
θ₁ 126°, θ₂ 149°, mass and length ratio 1, g 9.81, one pair of pendulums- Output
Lower bobs 10 cm apart after: 10⁻³ rad 4.3 s, 10⁻⁶ 7.3 s, 10⁻⁹ 10.3 s, 10⁻¹² 14.7 s
Each thousandfold smaller offset adds only about 3 s, so λ ≈ ln(1000)/3 ≈ 2.3 s⁻¹.
Normal modes at small angles
- Input
l₁ = l₂ = 1 m, m₁ = m₂, g = 9.81- Output
ω² = 9.81 × (2 ∓ 1.414) → periods 2.62 s and 1.09 s
Starting from θ₁ = θ₂ = 10°, the motion mixes these two modes and the ensemble is still together after 120 s.
How to use it
- Choose 1, 3, 100 or 1000 pendulums and set the start pose by dragging a bob or using the θ₁ and θ₂ sliders.
- Pick the initial offset (10^x rad); the run restarts automatically.
- Watch the Energy and Divergence readouts. Drop the speed to 0.1× to see the moment of separation in detail.
Frequently asked questions
Is a single double pendulum chaotic, or only the group?
A single one is. Running many copies is just a way to make its sensitivity visible; the chaos belongs to each pendulum's own equations.
What does the Divergence number measure?
The standard deviation, in metres, of the horizontal positions of all the lower bobs. It starts below 10⁻⁵ m and, once the group has scattered, hovers around the arm length of about 1 m.
If I restart with the same settings, will I get the same motion?
Yes. There is no randomness in the calculation, so the same device and settings reproduce the same trajectories. The unpredictability comes from never knowing a real starting state exactly.
Why does the energy drift slightly?
RK4 is an approximation that does not conserve energy exactly. Splitting each frame into eight steps keeps the drift tiny, and faster playback speeds automatically use more steps.
How is this related to the butterfly effect?
It is the same property Edward Lorenz found in a weather model in the early 1960s: tiny differences in the starting state grow exponentially. The Lorenz attractor page shows the original system.
Related guides
Sources
- T. Shinbrot, C. Grebogi, J. Wisdom, J. A. Yorke, Chaos in a double pendulum, Am. J. Phys. 60, 491 (1992)
- E. N. Lorenz, Deterministic Nonperiodic Flow, J. Atmos. Sci. 20, 130 (1963)
Last reviewed: