An analysis of the accuracy of Langevin and molecular dynamics algorithms

Abstract
Analytic expressions for mean squared positions and velocities of a harmonic oscillator are derived for Langevin dynamics algorithms valid in the high and low friction limits, and for the Verlet algorithm. For typical values of the parameters, errors in the positions are small. However, if the velocity is defined by the usual Verlet form, kinetic energies (and therefore calculated temperatures) can be in error by several per cent for the Langevin algorithms. If the Bunger-Brooks-Karplus algorithm is used to calculate positions, a simple redefinition of the velocity results greatly in improved kinetic energies. In addition, due to cancellation of errors in the velocities and the positions, the correct virial is obtained. The effect of including the force derivative in diffusive algorithms is examined. Positional and velocity averages are calculated for the Verlet algorithm for arbitrary initial conditions, and errors in the total energy and virial are analysed. Connection is made with the Langevin algorithms, and it is shown for harmonic oscillators that different definitions of the velocity are required to optimally calculate the temperature, pressure, and total energy, respectively.