Interesting thing about the double pendulum - it is very difficult to get the numerical integration correct, even using very high order integrators like RK4. The simple Euler integrator used here has no hope of getting it right (not a criticism, just an observation!) The problem is that the double pendulum equations (in fact, any equations of motion derived from a Hamiltonian) have symplectic structure, i.e. they hav…
https://www.udacity.com/course/cs222
I wrote a simple N-body simulator game after viewing the course, although I'm still having issues with the energy conservation.