Angles are measured from the downward vertical. The upper bob is green, the lower one amber, and the trail belongs to the lower mass. Drag either bob. The reach is large enough for a thumb. While you hold it, the angular velocities are zero, so what happens next is a release from rest.
The accelerations come from the Euler-Lagrange equations of the double pendulum. With δ = θ₁ − θ₂ they are a 2 by 2 linear system,
$$ (m_1+m_2)\, l_1\, \theta_1'' + m_2 l_2 \cos\delta\, \theta_2'' = -(m_1+m_2)\, g \sin\theta_1 - m_2 l_2 \omega_2^2 \sin\delta $$
$$ l_1 \cos\delta\, \theta_1'' + l_2\, \theta_2'' = -g \sin\theta_2 + l_1 \omega_1^2 \sin\delta $$
solved at every evaluation, then stepped with the classical fourth-order Runge-Kutta method at a fixed dt and several substeps per frame. The energy on the readout is the Hamiltonian of that same Lagrangian. With damping at zero it should sit still, apart from a slow drift that tells you the step size. Damping is an extra friction term, off by default, and it is allowed to spend that energy.
Small angles have two normal modes, at (2 − √2) g/l and (2 + √2) g/l for equal masses and equal lengths. The release this page starts from is not small, and the lower mass will not repeat its path. Reset puts it back on the same release.
Field note: Two rods, one chaos. Draft for Ali to write. It is not published yet.