Double Pendulum Chaos

Drag the bobs of a double pendulum and let go; copies started a trillionth of a radian apart soon diverge.

100%

A double pendulum swung high is chaotic: the tiniest change in how it starts grows until the swing is completely different. Drag either bob to set the starting angles, or tap anywhere else to start the swing again; try Butterfly to release nearly identical copies, or open the Chaos map and tap any point to swing from there.

Setup
Show
50°
50°
Model
1.0 kg
1.00 m
View
1.00× real time

How is Double Pendulum Chaos working for you?

About Double Pendulum Chaos

Integration
Fourth-order Runge-Kutta, 500 steps a second
Butterfly mode
Up to 1,000 copies
Chaos map
262,144 pendulums on the GPU
Lyapunov exponent
About 1 per second for a high swing

Good for: Learning by watching

A double pendulum is a pendulum with a second pendulum hanging from its end. Its motion follows Newton's laws exactly, with nothing random about it, yet started from a high swing it never repeats itself and soon becomes impossible to predict. That is chaos: deterministic motion so sensitive to its starting point that the smallest difference grows exponentially. Edward Lorenz described the same behavior in a simple weather model in 1963, and Troy Shinbrot and colleagues built a real double pendulum in 1992 and measured how quickly two nearly identical launches drift apart.

The simulator integrates the exact equations of motion with the fourth-order Runge-Kutta method in steps of 1/500 of a second, and shows how far the total energy has drifted from its starting value, a check on the arithmetic since a frictionless pendulum keeps its energy. Small swings stay regular: they combine two normal modes, the arms swinging together slowly or against each other quickly, and trace tidy repeating patterns. Swing it high enough for an arm to go over the top and the trail turns into a tangle. In 1993 Levien and Tan turned a real double pendulum into a student experiment in chaos.

Butterfly mode releases up to 1,000 copies whose starting angles differ by as little as a trillionth of a radian. For a while they move as one, then they fan out across the whole range of motion. The chart shows the gap between the first and last copy on a scale of powers of ten: in chaotic motion it climbs along a straight line, and its slope is the Lyapunov exponent, about 1 per second for a high swing, meaning the gap grows tenfold every two seconds or so. The Chaos map runs one pendulum per pixel on your graphics card, each from a different starting position, and colors it by how soon an arm flips over: smooth regions sit next to intricately folded ones, a picture of where the motion is predictable and where it isn't.

How to use Double Pendulum Chaos

  1. Set the start. Drag either bob to set its arm's starting angle and let go to release it from rest, or use Upper angle and Lower angle. Restart or a tap on the board releases it again from the same angles.
  2. Change the pendulum. Lower mass and Lower arm change the second bob's mass and arm length; the upper bob is 1 kg on a 1 m arm. Speed slows the motion down or speeds it up without changing it.
  3. Release the copies. Pick Butterfly, set Copies from 2 to 1,000 and the Starting difference between the first and last copy, then watch them separate. The readout estimates the Lyapunov exponent from the chart, and at 30 s each run adds a row to the Runs table with the exponent and the settings that differ between rows; Reset clears the table.
  4. Explore the chaos map. Pick Chaos map to start a pendulum from every pair of angles at once. Bright pixels flip an arm over the top quickly, dark ones slowly, black ones not at all; tap any pixel to watch that pendulum swing.
  5. Check the energy. The stats line shows the energy drift, how far the total energy has wandered from the start as a share of the pendulum's whole range. It typically stays below a millionth, so the chaos isn't numerical error.
  6. Export. Save a PNG, a video or GIF, or the angles over time as a CSV file, with the gap between copies in Butterfly mode, and the Runs table. Record 30 s from the start releases the pendulum again and records its first 30 seconds.

Frequently asked questions

Why is a double pendulum chaotic?

Its two arms trade energy back and forth through the joint, and the way they interact depends strongly on the angle between them. At high energy this makes nearby paths separate exponentially fast: a difference of a billionth of a radian becomes a completely different swing within about twenty seconds. The equations are known exactly, but predicting the motion far ahead would need the starting angles to impossible precision.

What is the butterfly effect?

Sensitive dependence on initial conditions: in a chaotic system a tiny change at the start, like the flap of a butterfly's wings, can lead to a large difference later. Edward Lorenz described it in 1963, after rounding the numbers in his weather model changed its forecast completely. Butterfly mode shows it directly with copies that start almost exactly alike.

What is a Lyapunov exponent?

The rate at which nearby starting points separate. If the gap grows like e^(λt), λ is the Lyapunov exponent: positive means chaos, zero means regular motion. The chart plots the gap on a scale of powers of ten, so exponential growth is a straight line whose slope gives λ. For a high swing of two equal arms it comes out near 1 per second.

Is the chaos real or a rounding error?

Real. The integration error is tiny, as the energy drift shows, and the separation of copies grows at the same rate whether they start a millionth or a trillionth of a radian apart. Rounding does mean that no computer can follow a chaotic pendulum exactly for long, which is the point: neither could any measurement of a real one.

What does the chaos map show?

Every starting position at once: the upper arm's angle across, the lower arm's down, each pixel a pendulum let go from rest. Its color is the time until either arm first flips over the top. The black center can never flip because it doesn't have enough energy, while near the edges smooth bands give way to finely folded patterns, the signature of chaos. It runs in single precision on the graphics card, so the finest details depend on rounding.

Does the swing ever repeat?

Small swings come close: they are a mix of two normal modes with different frequencies, so the pattern almost repeats. High-energy chaotic swings never repeat exactly, although by Poincaré's recurrence theorem they eventually come back arbitrarily close to where they started, after an astronomically long time.

References

  1. Lorenz, E. N. (1963). Deterministic nonperiodic flow. Journal of the Atmospheric Sciences 20(2), 130–141.
  2. Shinbrot, T., Grebogi, C., Wisdom, J., & Yorke, J. A. (1992). Chaos in a double pendulum. American Journal of Physics 60(6), 491–499.
  3. Levien, R. B., & Tan, S. M. (1993). Double pendulum: An experiment in chaos. American Journal of Physics 61(11), 1038–1044.
  4. Strogatz, S. H. (2015). Nonlinear Dynamics and Chaos (2nd ed.). Boulder, CO: Westview Press.