Simulation

Double Pendulum

OscillationsSimple and physical pendulums

Two connected pendulums exhibiting chaotic motion under gravity — tiny differences in starting angles produce wildly different paths.

Objective

Investigate deterministic chaos in a double pendulum by observing how two coupled nonlinear arms evolve from rest. Verify that total mechanical energy is conserved by the RK4 integrator over the 30-second run, and confirm that arbitrarily small changes to the initial angles produce trajectories that diverge exponentially in time. The system has no closed-form solution, so the goal is qualitative characterisation rather than exact prediction.

Setup

  1. Confirm the Arm 1 Length slider reads 1.0 m and the Arm 2 Length slider reads 1.0 m, so both rods are equal and the system has its default geometry.
  2. Set the Initial Angle 1 slider to 120° and the Initial Angle 2 slider to 60°. These are the default release angles measured from the downward vertical.
  3. Note the Energy readout before pressing Start. With θ₁ = 120°, θ₂ = 60°, m₁ = m₂ = 1 kg, and g ≈ 9.81 m/s², the resting energy is approximately 4.91 J.
  4. Press Start and observe the Time readout advance from 0.00 s. The lower bob immediately begins tracing a chaotic trail across the canvas.
  5. Let the run continue until Time reaches 30.00 s, the hard stop enforced by MAX_TIME. Record the Energy readout at the end and compare with the value from step 3.
  6. Press Reset, change Initial Angle 1 from 120° to 121°, leave every other control unchanged, and press Start again to compare against the first run.

Analytical Prediction

The double pendulum has no closed-form trajectory. The Euler−Lagrange procedure produces two coupled, nonlinear, second-order differential equations in θ₁ and θ₂ that admit no analytical solution; the simulator integrates them numerically with RK4 at a 1/240-second substep. What the system does admit is a positive Lyapunov exponent λ, so two trajectories whose initial angles differ by δ(0) separate roughly as |δ(t)| ≈ |δ(0)|·exp(λ·t). For a double pendulum at moderate amplitude such as θ₁ = 120° and θ₂ = 60°, λ falls in the range of about 1 to 3 inverse seconds, so an initial offset of 1° will grow to order 10° within roughly 1 to 3 seconds and saturate at the system size shortly after. The simulator demonstrates this directly: the first run with θ₁ = 120° and the second run with θ₁ = 121° produce visually identical motion for a brief interval, then diverge so completely that the two trails share no recognisable feature by the end. The one quantity that should remain predictable is total mechanical energy, which Lagrangian dynamics conserves exactly:

E_total=KE + PE
=constant
4.91 J

The Energy readout should hold near 4.91 J throughout the run.

Results Analysis

After the 30-second run completes, examine the Time and Energy readouts together. The Time readout will display 30.00 s, and the Energy readout should still read close to its initial value of 4.91 J. Any small drift, perhaps a few hundredths of a joule, comes from finite-step numerical integration rather than from real physics, since Lagrangian mechanics conserves total mechanical energy exactly in the absence of dissipation. Now compare the two runs at θ₁ = 120° and θ₁ = 121°. The second bob's trail differs everywhere on the canvas; no segment of one run overlays the other. This is the qualitative signature of a positive Lyapunov exponent. The simulator demonstrates that determinism, in the sense of identical equations of motion, does not imply predictability when initial conditions are known only to finite precision. The two runs were generated by exactly the same equations integrated by exactly the same algorithm, yet a 1° change in one input produced two unrelated paths. The energy values, by contrast, agree to within numerical noise across both runs.

Source of Error

What this sim does NOT model: arm mass distribution (the bobs are points, the arms are massless rigid rods), pivot friction, air resistance, finite arm stiffness, or any internal damping. The Lagrangian formulation is exact for these idealizations. **Special case for chaos:** because tiny initial-state perturbations diverge exponentially, even the small numerical drift in the integrator amplifies into visibly different long-time trajectories — predicted state at any specific late time is not meaningful, only the qualitative chaotic character is. The remaining gap between any short-time predicted quantity and the readouts is therefore purely numerical, not physical.

Further Exploration