An edited republication of my original post, published in 2016.
This variation on a double pendulum replaces the rigid rods with springs. Two angles and two changing spring lengths give the system four degrees of freedom.

From mechanics to code
I used a Lagrangian formulation: express kinetic energy for both masses, add gravity and spring potential energy, then apply Euler–Lagrange equations to each coordinate. Mathematica helped solve the resulting coupled equations, and I wrote a small Python visualisation to test the model.


The experiment also made numerical stability visible. The equations alone do not guarantee a stable simulation: a simple time-stepping method can add error and apparent energy. Reducing the time step helped, while a better ODE solver such as Runge–Kutta is the natural next step.
The original post has the full derivation and the historical Python implementation.