We will now introduce a method that will allow us to sample the phase space. The method goes under the name of molecular dynamics (MD).
An isolated system of
interacting classical particles obeys the Newton's equations of motion:
Integrating
over time one obtains a trajectory
, represented by a collection of positions of all particles in the system as function of time. Since the forces are conservative, the total energy of the system (kinetic plus potential) is constant and the trajectory samples the microcanonical ensemble. If, after a sufficiently long time, the trajectory passes within any arbitrary distance from any state of the ensemble, then the system is said to be ergodic and time averages are equivalent to ensemble averages. Ergodicity is not always satisfied, and so care must be exercised when assessing the suitability of this method for sampling the phase space. In particular, a harmonic system is a clear example of a system that is not ergodic, as energy cannot be transferred between different normal modes. We shall come back to this point later.
We now discuss how to generate such a trajectory in a computer, which means that we have to discretise
. Let us consider a Taylor expansion of the position
:
and
where
is a small time interval. If we sum
and
the odd powers of
cancel out and we are left with:
which we rearrange as:
where we have replaced the acceleration
with the force divided by the mass,
.
The algorithm described in
is known as the Verlet algorightm. We see that we can obtain the positions at time
from knowledge of the positions at time
and
, and from the forces at time
. Eq.
can therefore be used to generate a trajectory in time, with an error that is proportional to
. For a simulation of length
divided in
time steps the total error is proportional to
and can therefore easily be reduced by reducing the time step (at an increased computer cost). This error will mostly show up in a non perfect conservation of the total energy and, for this reason, it is common practice to monitor the behaviour of the total energy to assess the quality of the simulations. A rule of thumb for choosing a reasonable value of the time step is to take it to be
of the the shortest period in the system. It should be pointed out, however, that if the sole purpose of the simulation is to sample phase space, a faithful conservation of the constant of motion is not necessarily a stringent requirement.
We can re-express Eq.
in terms of the velocities:
and obtain:
which gives access to the positions at time
with knowledge only of the positions, velocities and forces at time
. This expression is particularly useful at the beginning of the simulation, where only the initial positions are available, and shows that to begin a simulation we also need to provide the initial velocities.
Because of the equipartition theorem, the temperature of the system can be obtained form the ensemble average of the kinetic energy, given by Eq.
:
where
is the time average of the instantaneous kinetic energy
, given by:
Subsections