For a computed state and an exact state , an energy error is for a specified energy function . If the exact dynamics conserve , the reference is simply . This is a scalar diagnostic; it does not by itself bound position or phase errors.
For the unit-frequency harmonic oscillator , , the exact energy is . The Forward Euler method givesThus a fixed positive step produces systematic energy growth even though the exact oscillator has constant energy. A bounded oscillatory energy error has a different long-time meaning from such cumulative drift. Comparing methods also requires the same step size, reference trajectory and observation interval.
New to topics? Read the docs here!