Double Pendulum Simulator
A pendulum hanging from a pendulum: simple to build, impossible to predict. Drag it to any angle and let go, watch the glowing trail, and release dozens of pendulums that start a billionth of a radian apart to see the butterfly effect happen in front of you.
Phase space
lower arm: angle → speed ↑Drag a bob to set its angle (the pendulum pauses while you drag). With more than one pendulum, all of them start from that position, a tiny bit apart. Space play/pause · F full screen
Angles over time
θ₁ upper θ₂ lowerEnergy
kinetic potential totalDivergence (log scale)
distance between pendulum 1 and 2Divergence needs at least 2 pendulums. A straight rising line on the log scale means the difference grows exponentially — the signature of chaos. Its slope is the Lyapunov exponent.
Pick an experiment. The pendulum restarts with its settings and starts swinging.
Export
How the simulation works
- Two point masses hang on rigid, weightless rods. Gravity pulls them down and the rods pull them around the pivot.
- The exact equations of motion (from Lagrangian mechanics) are solved with the Runge–Kutta 4 method in steps of 2 milliseconds.
- The motion is deterministic — the same start always gives the same path — yet chaotic: tiny differences grow exponentially, so prediction soon becomes impossible.
- Without damping, total energy stays constant; the small drift shown is the numerical error.
Real pendulums also lose energy to air and friction in the joints; use damping to model that. Everything runs in your browser.
Using Double Pendulum Simulator
A pendulum hanging from a pendulum: simple to build, impossible to predict. Drag it to any angle, watch its chaotic swing, and release many nearly identical pendulums to see the butterfly effect in action.
- Press Play or drag either bob to a new starting angle and let go.
- Watch the trail of the lower bob. Small angles give a calm, regular swing; large angles turn chaotic.
- Choose Butterfly effect to release many pendulums that start a billionth of a radian apart — they stay together, then suddenly fly apart.
- Change lengths, masses, gravity and damping in Settings.
- Read the energy, angle, phase-space and divergence charts, and download the data as CSV.
Example
Butterfly effect: 50 pendulums start almost identically. After a few seconds their paths split into a rainbow fan. Gentle swing: started at 10°, the pendulum moves in a smooth, repeating pattern — not chaotic at all.
Questions & answers
Why is the double pendulum chaotic?
Its motion depends extremely sensitively on the starting position. Tiny differences grow exponentially, so after a short time the motion cannot be predicted even though the equations are exact.
What is the butterfly effect?
The idea that a tiny change (like a butterfly's wing beat) can lead to a very different outcome later. The simulator shows it with pendulums that differ by a billionth of a radian.
How is the motion calculated?
The Lagrangian equations of motion for two point masses on rigid, massless rods are solved with a 4th-order Runge–Kutta method in small time steps.
What is the phase-space plot?
It plots an angle against its angular speed. Regular motion draws neat closed loops; chaotic motion fills the plot in a tangled way.
What does the divergence chart show?
How far apart two nearly identical pendulums are over time, on a log scale. A straight rising line means exponential growth; its slope estimates the Lyapunov exponent.
Why does energy stay almost constant?
Without damping, no energy is lost. The tiny drift comes from the time step; damping deliberately removes energy.
Can I export data?
Yes, as CSV (time, angles, speeds, energy) or a PNG snapshot.
Help improve this tool
Report a problem or suggest an improvement
Describe the issue without pasting private tool input. Feedback goes to our admin inbox.
