next up previous contents
Next: The Predictor-Corrector algorithm Up: Equations of motion Previous: Equations of motion

The leapfrog algorithm

The first method used is the leapfrog algorithm, which is a modified version of the Verlet algorithm. The Verlet algorithm uses the positions and accelerations at the time t and the positions at the time $t-\Delta t$ to predict the positions at the time $t +
\Delta t$, where $\Delta t$ is the integration step. From a Taylor expansion of the 3-rd order, we obtain


\begin{displaymath}{\bf r}_i(t + \Delta t) = 2 {\bf r}_i(t) - {\bf r}_i(t - \Delta t) +
\ddot{\bf r}_i(t) \Delta t^2.
\end{displaymath} (8.3)

The error in the atomic positions is of the order of $\Delta t^4$. The velocities are obtained from the basic definition of differentiation

\begin{displaymath}\dot{\bf r}_i(t) = \frac{{\bf r}_i(t + \Delta t)-{\bf r}_i(t - \Delta t)}
{2 \Delta t},
\end{displaymath} (8.4)

with an error of the order of $\Delta t^2$. To obtain more accurate velocities, the leapfrog algorithm is used, using velocities at half time step

\begin{displaymath}\dot{\bf r}_i(t + \frac{\Delta t}{2})
= \dot{\bf r}_i(t - \frac{\Delta t}{2}) + \ddot{\bf r}_i(t) \Delta t.
\end{displaymath} (8.5)

The velocities at time t can be also computed from

\begin{displaymath}\dot{\bf r}_i(t) = \frac{\dot{\bf r}_i(t + \frac{\Delta t}{2})
+\dot{\bf r}_i(t - \frac{\Delta t}{2})}{2}.
\end{displaymath} (8.6)

This is useful when the kinetic energy is needed at time t, as for example in the case where velocity rescaling must be carried out (see below). The atomic positions are then obtained from

\begin{displaymath}{\bf r}_i(t + \Delta t) = {\bf r}_i(t) + \dot{\bf r}_i(t +
\frac{\Delta t}{2}) \Delta t.
\end{displaymath} (8.7)

The leapfrog algorithm is computationally less expensive than the Predictor-Corrector approach for example, and requires less storage. This could be an important advantage in the case of large scale calculations. Moreover, the conservation of energy is respected, even at large time steps. Therefore, the computation time could be greatly decreased when this algorithm is used. However, when more accurate velocities and positions are needed, another algorithm should be implemented, like the Predictor-Corrector algorithm. We will show in the following the effects of this algorithm on the results of the calculations.


next up previous contents
Next: The Predictor-Corrector algorithm Up: Equations of motion Previous: Equations of motion
David Saada
2000-06-22