Double Pendulum Simulator: Chaos and the Butterfly Effect

A free double pendulum simulator: drag the balls to set the start, watch the chaotic motion and its colourful trail, launch a fan of copies to see the butterfly effect, read the divergence graph, and explore the fractal chaos map of how long it takes to flip.

Two arms joined end to end, swinging under gravity. It sounds simple, and it is the textbook example of chaos: start it twice from almost the same place and the two motions soon have nothing to do with each other. Drag either ball to set the start, turn on the copies and watch tiny differences blow up.

1×
Time–real time
Energy kept to–relative drift (zero damping)
Outer ball flips–times over the top
Copies differ by–

Angle of the upper arm: °
Angle of the lower arm: °
Copies: 1 = one pendulum. 2 = a twin. 30 or more = a rainbow fan.
Copies start apart by: Change in the upper arm's angle, in radians.
Masses, lengths, gravity and friction
Upper ball mass:
Lower ball mass:
Upper arm: m
Lower arm: m
Gravity: m/s²
Friction:
Trail:

Why a double pendulum is chaotic

One pendulum is the most predictable machine there is: it swings with the same rhythm forever. Hang a second pendulum from the end of the first and the rhythm is gone. Two angles and two speeds are enough to make the motion chaotic: it follows exact laws, with no randomness, yet two starts that differ by a hair end up completely different. That is the butterfly effect. Set Copies to 2 with the difference at 10⁻⁹ radians (a billionth), and the two pendulums stay together for a few seconds, then split and are unrelated.

energy \(\displaystyle \begin{aligned}E ={}& \tfrac12 (m_1+m_2)\, l_1^2\,\omega_1^2 + \tfrac12 m_2\, l_2^2\,\omega_2^2 + m_2\, l_1 l_2\,\omega_1\omega_2\cos(\theta_1-\theta_2)\\ &- (m_1+m_2)\, g\, l_1\cos\theta_1 - m_2\, g\, l_2\cos\theta_2\end{aligned}\)
small swings \(\displaystyle m_1 l_1 l_2\,\omega^4 - g\,(m_1+m_2)(l_1+l_2)\,\omega^2 + g^2\,(m_1+m_2) = 0\)

What to look at

  • Small swings are tame. With the arms near straight down, the motion is two simple swings added together (the two normal modes, listed under the controls). Start exactly on one of them (the “Slow mode” and “Fast mode” examples) and it repeats perfectly.
  • Large swings are chaotic. Try “Chaotic” with two copies. The lower graph shows the gap between them growing about as fast as an exponential: a straight line on the log scale until it reaches the size of the pendulum itself. The page estimates the growth rate (the Lyapunov exponent) from that slope.
  • The chaos map. It colours every starting position by how long the outer arm takes to flip over the top. Calm starts form a smooth dark island in the middle, bordered by thin streaks and fractal tendrils where a tiny change of start flips the pendulum at a very different time. Click a point to see it swing.
  • Energy is the check. With friction at zero the total energy should stay constant: the page shows how well. A pendulum released at rest can only flip if its starting energy is above a threshold, which is exactly how the black region is found (those starts are not even simulated).

How it is computed

The two equations of motion come from Lagrangian mechanics and are integrated with a fourth-order Runge–Kutta method with a step of 2 milliseconds (the energy of a chaotic minute is conserved to about one part in a million). The chaos map integrates every starting point separately until its outer ball passes the top. Friction here is a simple term proportional to each arm's rotation speed, not a model of any particular bearing. Chaotic motion cannot be predicted for long by any computer: after about ten seconds even tiny rounding errors in the arithmetic change the details (the broad pattern stays the same).

Everything runs on your device and nothing is uploaded. Orbit Simulator · Fluid Simulator · Mandelbrot Explorer · More MES tools

Comments
Advertisement