206 Molecular dynamics simulations
and now the force and the potential are continuous. These adjustments to the
potential can be compensated for by thermodynamic perturbation theory (see
Ref.[ 11 ]).
Electric and gravitational forces decay as 1/rand cannot be truncated beyond a
finite range without introducing important errors. These systems will be treated in
Section 8.7.
The time needed to reach equilibrium depends on how far the initial configuration
was from equilibrium, and on the relaxation time (see Section 7.4). To check whether
equilibrium has been reached, it is best to monitor several physical quantities such
as kinetic energy and pressure, and see whether they have levelled down. This can be
judged after completing the simulation by plotting out the values of these physical
quantities as a function of time. It is therefore convenient to save all these values
on disk during the simulation and analyse the results afterwards. It is also possible
to measure correlation times along the lines of Section 7.4, and let the system relax
for a period of, for example, twice the longest correlation time measured.
A complication is that we want to study the system at a predefined temperature
rather than at a predefined total energy because temperature is easily measurable
and controllable in experimental situations. Unfortunately, we can hardly forecast
the final temperature of the system from the initial configuration. To arrive at the
desired value of the temperature, we rescale the velocities of the particles a number
of times during the equilibration phase with a uniform scaling factorλaccording to
vi(t)→λvi(t) (8.14)
for all the particlesi=1,...,N. The scaling factorλis chosen such as to arrive at
the desired temperatureTDafter rescaling:
λ=
√
(N− 1 ) 3 kBTD
∑N
i= 1 mv
2
i
. (8.15)
Note the factorN−1 in the numerator of the square root: the kinetic energy is
composed of the kinetic energies associated with theindependentvelocities, but as
for interparticle interactions with PBC the total force vanishes, the total momentum
is conserved and hence the number of independent velocity components is reduced
by 3. This argument is rather heuristic and not entirely correct. We shall give a more
rigorous treatment of the temperature calculation in Section 10.7.
After a rescaling the temperature of the system will drift away but this drift will
become less and less important when the system approaches equilibrium. After a
number of rescalings, the temperature then fluctuates around an equilibrium value.
Now the ‘production phase’, during which data can be extracted from the simulation,
begins.