Since we are integrating Newton's equations,
is
just the force divided by the mass, and the force is in turn
a function of the positions
:
The simplest form, using the positions, is explained here. However, we will not use this form in CompMeth.
(see e.g. The Feynman Lectures on Physics, Vol. 1, Addison-Wesley, 1963, Chapter 9 ``Newton's Laws of Dynamics'')
An even better implementation of the same basic algorithm is the so-called
velocity Verlet scheme, where positions, velocities and
accelerations at time
are obtained from the same quantities
at time t in the following way:
![]()
![]()
![]()
![]()
Choosing the timestep dt is essential to success. It should be at least an order of magnitude less than the "typical" times of the system (as defined by phonon frequencies or ratio of velocity to acceleration). Too large, and errors will accrue in the integration. Too small, and errors will occur from rounding in the computation.
Here are simple codes which use velocity Verlet to integrate a falling particle and Verlet with xmgrace to illustrate a bouncing particle
Your code will require a loop over time, with the velocity and