Beeman's algorithm

From testwiki
Jump to navigation Jump to search

Template:Short description Beeman's algorithm is a method for numerically integrating ordinary differential equations of order 2, more specifically Newton's equations of motion x¨=A(x). 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 t+Δt in the full predictor-corrector[2] scheme is:

  • Predict x(t+Δt) from data at times t and tΔt
x(t+Δt)=x(t)+v(t)Δt+16(4a(t)a(tΔt))Δt2+O(Δt4).
  • Correct position and velocities at time t+Δt from data at times t and t+Δt by repeated evaluation of the differential equation to get the acceleration a(t+Δt) and of the equations of the implicit system
x(t+Δt)=x(t)+v(t)Δt+16(a(t+Δt)+2a(t))Δt2+O(Δt4);v(t+Δt)Δt=x(t+Δt)x(t)+16(2a(t+Δt)+a(t))Δt2+O(Δt4);
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]

x(t+Δt)=x(t)+v(t)Δt+16(4a(t)a(tΔt))Δt2+O(Δt4)v(t+Δt)=v(t)+16(2a(t+Δt)+5a(t)a(tΔt))Δt+O(Δt3);

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:

v(t+Δt)=v(t)+112(5a(t+Δt)+8a(t)a(tΔt))Δt+O(Δt3)

where

  • t is present time (i.e.: independent variable)
  • Δt is the time step size
  • x(t) is the position at time t
  • v(t) is the velocity at time t
  • a(t) is the acceleration at time t, computed as a function of x(t)
  • 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 t+Δt are predicted and the forces calculated, before producing a corrected form of the velocities.

An example is:

x(t+Δt)=x(t)+v(t)Δt+23a(t)Δt216a(tΔt)Δt2+O(Δt4).

The velocities at time t=t+Δt are then calculated (predicted) from the positions.

v(t+Δt)(predicted)=v(t)+32a(t)Δt12a(tΔt)Δt+O(Δt3).

The accelerations a(t+Δt) at time t=t+Δt are then calculated from the positions and predicted velocities, and the velocities are corrected.

v(t+Δt)(corrected)=v(t)+512a(t+Δt)Δt+23a(t)Δt112a(tΔt)Δt+O(Δt3).

Error term

As shown above, the local error term is O(Δt4) for position and O(Δt3) velocity, resulting in a global error of O(Δt3). In comparison, Verlet is O(Δt2) 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

Template:Numerical integrators