How it works
The system has two degrees of freedom: the angles θ₁ and θ₂ of the upper and lower arms. The equations of motion fall out of the Lagrangian L = T − V (kinetic minus potential energy). They are coupled, nonlinear, and have no closed-form solution:
θ₁'' = [−g(2m₁+m₂)sin θ₁ − m₂g sin(θ₁−2θ₂) − 2sin(θ₁−θ₂)m₂(θ₂'²l₂ + θ₁'²l₁cos(θ₁−θ₂))]
/ [l₁(2m₁ + m₂ − m₂cos(2θ₁−2θ₂))]
The sin(θ₁ − θ₂) coupling and the cos(2θ₁ − 2θ₂) in the denominator are the troublemakers: they tie the two arms together nonlinearly, which both blocks an analytic solution and seeds the exponential divergence. The simulation integrates these equations numerically, advancing every pendulum in small time steps and tracing the path of each lower tip.
Chaos is not randomness
Here is the subtle part: the double pendulum is deterministic. Given exact initial conditions, its entire future is fixed. The trouble is that you can never measure those conditions exactly, and chaos relentlessly amplifies microscopic uncertainty into macroscopic unpredictability. Two trajectories starting δ₀ apart separate roughly like , and a positive Lyapunov exponent λ is the formal definition of chaos. At low energy — small swings — the motion is nearly linear and well-behaved. Push the arms past horizontal and the nonlinear terms take over. This same mechanism is why weather forecasts decay after about ten days: not faulty physics, but a chaotic atmosphere outrunning our knowledge of its present state.
The knobs
- Pendulums — how many copies to run (1–3). With more than one, they start almost identically and visibly diverge.
- Length — the arm length, which sets the natural timescale of the swing.
- Gravity — the gravitational pull; stronger gravity means faster, more energetic motion.
- Speed — the simulation rate, fast-forwarding the integration.
- Trail — how long the tip's path lingers. Longer trails reveal how the cluster of paths fans out over time.
- Color — the accent hue for the trails and bobs.