This is the Verlet algorithm written in Python code. This example uses the algorithm for a mass on a spring.