Double Pendulum Screensaver
Double Pendulum is a free, in-browser simulation of a pendulum hanging from a pendulum, integrated with its full equations of motion. Ten of them are released side by side from starting angles that differ by a ten-thousandth of a radian; for a second or two they move as one, then they diverge completely, and the coloured trails their tips leave behind are the textbook picture of chaos. Nothing to download, and ESC exits at any time.
How the Double Pendulum screensaver works
A double pendulum has two rods and two masses, and its motion is governed by a pair of coupled second-order equations that come from the Lagrangian. They are not solvable in closed form, so the saver integrates them numerically with a fourth-order Runge–Kutta step at four thousand steps per simulated second, which keeps the energy steady over a long run.
Released from a high enough angle the system is chaotic: the second bob flips over unpredictably, and two starting states that differ by any amount at all separate exponentially fast. The Initial spread setting is that difference, in ten-thousandths of a radian.
Each pendulum draws its tip’s path onto a trail layer that fades slowly, so the recent past stays bright and the deep past dissolves. The rods themselves are drawn thinly over the top with the tips as coloured dots, one hue per pendulum.
After a little over a minute the trails are faded out and a new set is released from a fresh random starting angle, so the divergence can be watched again from the beginning.
Chaos in a pendulum hung from a pendulum
A single pendulum is the textbook example of regular motion: for small swings its period barely depends on how far it swings. Attach a second pendulum to the end of the first and the behaviour changes entirely. The system has two degrees of freedom and, at higher energies, it exhibits deterministic chaos, in which the equations are exact but tiny differences in the starting position are amplified exponentially.
This sensitivity is popularly called the butterfly effect. Edward Lorenz noticed it in 1961, when a weather simulation restarted from a rounded value diverged completely from the original run, and he published the result in 1963 in Deterministic Nonperiodic Flow; the butterfly image came later, from a 1972 conference talk title. It does not mean the motion is random. Given identical starting angles, the double pendulum retraces its path exactly; the trouble is that no real measurement is exact, so long-term prediction is impossible in practice. Physicists measure this with a Lyapunov exponent, the rate at which nearby trajectories diverge.
Not every release is chaotic. From low starting angles the motion is a blend of two regular modes and stays orderly, and the chaos appears when there is enough energy for the lower arm to flip over. That mix of order and disorder is why the double pendulum is a standard demonstration in physics classes and in desk toys.
A worked example
At the defaults — 10 pendulums, spread 3, Speed 4, Spectrum palette — a single rainbow-edged pendulum swings down and flips, then a second later fans open into ten distinct pendulums whose tips scribble ten different loops. Within ten seconds the trails are an unrelated tangle. Set the spread to 1 and the fan takes noticeably longer to open; set it to 10 and it opens almost at once.
Settings & tips
- A single pendulum with a slow trail fade draws a clean, looping figure over a minute.
- Forty pendulums at spread 1 make a rainbow ribbon that tears itself apart.
- Speed 1 makes the flips slow enough to see the second bob hang, hesitate, and fall.
Frequently asked questions
- Why is the double pendulum chaotic?
- Because its two rods trade energy in a way that depends sensitively on their exact configuration. At low energy it swings predictably, but once the lower bob has enough energy to flip over, nearby starting states diverge exponentially and long-term prediction becomes impossible.
- Is the simulation physically accurate?
- It integrates the exact equations of motion for two equal masses on two equal rigid rods under gravity, without friction, using a fourth-order Runge–Kutta scheme. Energy drift is negligible over a run, so what you see is genuine dynamics, not an animation.
- Will this slow my computer down?
- It is tuned to run smoothly on an ordinary laptop. If it feels heavy, raise the Pixel size or lower the speed in the settings; every control takes effect immediately.
- Is the Double Pendulum screensaver free?
- Yes. It runs free in your browser with nothing to download or install, and it keeps working offline once the page has loaded.
- How do I exit the Double Pendulum screensaver?
- Press the ESC key at any time to leave fullscreen and return to the page.
- Is chaotic motion random?
- No. It follows exact laws and is repeatable from identical conditions, but small differences grow so fast that long-range prediction fails.
- What is a Lyapunov exponent?
- A measure of the average rate at which two nearby starting states separate. A positive value indicates chaos.
- Why is a low swing not chaotic?
- At small angles the motion splits into two simple modes, and the system lacks the energy to enter the irregular flipping regime.