Double pendulum with an end-to-end spring (source code)

= Double pendulum with an end-to-end spring

With equal rod lengths $\ell$ and absolute downward-vertical <angles> $\theta,\phi$, the endpoint separation is $s^2=2\ell^2[1+\cos(\theta-\phi)]$. A <zero-rest-length spring> between the fixed support and the final <mass> contributes $-\kappa\ell^2[1+\cos(\theta-\phi)]$ to the <Lagrangian>. It favours bending away from maximum extension and can reduce the gravitational bending stiffness.