Double Pendulum Chaos Lab

Watch a double pendulum turn chaotic. The simulator integrates the full equations of motion with fourth-order Runge–Kutta, lets you drag the bobs to set the start, and launches a “ghost” 0.001 rad away so you can see two nearly identical swings split apart.

Tool Science & Engineering Updated Oct 4, 2026
How to Use
  1. Press Play. The pendulum starts from 107° and 101° with both rods 1 m long and both bobs 10 kg, and the lower bob soon whips round chaotically.
  2. Drag either bob to set your own start, or pick a preset such as the slow normal mode (10° and 14.14°), which swings almost periodically. Dragging pauses the run and zeroes both velocities.
  3. Move the sliders to change gravity, the two rod lengths and the two masses, then press Reset for a clean start.
  4. Press Add ghost to launch a copy 0.001 rad away and watch the readout’s ghost gap grow; up to five ghosts run at once.
  5. Read the total energy and its drift under the canvas, and scroll to Show Work for the state, the equations of motion with your numbers and one RK4 step. Use Show trail and Clear trails for the path of the lower bob.
Input
Presets (1 m rods, 10 kg bobs, g = 9.8)
SimulationDrag a bob to set the start, then Play
Total energy
—
Energy drift
—
Rod angles
—
Simulated time
—

Worked Example

The default start. Both rods are 1 m, both bobs 10 kg, g = 9.8 m/s², and the pendulum is held at θ₁ = 107.19° and θ₂ = 101.46°, both above the horizontal. With the pivot as zero, the potential energy is −(m₁ + m₂)g·l₁cos θ₁ − m₂g·l₂cos θ₂ = 77.39 J, all of it potential since nothing is moving yet. The equations of motion give θ₁″ = −9.077 rad/s² and θ₂″ = −0.573 rad/s²: the upper arm falls first and drags the lower one after it.

The ghost. Press Add ghost at the start and a second pendulum begins with θ₁ just 0.001 rad (0.057°) larger. The two lower bobs are 0.01 m apart after 4.96 s of simulated time, 0.1 m apart after 8.04 s and 1 m apart after 9.56 s; from then on the two swings are unrelated. Throughout, RK4 holds the total energy to within 0.0031% of the 294 J energy scale over the first 10 s.

The common mistake: treating it as two simple pendulums. A single 1 m pendulum swings with T = 2π√(l/g) = 2.007 s, but a double pendulum has no such period. For small swings with equal masses and lengths it has two normal modes, ω² = (g/l)(2 ∓ √2): the slow one has T = 2.622 s, with the lower rod swinging √2 times as far in the same direction (the 10° and 14.14° preset), and the fast one has T = 1.086 s, with the rods in opposition (10° and −14.14°). Any other small start is a mixture of the two.

Show Work

The current state, the equations of motion with your numbers, one RK4 step and the energy check appear here.

Formulas

Upper arm
θ₁″ = [−g(2m₁ + m₂)sin θ₁ − m₂g·sin(θ₁ − 2θ₂) − 2sin(θ₁ − θ₂)·m₂(ω₂²l₂ + ω₁²l₁cos(θ₁ − θ₂))] ÷ (l₁D)
Lower arm
θ₂″ = 2sin(θ₁ − θ₂)·[ω₁²l₁(m₁ + m₂) + g(m₁ + m₂)cos θ₁ + ω₂²l₂m₂cos(θ₁ − θ₂)] ÷ (l₂D)
D = 2m₁ + m₂ − m₂cos(2θ₁ − 2θ₂)
Energy
E = ½m₁l₁²ω₁² + ½m₂(l₁²ω₁² + l₂²ω₂² + 2l₁l₂ω₁ω₂cos(θ₁ − θ₂)) − (m₁ + m₂)g·l₁cos θ₁ − m₂g·l₂cos θ₂
RK4 step
y(t + h) = y + h/6·(k₁ + 2k₂ + 2k₃ + k₄), h = 0.01 s
Four steps per animation frame
Normal modes (small swings, equal m and l)
ω² = (g/l)(2 ∓ √2), θ₂/θ₁ = ±√2
T = 2.622 s and 1.086 s for l = 1 m, g = 9.8
Bob positions
(x₁, y₁) = l₁(sin θ₁, cos θ₁), (x₂, y₂) = (x₁, y₁) + l₂(sin θ₂, cos θ₂)

From Coupled Swings to Chaos

Daniel Bernoulli worked out the small oscillations of a double pendulum and of a hanging chain in the 1730s and found the special patterns in which every part swings at one frequency, the normal modes in the worked example; in 1753 he argued that any small motion is a sum of them. Joseph-Louis Lagrange’s Mécanique analytique of 1788 gave the general method, writing the equations of motion from the kinetic and potential energy, which is how the formulas above are derived.

The large swings could not be solved in closed form, and their unpredictability was only appreciated once computers could integrate them. Carl Runge (1895) and Martin Kutta (1901) developed the Runge–Kutta methods used here. Henri Poincaré had shown in the 1890s that a simple mechanical system can be sensitive to its starting point, and in 1992 Troy Shinbrot, Celso Grebogi, Jack Wisdom and James Yorke measured that sensitivity on a real double pendulum in the American Journal of Physics, in a paper titled “Chaos in a double pendulum”.

About This Tool

This lab integrates the full non-linear double-pendulum equations, not a small-angle approximation, with fourth-order Runge–Kutta at h = 0.01 s, four steps per frame. You can drag either bob to set the start, change gravity, rod lengths and masses on the fly, and run up to five ghost pendulums offset by 0.001 rad. The readouts give the total energy and its drift, which is the honest test of the integrator, the two rod angles, and the simulated time or the gap between the main pendulum and the first ghost. Show Work writes out the equations of motion with the current numbers and the next RK4 step.

The model is frictionless, so it never runs down the way a real pendulum does. Everything runs in your browser; nothing is uploaded.

Related tools: Physics Playground, Pendulum Calculator, and Chaos Theory Lab.

Frequently Asked Questions

What is a double pendulum?

A pendulum hung from the bob of another pendulum. It has two angles and two angular velocities, and its equations of motion are coupled and non-linear, so although it is built from two simple parts it is one of the simplest physical systems that can behave chaotically. At small angles it is still tame: with equal 1 m rods and equal masses it has two normal modes, with periods of 2.622 s (both rods in step, the lower one swinging √2 times as far) and 1.086 s (in opposition).

What does the ghost pendulum show?

Sensitive dependence on initial conditions. From the default start, a ghost whose upper angle is 0.001 rad (0.057°) larger follows the original closely for several seconds of simulated time, then the lower bobs are 0.1 m apart after 8.04 s and 1 m apart after 9.56 s. After that the two swings have nothing in common, although the equations are fully deterministic.

How accurate is the simulation?

It integrates the exact frictionless equations with fourth-order Runge–Kutta at a fixed step of 0.01 s. Total energy should stay constant, so its drift is a direct measure of numerical error: from the default start it changes by 0.0027% of the energy scale after 10 s and 0.023% after 60 s. A plain Euler step of the same size gains 9.5% in the first 2 s.

Why does the simulation run faster than real time?

Each animation frame advances the system by four RK4 steps of 0.01 s, so 0.04 s of simulated time. On a 60 Hz screen that is 2.4 simulated seconds every real second, which keeps the motion lively. The times in the readout and in Show Work are simulated seconds.

Does this run locally in my browser?

Yes. The integration, the energy bookkeeping and the drawing all run in JavaScript on your device, and nothing is uploaded. Once the page has loaded it keeps working offline.

How do I use the Double Pendulum Chaos Lab?

Simply type your numbers and read the result, which refreshes the instant you change something. There is nothing to submit and nothing to wait for.

Is it free? Does it work without internet?

Yes to both. It is free with no sign-up, and once the page has loaded it keeps working even with no internet.

Where does my data go?

Nowhere — every calculation runs on your own device. Nothing you enter is uploaded, logged, or stored.

Common Use Cases

Teaching chaos

Add a ghost 0.001 rad away and show the class the lower bobs drifting 1 m apart after 9.6 s of simulated time.

Normal modes

Start at 10° and 14.14° and watch a periodic swing of about 2.62 s, then flip the lower angle to −14.14° for the fast mode.

Testing integrators

RK4 at 0.01 s keeps energy to 0.0027% over 10 s; the same step with Euler drifts by 9.5% in 2 s.

Parameter studies

Make the lower bob 1 kg against an upper bob of 40 kg and the top rod barely notices it.

Generative art

Leave the trail on for the never-repeating curves the lower bob draws, up to 1,400 points long.

Last updated: