lect12
lect12
Result Analysis
Overview
Now that we know how to set up, initialize and run an MD
program we have to ask a very serious, but as yet
neglected question: what do we actually want to do with
it?
1
2024/12/19
Pressure
Stress tensor
Self-diffusion coefficient
2
2024/12/19
Energy (cont.)
From all pairs of atoms (i, j), one calculates their
separations , and from these, simply substitute them
into potential equation. The trick is to calculate these pairs
via the neighbor list routine for computational efficiency.
This is most readily accomplished in the force routine
However, we have only got half the solution! The energy
has contributions due to both potential and kinetic terms.
The kinetic energy should be calculated after the
momentum have been updated, i.e., after the force
routine has been called. The kinetic energy can then be
calculated, and then added to the potential energy.
Fx 1 d mv x
Px
A A dt
3
2024/12/19
Pressure
Pressure is a momentum flux; it is the amount of
momentum that crosses a unit area of the surface in unit
time.
In general, this flux is composed of two parts. (a) the
momentum carried by the atoms themselves as they cross
the area during , and (b) the momentum transferred as
a result of forces acting between atoms that lie on
different sides of the surface.
4
2024/12/19
2
= =
2 2
= + + =
3 3
5
2024/12/19
6
2024/12/19
∑ , =
1
= + +
3
7
2024/12/19
Atomic Stress
The standard definition of the stress, given in most
texts on mechanics, is that it is the force per unit
area exerted upon a surface. But in which direction is
the force? The following diagram makes this more
clear.
8
2024/12/19
Atomic Stress
In above Figure, an infinitesimal surface, , in the
plane experiences an infinitesimal force across it, .
The stress experienced by thus has three components:
one directed normal to its surface (in this case, the
direction), and another two directed in the and
directions. However, there are another two surfaces to
consider, those in the and planes.
Thus, the stress contains 9 components! It is not a vector,
but is rather a 2nd rank tensor, and may be defined by
the expression:
lim d F n
dS 0 dS
where is the force vector on surface
Atomic Stress
The stress tensor may thus be written as:
9
2024/12/19
Atomic Stress
In an MD simulation the calculation of the stress tensor by
calculating the forces across surfaces is usually not the
most efficient method. For homogeneous systems, this is
definitely not the way to proceed! However, for
inhomogeneous systems, it is in fact the best way.
For homogeneous systems, one uses the so called virial
stress which calculate the configurationally part of the
stress tensor, and then add that to the kinetic part. As the
derivation of the virial stress is not trivial, we will not
consider it further. The full expression for the atomic stress
tensor of a homogeneous system of particles (ref. Irving
and Kirkwood) is given as:
1 1
= +
Ω 2
Atomic Stress
1 1
= +
Ω 2
10
2024/12/19
Atomic Stress
b=1
b=2
ra1
Fa2
Fa1
ra2
Ma
α
Atomic Stress
As with the calculation of the energy, the configurational
component should be calculated in the force loop,
whereas the kinetic component should be calculated
once the velocities are updated, and then the two
components added together.
11
2024/12/19
ai
r 1
ij
2 r2
ij
4 3
Vi ai
3
4 3
Vi ai
3
ai
r 1
ij
2r 2
ij
Time averaging
To date we have concentrated on (a) setting up our MD
program, and (b) calculating certain material properties of
interest to us. We now spend a little effort in discussing how
to obtain statistically meaningful results.
Many of the algorithms thus far described only showed how
to calculate certain physical properties, instantaneously, i.e.,
at time t. However, statistically meaningful results are only
obtained by time averaging over sufficiently long periods of
time.
12
2024/12/19
Time averaging
Over some arbitrary sampling interval, , the time average
( ) is computed as
1 1 N 1 N
B (t ) B (t )dt B (it )t B (it )
0 Nt i 1 N i 1
Estimating errors
There are a number of ways in which this may be done. First,
one may run the simulation M different times (each time
starting at a different configuration), then calculate the
mean and standard deviations, s, of all quantities you are
interested in over these M independent runs. The error in
the mean is then given by
Standard error =s/( )^0.5 (*)
1 M 2
( xi x )
M i1
An alternative (and equivalent) method would be to divide
your (long!) simulation into m blocks of t timesteps and take
averages over these blocks. One then calculates the mean of
the block averages, their standard deviation, and their
standard error by Eqn (*).
13
2024/12/19
Estimating errors
These are the two simplest and most straightforward ways
to estimate errors. There are more sophisticated techniques,
which you may find an excellent description of in Chapter 6
of reference [1].
Self-diffusion coefficient
Microscopic motion, such as how a molecule in a liquid
diffuses, or how an adsorbed atom on a surface migrates
from one site to another (or indeed through various
layers) is difficult to measure experimentally. However,
this motion is one of the most straightforward to
‘observe’ within an MD simulation.
14
2024/12/19
Self-diffusion coefficient
There are two routes to calculating diffusion coefficients:
via the mean squared displacement vector (originally
derived by Einstein in his paper on Brownian dynamics),
or by what is known as a ‘Green-Kubo’ relation, in which
the diffusion coefficient is related to the velocity
autocorrelation function. Both expressions are formally
equivalent. In this section we will only consider the
Einstein method; a Green-Kubo calculation will be
described in the following section on zero-shear viscosity.
The Einstein expression for the self-diffusion coefficient
for an isotropic fluid at equilibrium is given as
1 2
2tD r ( t ) r ( 0)
3
2 1 N M 2
r (t ) r (0) ri (tk t ) ri (tk )
NM i 1k 1
atom Time origin
15
2024/12/19
Self-diffusion coefficient
The angle brackets denote a time average performed
over all possible atoms (molecules) i. In actual fact,
the self-diffusion coefficient equation is only strictly
valid in the limit of long times, i.e.
1 2
D lim r (t ) r (0)
t 6t
N i
16
2024/12/19
<kT/>=0.80
17