The Verlet methods to integrate ODEs guaranty energy conservation. Using such methods addresses most of the issues described in the problem of a mass in a gravitational field described in a previous section
The code uses a slightly smaller as compared to the in the RK4 solution. This is because the Velocity Verlet method is a much lower order ODE solver. Notice however that the code is much batter at maintaining closed orbits even for high excentricity orbits.
A hallmark of the Velocity Verlet method is the conservation of energy.
This code is also time-reversal invariant.