The model being studied is the undamped spring-mass oscillator.
Currently, four algorithms are implemented.
- Naive Euler, also known as Euler's method
- Symplectic Euler
- Verlet Integration
- Velocity Verlet Integration
Energy drift of the system after 100 seconds with a step size of 0.01
- Naive Euler: 172% error
- Symplectic Euler: 0.44% error
- Verlet Integration: -25% error
- Velocity Verlet Integration: -0.00064% error
Velocity Verlet integration is the best algorithm in this case, with minimal error several orders of magnitude better than others.
Verlet algorithms also prevent energy growth over time, as they always have a negative error.
However, this means that systems using Verlet integration algorithms will suffer from energy damping over time.
Runtime of 100 seconds and step size of 0.01 seconds

Runtime of 7 seconds and step size of 0.1 seconds (to emphasize differences in algorithm performance)
