The double pendulum is one of the simplest mechanical systems that exhibits deterministic chaos. Two rigid links connected by frictionless pins follow Newton's second law exactly — yet tiny differences in starting angle diverge exponentially, making long-term prediction impossible. This is the butterfly effect made visible.
Drag the pendulum bobs to set initial angles, then release. Use the angle sliders in the control panel to set precise values. Enable trajectory trace to draw the chaotic path. Clone the simulation with a tiny offset to directly compare how two nearly-identical starting conditions diverge over time.
Henri Poincaré discovered the mathematical foundations of chaos in the 1890s while studying the three-body problem — a related system. The double pendulum's phase space contains both stable periodic islands and chaotic seas, depending on energy level. High energy → almost always chaotic; low energy → behaves like two coupled simple pendulums.
This canvas simulation integrates the equations of motion for a double pendulum — two rigid arms linked by a frictionless joint and swinging under gravity (g = 9.81 m/s²). Each pendulum's coupled second-order angular equations are advanced with a fourth-order Runge–Kutta (RK4) integrator using sub-stepping for stability. By launching up to forty copies whose start angles differ by just 0.0001 radians, it reveals deterministic chaos: identical physics, yet trajectories that diverge exponentially.
The phenomenon is sensitivity to initial conditions. The model uses the standard coupled angular accelerations for masses m1, m2 and arm lengths L1, L2, solved per frame by RK4 with eight sub-steps. Each pendulum traces the path of its lower bob, so near-identical starts visibly fan apart over time.
Sliders set Mass 1 and Mass 2 (0.2–5), Length 1 and Length 2 (50–180 px), the Trails length (50–2000 points), and the number of Pendulums (1–40). The panel reports a Chaos metric — the angular spread between copies in degrees — plus live FPS. Press Restart to re-seed all pendulums.
The double pendulum is one of the simplest mechanical systems whose motion is chaotic. It has no closed-form solution for large swings, so its future can only be found by numerical integration — and rounding error alone eventually makes any forecast unreliable.
A double pendulum is a pendulum with a second pendulum attached to the end of the first. Both arms swing freely under gravity, and because the lower arm's motion feeds back into the upper arm, the combined system is highly nonlinear and, at most energy levels, chaotic.
It solves the two coupled angular equations of motion for the arm angles using a fourth-order Runge–Kutta (RK4) integrator. Each animation frame is split into eight sub-steps for numerical stability, and gravity is fixed at 9.81 m/s², the value at Earth's surface.
Mass 1 and Mass 2 set the weight of each bob, while Length 1 and Length 2 set the arm lengths in pixels. Trails sets how many past points of the lower bob are drawn, and Pendulums sets how many copies run at once — each copy starts at a slightly different angle so you can watch them diverge.
The copies start only 0.0001 radians apart, but a chaotic system amplifies any difference exponentially. After a short time those microscopic offsets grow into completely different swings — the classic butterfly effect — which the on-screen Chaos value reports as the angular spread in degrees.
The equations are the correct frictionless double-pendulum dynamics, and RK4 is an accurate solver, so the short-term behaviour is realistic. It is idealised, however: there is no air resistance or joint friction, the arms are massless rigid rods, and lengths are in screen pixels rather than metres.