Original Post
I've been testing out a few integration methods: Standard Euler, Symplectic Euler (or NSV), Velocity Verlet, and Fourth-Order Runge-Kutta. I tested them on the example of the Earth orbiting the Sun. I assumed a circular orbit. I found, as expected, that standard Euler did not fare very well. Its orbits spiralled out very quickly, especially for large timesteps. Enough said about it. Symplectic Euler and Velocity Verlet did very well. At a timestep resolution of 20 steps per year -- in other words a large timestep even on the planetary scale -- I noticed that these methods oscillated with regards to the distance of the Earth from the Sun: Symplectic Euler oscillated between about 0.8 AU and 1.2 AU, while Velocity Verlet oscillated between about 0.96 and 1.04 AU. But they both appeared to remain in stable orbits (slightly elliptical precessing orbits to be more exact). For small timesteps, these oscillations were much smaller, barely detectable. Runge-Kutta on the other hand was weird. It was supremely accurate for small timesteps. But for large timesteps it very slowly and then more rapidly spiralled in towards the Sun, and then of course got ejected from the Solar System! At a timestep resolution of 20 steps per year, the Earth got ejected after about 250 orbits. Probably even for small timesteps this would happen, but only after much more than 250 orbits, but I couldn't be bothered waiting that long. I would have thought that Runge-Kutta would be the most accurate and most stable of these methods. It initially is more accurate but after a while it spirals in towards the Sun. Maybe my initial thought was wrong, and Runge-Kutta is less stable than Symplectic Euler and Velocity Verlet, at least in the example of the periodic motion of planetary orbits. Does anyone know? Here's some screenshots of my experiments. These show all four methods on the one screen. The examples are all with a timestep resolution of 20 steps per year. The first one is the only one that shows Standard Euler Earth in the frame. The second one shows that Runge-Kutta Earth has indeed started to spiral in towards the Sun. The third one has captured Runge-Kutta Earth just before it will get too close to the Sun and get ejected out of the Solar System. Screenshot 1 Screenshot 2 Screenshot 3