next up previous contents
Next: Temperature Up: Simple statistical quantities to Previous: Kinetic energy

Total energy

  The total energy E = K + V is a conserved quantity in Newtonian dynamics. However, it is common practice to compute it at each time step in order to check that it is indeed constant with time. In other words, during the run energy flows back and forth between kinetic and potential, causing K(t) and V(t) to fluctuate while their sum remains fixed.

In practice there could be small fluctuations in the total energy, in a typical amount of, say, one part in 104 or less. These fluctuations are usually caused by errors in the time integration (see 2.3), and can be reduced in magnitude by reducing the time step if considered excessive. Ref. [19] contains an in-depth analysis of total energy fluctuations using various time integration algorithms.

Slow drifts of the total energy are also sometimes observed in very long runs. Such drifts could also be originated by an excessive $\Delta t$.Drifts are more disturbing than fluctuations because the thermodynamic state of the system is also changing together with the energy, and therefore time averages over the run do not refer to a single state. If drifts over long runs tend to occur, they can be prevented, for instance by breaking the long run into smaller pieces and restoring the energy to the nominal value between one piece and the next. A common mechanism to adjust the energy is to modify the kinetic energy via rescaling of velocities.

A final word of caution: while one may be tempted to achieve ``perfect'' energy conservation by reducing the time step as much as desired, working with an excessively small time step may result in waste of computer time. A practical compromise would probably allow for small energy fluctuations and perhaps slow energy drifts, as a price to pay to work with a reasonably large $\Delta t$.See also refs. [3], §3.5, and [6], §4.4.4.


next up previous contents
Next: Temperature Up: Simple statistical quantities to Previous: Kinetic energy
Furio Ercolessi
9/10/1997