Clever Quest Lab ← Labs

Double Pendulum

Drag the bobs, let go and watch a simple machine turn chaotic.

Drag either bob to set the start angles (the simulation pauses while you hold it). Keyboard: Space play/pause, . step, R reset, arrow keys change the angles.

Readouts

θ1
0°
θ2
0°
ω1 rad/s
0
ω2 rad/s
0
Energy
0
Energy drift
0 %
Time
0.00 s

Phase space: θ2 (across) against ω2 (up).

Presets

Pendulum

Traces and plots

Chaos mode

Neighbouring pendulums start δ radians apart in θ1. Changing these settings restarts from the start angles.

How to play

This is a sandbox, not a game with a score. A double pendulum is one rod hanging from a pivot with a second rod hanging from its end. Grab either bob and drag it to choose the starting angles, then let go. The simulation runs as soon as you release. Watch the second bob: for small swings it moves in a neat, almost repeating pattern, but with a bigger start it wanders in a way that looks random, even though every step follows exact laws.

Try the presets first. “Small swing” is nearly periodic, “Large swing” is chaotic, and “Chaos fan” launches 100 pendulums whose starting angles differ by only one hundred-thousandth of a radian. At first they move as one. After a while the fan tears apart into every colour of the rainbow.

Controls

The equations

Each angle θ is measured from straight down. Write Δ = θ1 − θ2, ω = dθ/dt and α = dω/dt. The point masses hang on massless rods, and the equations of motion, derived from the Lagrangian, are:

(m1+m2)L1α1 + m2L2α2 cosΔ = −m2L2ω2² sinΔ − (m1+m2)g sinθ1
m2L2α2 + m2L1α1 cosΔ = m2L1ω1² sinΔ − m2g sinθ2

These are two linear equations in α1 and α2, so the simulator solves them at every step. It then advances the angles and angular velocities with the fourth-order Runge–Kutta method (RK4) using a fixed step of 2 milliseconds. The damping slider adds a friction torque −cω at each joint. The total energy is:

E = ½(m1+m2)L1²ω1² + ½m2L2²ω2² + m2L1L2ω1ω2 cosΔ − (m1+m2)gL1 cosθ1 − m2gL2 cosθ2

With damping at zero, energy should stay constant. The “Energy drift” readout shows the change since the start as a percentage of the energy above the resting position. It stays tiny, which shows that the numerical method is doing its job. With damping above zero, energy only ever goes down.

Why it is chaotic

Chaos here means sensitive dependence on starting conditions: two runs that begin almost identically separate faster and faster. Turn on Chaos mode and open the divergence chart. It plots the angle difference of the first two pendulums on a logarithmic scale, so a steady rise means roughly exponential growth. Nothing random is involved. The motion is fully determined, but any tiny error or rounding difference gets amplified, so long-term prediction is practically impossible. Small swings are different: the pendulum behaves almost like two coupled simple oscillators and stays regular.

The phase-space plot draws θ2 against ω2. Regular motion gives tidy closed loops; chaotic motion fills the plane in a tangle.

Tips and strategy

Frequently asked questions

Is the double pendulum really random?

No. The equations are deterministic. It only looks random because tiny differences grow so quickly that you cannot predict the far future from a measured start.

Why does the energy drift a little?

Any numerical integrator has a small error. RK4 with a 2 ms step keeps it far below a thousandth of a percent over a minute of simulated time in typical runs, but it is not exactly zero.

Why do my results differ from someone else’s run?

Different step sizes, methods or rounding lead to different paths once the motion is chaotic, even though all are “correct” in a statistical sense.

What does the damping slider do?

It adds a friction torque proportional to each joint’s angular velocity. Energy then only decreases, and the pendulum slowly settles to hang straight down.

Is this physically accurate for a real toy?

It is the ideal model: point masses, massless rigid rods, no air drag unless you add damping. Real pendulums have rod inertia and friction, so their details differ.

More free games