Euler
modularize
Improved Euler
Runge-Kutta 4th order
animation
Newton's cannon
adaptive step control
(2) Here is my adaptive step-size selection idea. We want to avoid the velocity changing a lot from one step to the next. This is particularly important when the planet has a close encounter with a sun - the direction of the force of gravity changes very rapidly with position, hence doubly so with time since the planet moves fast when it's close to a sun. The acceleration, which is f(X,t)[2:] happens to hand us exactly how fast the velocity vector is changing. So we can put a cap on the magnitude of the change in velocity over a single step by setting h = c/|| a || for every step ( i.e. c/numpy.linalg.norm( f(X,t)[2:] ) ) where c is some suitably chosen constant. I have found that this works really well, taking lots of steps when passing close to a star and striding out when far away.