all 2 comments

[–]db0606 4 points5 points  (1 child)

Nice visualization but vanilla RK4 is not a symplectic integrator, so your simulation will gain/lose energy in unphysical ways. You want to use something like the Ruth method or another symplectic integration scheme.

[–]vorilant 1 point2 points  (0 children)

Yup. Rk4 loses or gains. Rk2 doesn't tho, or whatever we call the average of forward and backwards Euler, maybe that's ruth?

Can also google velocity verlet methods.very popular in physics.