In a molecular dynamics simulation a convenient quantity that can be used to monitor the state of the system is the mean square displacement, defined as:
where
is some initial reference time. In a system with no diffusing behaviour, such as a solid,
is expected to rise first, and then reach a constant, which is related to the maximum displacement of the particles from their equilibrium positions. By contrast, in a fluid
is expected to rise with time. If the motion of the particles is random, which is a good approximation for a system in thermal equilibrium, then
increases linearly with time, and its slope is related to the diffusion coefficient. To understand where the linear behaviour of
comes from consider a random walk. This could be in any dimensions but for simplicity let us consider a one dimensional system. Let us associate a variable
to the
step in the walk, which can be either
or
, depending on if the step is taken by going to the right or to the left. Let us also define the variable
, which is the length of the walk after
steps. The average value of
is clearly zero, as:
but the average value of
is not:
because
and
since the
and the
steps are uncorrelated. This shows that in a random walk of step size 1 the mean square displacement from the origin of the walk is equal to the number of steps, and so it is linearly proportional to time, if the number of steps per unit time is constant. In systems with continuous displacements this translates into a linear dependence on time of the mean square displacement
defined above.
Over a simulation of total length
one clearly only has access to
with
, and to improve on statistics
it is useful to compute
by averaging over time origins
:
We see that for
it is possible to average of the whole length of the simulation, but as
increases the available length over which one can average is reduced to
, and so the statistical error on
increases with
. For
there is only one available configuration.