Heun's method

First compute a step using Euler's method. Denote it with a capital letter to distinguish it from the result of Heun's method.

Xim+1 = xim + h vim
Vim+1 = vim + h aim

Heun's method proceeds by averaging the "slopes" used at the current time m and the predicted values from the Euler step.

xim+1 = xim + h/2 (vim + Vim+1)
vim+1 = vim + h/2 (aim + Aim+1)
The acceleration Aim+1 is calculated from the usual acceleration formula using the Euler-predicted positions Xim+1.

This method is like the trapezoidal rule but with a predicted Euler step in place of the unknown values.

References