   Midpoint / RK2 Numerical Integration
  Hello everyone.So I'm trying to wrap my head around how the Midpoint/RK2 method works for numerical integration in a physics engine setting. I've sort of worked something out, but it doesn't feel very correct. Currently, I'm sitting with this:http://i46.tinypic.com/20si14z.pngWhere X is position, V is velocity, a is acceleration and dT is the timestep.Any input to help sort my thoughts out would be greatly appreciated. :)   
  Hi there,Don't bother implementing RK2, it's a horrible integrator. Adds energy to your system. It may be good for some specific types of scientific physics simulations, but it's really no good in a game engine context. Stick with symplectic Euler or velocity Verlet if you want my opinion. If you want to implement something more advanced, I recommend David Whysong's higher order symplectic integrators, they're really good.http://read.pudn.com/downloads72/sourcecode/math/261769/symplectic.cpp__.htmCheers,Mike   ;  Don't worry, I didn't plan to seriously implement the midpoint method in an actual engine, I just wanted to learn about the process. Your information has been helpful however, has it has shed further light upon different possibilities.Thanks! :)   ;  The main idea behind the midpoint method is that the derivative at the midpoint is a better estimate of the "true" derivative than the derivative at either endpoint.Of course you don't have the exact midpoint, so you estimate that too by taking a half-step. Then you compute the derivative at the midpoint and use this to take the full step.x_mid = x_n + dt/2 * f(x_n, t_n)t_mid = t_n + dt/2x_n+1 = x_n + dt * f(x_mid, t_mid)t_n+1 = t_n + dt