next up previous
Next: About this document ...

Verlet ODE Integrators

The Leapfrog integrator belongs to a class of integrators commonly known as the Verlet ODE integration schemes. They are popular integrators that are widely used in Molecular Dynamics simulations. These are N-body simulations to model various systems from solids and gases to proteins. Electrons, atoms or molecules might constitute the building blocks in these models. Often, quantum effects are neglected for simplicity. Newton equations of motion, derived from his laws, are then solved for the motion of the N bodies under the influence of pair-wise (or more complicated) interactions.

The motion of the individual atoms or molecules is likely to be chaotic. This demands accurate and stable ODE integration schemes. The calculations can also be very time consuming. This is so since the number of ODEs to solve ( $ x, y, z, v_x, v_y, v_z$ for each particle, or $ 6 N$ in total) can be very large. Furthermore the number of interaction terms to calculate also increases very rapidly with $ N$ ( $ N(N-1)/2$ for pair-wise interactions). This demands an ODE integrator that minimizes the number of evaluations of the ODE RHS.

The Verlet integration schemes are ODE integrators which satisfy these requirements. They are time reversible, which insures conservation of energy, and are found to be very stable.

There are three common formulations of the Verlet integration schemes: the Basic Verlet Algorithm, the Verlet Leapfrog Algorithm and the Velocity Verlet Algorithm.

The Basic Verlet Algorithm takes the form

\begin{eqnarray}
x_{n+1} = 2 x_n - x_{n-1} + \frac{ f_n}{m} \Delta t^2 +
O(\D...
...c{1}{2 \Delta t} [ x_{n+1} - x_{n-1} ] + O(\Delta t^2 ) \nonumber
\end{eqnarray}


where $ n$ denotes a time slice on a time grid with spacing $ \Delta t$ . This scheme is simple and robust. But it suffers from needing to compute the velocity as a separate step with a less accurate expression since only the position is predicted by the integrator. It also requires the position at the previous time slice, $ t-\Delta t$ , which requires the use of another integration scheme to start the integration.

The Verlet Leapfrog Algorithm is written as

\begin{eqnarray}
v_{n+1/2} = v_{n-1/2} + \frac{f_n}{m} \Delta t +
O(\Delta t^...
...\frac{1}{2} [ v_{n+1/2} + v_{n-1/2} ] + O(\Delta t^2). \nonumber
\end{eqnarray}


This last equation for $ v_n$ could be replaced by a Euler Step or a more accurate integration half step. This algorithm was described in details in a previous section.

The most popular scheme is the Velocity Verlet Algorithm.

\begin{eqnarray}
x_{n+1} = x_n + v_n \Delta t + \frac{f_n}{2 m} \Delta t^2 +
O...
...rac{\Delta t}{2m} [ f_{n+1} + f_n ] +
O(\Delta t^3). \nonumber
\end{eqnarray}


This algorithm only requires $ x_n$ and $ v_n$ to get started. Positions and velocities are generated on a single time grid. These equations can be written as

\begin{eqnarray}
v_{n+1/2} = v_n + \frac{f_n}{2 m} \Delta t \nonumber \\
x_{n...
...\\
v_{n+1} = v_{n+1/2} + \frac{\Delta t}{2m} f_{n+1} \nonumber
\end{eqnarray}


The following are time step functions implementing the Velocity Verlet ODE integrator for 1D problems. They are interchangeable with the previous functions (i.e., euler_step.c, mid_step.c, RK4_step.c, ...).

velocity_verlet.c
velocity_verlet_pointer.c

In 2 dimensions, this scheme becomes (careful with the variable map):

velocity_verlet_pointer_2.c

The Velocity Verlet method applies to mechanics problems and so are these functions. Furthermore, these functions assume a one body problem in 1-Dimension or 2-Dimension. Writing it more generally would be easy once we agree on the proper way to store the position and velocity components of the particles in the unknown function and ODE RHS arrays.

Many references can be found that describe or derive the Verlet Algorithms, specially in the context of Molecular Dynamics.

Verlet algorithms description
Verlet algorithms derivation from Taylor Series
Introduction to MD




next up previous
Next: About this document ...
Michel Vallieres 2008-02-28