Let MPGrav(i) return the acceleration of i'th particle which is specified by position X(i) and velocity V(i) |
The kernel of algorithm increments X(i),V(i) from t to t+h using Runge-Kutta method. |
This involves 4 function calls to MPGrav(i) for the four different choices of position and time needed in the Runge-Kutta method. |
Let Xuse(i) be position vector used in each function call. Then we have |
(time,Xuse) = (t,X) (t+h/2, X + (h/2)Dxa) (t+h/2, X + (h/2)Dxb) (t+h, X + hDxc) |
where Dxa Dxb Dxc are shift vectors calculated by previous phase of Runge-Kutta method |