SimulatorEducationEntertainmentBrain

Double Pendulum Chaos

Watch a double pendulum trace looping, beautiful chaos in real time. Clone the pendulum with sub-millidegree angle offsets to see how identical-looking starts diverge into completely different motions.

Upper angle θ₁120°
Lower angle θ₂140°
Speed1.20×
Trail fade7.0%

Chaos demo — clone pendulums with sub-millidegree angle offsets

What you are watching

A double pendulum is two rods hinged in series — a perfectly deterministic mechanical system with only four state variables (two angles, two angular velocities). Yet its motion is one of the textbook examples of deterministic chaos: tiny changes in the starting angles lead to exponentially different paths.

The simulator integrates the Lagrangian equations of motion with a fourth-order Runge-Kutta solver (RK4) so energy stays roughly stable over long runs. Each substep advances the state by dt; faster speeds compress more substeps into every frame.

The equations

With both masses and both rod lengths equal to 1 and gravity normalized to 1, the angular accelerations reduce to:

α₁ = (−3·sin θ₁ − sin(θ₁ − 2θ₂) − 2·sin(θ₁ − θ₂)·(ω₂² + ω₁²·cos(θ₁ − θ₂))) / (3 − cos(2θ₁ − 2θ₂))

α₂ = (2·sin(θ₁ − θ₂)·(2ω₁² + 2·cos θ₁ + ω₂²·cos(θ₁ − θ₂))) / (3 − cos(2θ₁ − 2θ₂))

These aren't mysterious — they fall straight out of the Lagrangian L = T − V (kinetic minus potential energy). What is mysterious is that such a clean expression produces unpredictable motion. The denominator (3 − cos(2θ₁ − 2θ₂)) is always positive, so there are no singularities — just runaway sensitivity.

The butterfly effect, made visible

Turn on +5 or +15 ghosts and the chaos becomes undeniable: every ghost starts with an angle offset of about 0.06 millidegree — smaller than the width of an atom relative to the pendulum's length. For a few seconds they overlap perfectly. Then they spread, then they scatter, then they have nothing in common.

That is Edward Lorenz's 1963 discovery in physical form: sensitive dependence on initial conditions — the inability to predict weather more than two weeks out, the reason why no measurement is ever "precise enough" for a chaotic system.

Things to try

  • Low-energy regime: set both angles near 0° (small swings) — the motion is nearly periodic and predictable. Chaos needs energy.
  • High-energy regime: push θ₁ near ±180° (upside down) — flips, loops, and dramatic divergence.
  • Long trails: drop trail fade below 1% to leave near-permanent paths and see how the system explores its phase space.
  • Slow motion: reduce speed to 0.3× to study a single flip in detail.