Skip to main content

Double pendulum: divergence from nearby initial states

Open the double pendulum. Two pendulums overlap, drawn with solid and dashed rods. Their initial upper angles differ by only 0.0010.001 radians. Let them run, then pause to compare their endpoint trails: nearby starting states can produce visibly different paths.

Controls

Changing the initial-angle slider restarts the experiment. Drag a bob to change the configuration; this clears angular velocities and trails and creates two new states separated by 0.0010.001 radians. Pause and use Step to inspect successive updates.

With the canvas focused, move the square cursor with the arrow keys and press Enter or Space to set an angle at that position. Reset restores the default upper angle of 125125^\circ; the lower angle starts 0.30.3 radians beyond it.

Model and integration

The equations follow the myPhysicsLab double-pendulum derivation. This implementation uses equal point masses, rigid massless rods of unit length, and gravity 9.819.81. The state contains two angles measured from downward vertical and their angular velocities.

The pure model module advances the state with fourth-order Runge–Kutta (RK4), using an internal step of 1/2401/240. Each simulation update performs four substeps, advancing 1/601/60 model time units. Both states use the same algorithm; their difference comes from the initial conditions, not random noise.

Reading the trails

Canvas 2D draws the rods, bobs and latest 700 endpoint positions. Old trail points disappear because history is bounded. Changing the initial state clears that history so separate experiments do not share a trail.

Energy should remain constant in this undamped model. An energy function lets the tests check integration drift, but numerical error remains, so long trajectories are not exact predictions. Nearby states need not separate immediately: the initial configuration and elapsed time matter. Compare this with the Rössler attractor, another continuous dynamical system.

Explore connectionsOpen network