Beeman's algorithm

From HandWiki
Short description: Numerical integration algorithm

Beeman's algorithm is a method for numerically integrating ordinary differential equations of order 2, more specifically Newton's equations of motion [math]\displaystyle{ \ddot x=A(x) }[/math]. It was designed to allow high numbers of particles in simulations of molecular dynamics. There is a direct or explicit and an implicit variant of the method. The direct variant was published by Schofield in 1973[1] as a personal communication from Beeman. This is what is commonly known as Beeman's method. It is a variant of the Verlet integration method. It produces identical positions, but uses a different formula for the velocities. Beeman in 1976 published[2] a class of implicit (predictor–corrector) multi-step methods, where Beeman's method is the direct variant of the third-order method in this class.

Equation

The formula used to compute the positions at time [math]\displaystyle{ t + \Delta t }[/math] in the full predictor-corrector[2] scheme is:

  • Predict [math]\displaystyle{ x(t+\Delta t) }[/math] from data at times [math]\displaystyle{ t\text{ and }t - \Delta t }[/math]
[math]\displaystyle{ x(t+\Delta t) = x(t) + v(t) \Delta t + \frac{1}{6}\Bigl( 4 a(t) - a(t - \Delta t)\Bigr)\Delta t^2 + O( \Delta t^4) }[/math].
  • Correct position and velocities at time [math]\displaystyle{ t + \Delta t }[/math] from data at times [math]\displaystyle{ t\text{ and }t+\Delta t }[/math] by repeated evaluation of the differential equation to get the acceleration [math]\displaystyle{ a(t+\Delta t) }[/math] and of the equations of the implicit system
[math]\displaystyle{ \begin{align} x(t+\Delta t) &= x(t) + v(t) \Delta t + \frac{1}{6}\Bigl(a(t+\Delta t) + 2a(t)\Bigr)\Delta t^2 + O(\Delta t^4);\\ v(t+\Delta t)\Delta t &=x(t+\Delta t)-x(t) + \frac16 \Bigl(2a(t+\Delta t) + a(t)\Bigr)\Delta t^2 + O(\Delta t^4); \end{align} }[/math]
In tests it was found that this corrector step needs to be repeated at most twice. The values on the right are the old values of the last iterations, resulting in the new values on the left.

Using only the predictor formula and the corrector for the velocities one obtains a direct or explicit method[1] which is a variant of the Verlet integration method:[3]

[math]\displaystyle{ \begin{align} x(t+\Delta t) &= x(t) + v(t) \Delta t + \frac{1}{6}\Bigl( 4 a(t) - a(t - \Delta t)\Bigr)\Delta t^2 + O( \Delta t^4) \\ v(t+\Delta t) &=v(t) + \frac16 \Bigl(2a(t+\Delta t) + 5a(t)-a(t-\Delta t)\Bigr)\Delta t + O(\Delta t^3); \end{align} }[/math]

This is the variant that is usually understood as Beeman's method.

Beeman[2] also proposed to alternatively replace the velocity update in the last equation by the second order Adams–Moulton method:

[math]\displaystyle{ v(t + \Delta t) = v(t) + \frac{1}{12}\Bigl(5a(t + \Delta t) + 8a(t) - a(t - \Delta t)\Bigr)\Delta t + O(\Delta t^3) }[/math]

where

  • [math]\displaystyle{ t }[/math] is present time (i.e.: independent variable)
  • [math]\displaystyle{ \Delta t }[/math] is the time step size
  • [math]\displaystyle{ x(t) }[/math] is the position at time t
  • [math]\displaystyle{ v(t) }[/math] is the velocity at time t
  • [math]\displaystyle{ a(t) }[/math] is the acceleration at time t, computed as a function of [math]\displaystyle{ x(t) }[/math]
  • the last term is the error term, using the big O notation

Predictor–corrector modifications

In systems where the forces are a function of velocity in addition to position, the above equations need to be modified into a predictor–corrector form whereby the velocities at time [math]\displaystyle{ t + \Delta t }[/math] are predicted and the forces calculated, before producing a corrected form of the velocities.

An example is:

[math]\displaystyle{ x(t+\Delta t) = x(t) + v(t) \Delta t + \frac{2}{3}a(t) \Delta t^2 - \frac{1}{6} a(t - \Delta t) \Delta t^2 + O( \Delta t^4). }[/math]

The velocities at time [math]\displaystyle{ t = t + \Delta t }[/math] are then calculated (predicted) from the positions.

[math]\displaystyle{ v(t + \Delta t)~\text{(predicted)} = v(t) + \frac{3}{2}a(t) \Delta t - \frac{1}{2}a(t - \Delta t) \Delta t + O(\Delta t^3). }[/math]

The accelerations [math]\displaystyle{ a(t + \Delta t) }[/math] at time [math]\displaystyle{ t = t + \Delta t }[/math] are then calculated from the positions and predicted velocities, and the velocities are corrected.

[math]\displaystyle{ v(t + \Delta t)~\text{(corrected)} = v(t) + \frac{5}{12}a(t + \Delta t) \Delta t + \frac{2}{3}a(t) \Delta t - \frac{1}{12}a(t - \Delta t) \Delta t + O(\Delta t^3). }[/math]

Error term

As shown above, the local error term is [math]\displaystyle{ O(\Delta t^4) }[/math] for position and [math]\displaystyle{ O(\Delta t^3) }[/math] velocity, resulting in a global error of [math]\displaystyle{ O(\Delta t^3) }[/math]. In comparison, Verlet is [math]\displaystyle{ O(\Delta t^2) }[/math] for position and velocity. In exchange for greater accuracy, Beeman's algorithm is moderately computationally more expensive.

Memory requirements

The simulation must keep track of position, velocity, acceleration and previous acceleration vectors per particle (though some clever workarounds for storing the previous acceleration vector are possible), keeping its memory requirements on par with velocity Verlet and slightly more expensive than the original Verlet method.

References

  1. 1.0 1.1 Schofield, P. (1973), "Computer simulation studies of the liquid state", Computer Physics Communications 5 (1): 17–23, doi:10.1016/0010-4655(73)90004-0, Bibcode1973CoPhC...5...17S 
  2. 2.0 2.1 2.2 Beeman, David (1976), "Some multistep methods for use in molecular dynamics calculations", Journal of Computational Physics 20 (2): 130–139, doi:10.1016/0021-9991(76)90059-0, Bibcode1976JCoPh..20..130B 
  3. Levitt, Michael; Meirovitch, Hagai; Huber, R. (1983), "Integrating the equations of motion", Journal of Molecular Biology 168 (3): 617–620, doi:10.1016/S0022-2836(83)80305-2, PMID 6193281 
  • Sadus, Richard J. (2002), Molecular Theory of Fluids: Theory, Algorithms and Object-Orientation, Elsevier, p. 231, ISBN 0-444-51082-6