Integrator
For numerical integration techniques, the book Numerical Recipes in C is good reference.
As we already know MD simulations is solving Newton's law
using finite difference methods. The exact way to solve the ordinary differential equation depends on the integrator. A good integrator should allow
- large time step (However, if the timestep is too large for system, the simulation can "blow up")
- conserve energy (small energy)
- efficeint. Evalute fewer energy and force per step.
Popular integrators for MD
- Verlet leapfrog integrator
- Verlet velocity integrator
The Verlet velocity algorithm overcomes the out-of-synchrony
shortcoming of the Verlet leapfrog method
Runge–Kutta-4 is a fourth-order Runge–Kutta method,
which is one of the oldest numerical methods for solving ordinary
differential equations. The method is self starting but requires four
energy evaluations per step.
Beeman is closely related to Verlet integration. It produces identical positions to Verlet, but is more accurate in velocities.
The formula used to compute the positions at time
is:

and this is the formula used to update the velocities:

where
is present time (ie: independent variable)
is the time step size
is the position at time t
is the velocity at time t
is the acceleration at time t
- the last term is the error term, using the big O notation
which one is better?
- Beeman is my favorite for MD.
- try different time-steps and see whether the average energy change.
- for rigibd body there are different integrators
- for motorsport simulations: http://www.motorsport-sim.org/
Constraint
(http://en.wikipedia.org/wiki/Constraint_algorithm)
To use even large time step, constraint is used to "fix" the fast vibrating bonds. In most Molecular dynamics simulation, constraints are enforced using the method of Lagrange multipliers. Given a set of n linear (holonomic) constraints at the time t,
where x ar ethe positions of the two atoms involved in the kth constraint (e.g. O and H in OH constraint) at the time t and "d" is the prescribed inter-particle distance.
These constraint equations, are added to the potential energy function in the equations of motion, resulting in, for each of the N particles in the system
Adding the constraint equations to the potential does not change it, since all
should, ideally, be zero.
Integrating both sides of the equations of motion twice in time yields the constrained particle positions at the time t + Δt
where
is the unconstrained (or uncorrected) position of the ith particle after integrating the unconstrained equations of motion.
To satisfy the constraints
in the next timestep, the Lagrange multipliers must be chosen such that
This implies solving a system of n non-linear equations
simultaneously for the n unknown Lagrange multipliers λk.
This system of n non-linear equations in n unknowns is best solved using Newton's method (oterwise matrix inversion)where the solution vector
is updated iteratively using
where
is the Jacobian of the equations σk:
Since not all particles are involved in all constraints,
is blockwise-diagonal and can be solved blockwise, i.e. molecule for molecule.
.
This is repeated until the constraint equations
are satisfied up to a prescribed tolerance \
or it will blow up after a number of itrations and two atoms are now far away from each other...
Although there are a number of algorithms, SHAKE and RATTLE etc., to compute the Lagrange multipliers, they differ only in how they solve the system of equations, usually using Quasi-Newton methods.