I’ve included all three iterations (shown below) as I believe they’re important to display. I also compare the speeds of my three methods using a 5th-degree pendulum with similar angles, to highlight how each approach performed.
Each frame takes around six seconds using Sympy’s numeric solver.
This is the speed of Scipy’s optimizer, which is the equivalent of Sympy’s
The final method used a Jacobian matrix to derive new accelerations, resulting in an average 3000× improvement.
Result of Method 1 (15 minutes)
Result of Method 2 (16 seconds)
Result of Method 3 (0.4 seconds)