This is a genuine double pendulum — a second rigid link and mass (θ₂) hanging from the first (θ₁), not several independent single pendulums. It is integrated from the full nonlinear coupled equations of motion (no small-angle approximation, since chaos is destroyed by linearizing):
θ1'' = [ -g(2m1+m2)sinθ1 - m2·g·sin(θ1-2θ2)
-2sin(θ1-θ2)m2(θ2'²L2+θ1'²L1cos(θ1-θ2)) ]
/ [ L1(2m1+m2-m2cos(2θ1-2θ2)) ]
θ2'' = [ 2sin(θ1-θ2)(θ1'²L1(m1+m2)+g(m1+m2)cosθ1
+θ2'²L2·m2cos(θ1-θ2)) ]
/ [ L2(2m1+m2-m2cos(2θ1-2θ2)) ]
Both angles are advanced together with 4th-order Runge–Kutta (RK4), which conserves energy far better than Euler and is accurate enough to trust the chaotic divergence it produces. "Spawn twin" launches a second double pendulum from θ₁+0.001° and tracks the phase-space distance d(t) between the two — the defining signature of chaos is that d(t) grows exponentially, d(t) ≈ d(0)·e^(λt), even though both pendulums obey identical deterministic equations. λ is estimated live with Benettin's renormalization method: the twin's separation is periodically rescaled back to d(0) along its current direction so the exponent can be measured over long times without the twin flying off to a totally different swing.
- L₁ / L₂ — link lengths; changing either changes both the chaotic time-scale and the shape of the swing envelope.
- Mass ratio m₂/m₁ — a heavier lower ornament makes the upper link behave more like a driven single pendulum; a lighter one makes the coupling stronger.
- Start angle θ₁ and drag the ornaments — set the initial condition directly; small starting angles (<≈30°) stay nearly regular, large ones are reliably chaotic.
- Damping — a small angular-velocity drag term so the tree doesn't swing forever; set to 0 for an undamped conservative pendulum.