We now consider three different versions of time stepping for Newtonian mechanics in its basic form of the harmonic oscillator:
Dumb Euler (position first updated) with :
Smart Euler (velocity first updated):
as averages represent midpoint values between time and . Midpoint Euler is an implicit method with the new value at appearing also on the right hand side. This requires iteration with repetition of the update with successively new values introduced on the right.
Watch this code to see that Midpoint Euler is most accurate followed by Smart Euler, which lives up to its name as the right way to do explicit updating of first velocity and then position, while Dumb Euler is much less accurate.
Test with different number of iterations in Midpoint Euler (m<4 as default).