News for hackers. Stuff that matters.
Re:Newtonian Gravity with Velocity Verlet and OpenGL (2016) by jules on Thursday March 14, 2019 @06:54PM (#19394711)
With leapfrog you can use x + v dt/2 for the positions to calculate the energy. Or use this update rule:

    x += v*dt/2
    v += a(x)*dt
    x += v*dt/2
This gives you the x,v at the same time, yet still doesn't require storing the accelerations. The acceleration calculation can imperatively update v :)

In fact, if you call that update leapfrog(dt), then you can get a fourth order symplectic method like so:

    leapfrog(c1*dt)
    leapfrog(c2*dt)
    leapfrog(c1*dt)
Where c1,c2 are particular coefficients which you have to ask Yoshida.
Re:Newtonian Gravity with Velocity Verlet and OpenGL (2016) by aroman_ro on Thursday March 14, 2019 @07:42PM (#19395048)
As I said, tiny details :)