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 to predict the positions at the time , where is the integration step. From a Taylor expansion of the 3-rd order, we obtain

 (8.3)

The error in the atomic positions is of the order of . The velocities are obtained from the basic definition of differentiation

 (8.4)

with an error of the order of . To obtain more accurate velocities, the leapfrog algorithm is used, using velocities at half time step

 (8.5)

The velocities at time t can be also computed from

 (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

 (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: The Predictor-Corrector algorithm Up: Equations of motion Previous: Equations of motion