Está en la página 1de 80

Natural Sciences Tripos Part II

MATERIALS SCIENCE
C1: Introduction to Materials Modelling
Dr J. A. Elliott
II
Name .................................... College .........................
Michaelmas Term 2013-14
Course C1 Lecture 1

1
Dr James Elliott
Introduction to Materials Modelling
An introduction to the use
of computer models in
materials science
Part II Materials Science Course C1
Copyright 2001 University of Cambridge. Not to be quoted or copied without permission.
0.1 Course overview
The scope and objectives of materials modelling. The
hierarchy of models based on length scale. Steps in
developing a physical model.
Predictive modelling and fitting to experimental data.
Regression analysis and pitfalls of overfitting
Statistical sampling methods and Buffons needle.
Introduction to Monte Carlo method
Introduction to Molecular Dynamics method
Two cases studies: molecular dynamics of fast ion
conduction in fluorite, and microstructural modelling of
grain growth
Computing class: the use of molecular dynamics to study
fast ion conduction in fluorite crystal structures
Course C1 Lecture 1

2
Copyright 2001 University of Cambridge. Not to be quoted or copied without permission.
0.2 Reminder about online teaching resources
You can find copies of the overheads and handouts
for these lectures at:

http://www.msm.cam.ac.uk/teaching/partII/courseC1.php

Also available will be information about the
computing (examples) class on 14/11/13, which will
be held in the Computing Suite
Copyright 2001 University of Cambridge. Not to be quoted or copied without permission.
0.3 Recommended reading
The following is the main course textbook:

Introduction to Materials Modelling Z H Barber
(editor) (Maney Publishing 2005) MSM: Zc34

It is available freely for electronic download at :
www.msm.cam.ac.uk/teaching/camonly/modellingdownload.php
(Raven password required)

It will also be used in Part III Atomistic Modelling(M16)

Course C1 Lecture 1

3
Copyright 2001 University of Cambridge. Not to be quoted or copied without permission.
0.4 Supplementary sources
The following books will be referred to in lectures on
Monte Carlo and molecular dynamics:

Molecular Modelling: principles and applications
A.R. Leach (Prentice-Hall 2001) MSM: Zc18, Zc18a

Understanding Molecular Simulation: from
algorithms to applications D. Frenkel and B. Smit
(Academic Press 2002) MSM: La43, Zc13
Copyright 2001 University of Cambridge. Not to be quoted or copied without permission.
0.5 Supplementary sources
There will also be a number of JAVA applets used
during lectures, and some may be required for doing
exercises on question sheets
Course C1 Lecture 1

4
Copyright 2001 University of Cambridge. Not to be quoted or copied without permission.
1.1 Objectives of materials modelling
To gain insight into the physical origin of materials
behaviour (electrical, mechanical, optical etc)
To guide in the design of a material with specific
properties (e.g. high toughness, better conductivity
etc)
To guide in the optimisation of materials process (eg
casting, welding, hot rolling etc)
To predict a materials response under extreme
conditions (e.g. high T or P; very small scales; ultra-
clean conditions)
To allow extrapolation in time, space and rate
Copyright 2001 University of Cambridge. Not to be quoted or copied without permission.
1.2 Brief history of materials modelling
Coincided with the development of computers in
1950s

Three branches:

> particle dynamics & statistics (physics & chemistry)
> solution of differential equations (engineering)
> data fitting and regression analysis (biology)

Lead to the well known methods of

> molecular dynamics and Monte Carlo [Barber p. 97]
> finite elements and differences [Barber p.139]
> artificial neural networks [Barber p.153]

Course C1 Lecture 1

5
Copyright 2001 University of Cambridge. Not to be quoted or copied without permission.
1.3 Hierarchy of materials modelling


Copyright 2001 University of Cambridge. Not to be quoted or copied without permission.
1.4 Example of bridging the length scales
Atomistic and continuum models are coupled to treat
crack propagation. Main computational difficulty is
ensuring continuity across the boundary region.

M F Ashby Mat Sci Tech 8, 102 (1992)
Course C1 Lecture 1

6
Copyright 2001 University of Cambridge. Not to be quoted or copied without permission.
1.5 Developing a physical model - the main steps
M F Ashby Mat Sci Tech 8, 102 (1992)
Copyright 2001 University of Cambridge. Not to be quoted or copied without permission.
1.6 Summary of steps in model development
Step 1 : Identifying the problem
Step 2 : Identifying the desired inputs and outputs
Step 3 : Identifying the physical mechanisms
Step 4 : Targeting the precision
Step 5 : Constructing the model
Step 6 : Dimensional analysis
Step 7 : Computer implementation
Step 8 : Interrogating the model
Step 9 : Displaying the results
Course C1 Lecture 1

7
Copyright 2001 University of Cambridge. Not to be quoted or copied without permission.
1.6 Summary of steps in model development
Step 1 : Identifying the problem
Step 2 : Identifying the desired inputs and outputs
Step 3 : Identifying the physical mechanisms
Step 4 : Targeting the precision
Step 5 : Constructing the model
Step 6 : Dimensional analysis
Step 7 : Computer implementation
Step 8 : Interrogating the model
Step 9 : Displaying the results
Copyright 2001 University of Cambridge. Not to be quoted or copied without permission.
1.7 Step 2: Identifying desired inputs & outputs
What are the essential ingredients of the model?
(temperature, time, composition, load, boundary
conditions etc)
What are the less important quantities that could be
added later?
Remember that the output is only as good as the
input
Output could be used as input for a higher level
model
Course C1 Lecture 1

8
Copyright 2001 University of Cambridge. Not to be quoted or copied without permission.
1.7.1 Numerical hygiene of data
Numerical hygiene what does this mean?
The vast majority of your data will be in the form of
numbers, often recorded in digital format
The way in which these are recorded should reflect
confidence in their precision zeroes to the right of the
decimal point have a significance in science!
For example, 1.000 carries an implicit assumption that
quantity is known to at least 4 significant figures
Similarly, writing 8.230842372190 , is unjustified if you
cannot be sure about the magnitude of any error
Thinking carefully will improve quality of your science!
Copyright 2001 University of Cambridge. Not to be quoted or copied without permission.
1.8 Step 4: Targeting the precision
Determine what degree of precision is tolerable
Do you really need to know the forces on atoms to
10
-6
eV/?
Iterate the model with increasing precision
Introduce new features into the model to test its
sensitivity to precision
Use more computer power?
Course C1 Lecture 1

9
Copyright 2001 University of Cambridge. Not to be quoted or copied without permission.
1.8.1 Quantitative treatment of errors
Quantitative treatment of random errors based on
statistical theory of discrete distibutions (C3, p. 64-67)
Essentially, we are saying that the true value of a
physical quantity has a certain probability of lying
within a given range of values
Depending on what we want our experiment or model
to achieve, we will demand a more or less precise
answer (we always strive for accuracy!)
In a world of finite time and resources, we need to
make sure that we are not measuring quantities either
too roughly, or too precisely
Copyright 2001 University of Cambridge. Not to be quoted or copied without permission.
1.9 Step 6: Dimensional analysis
Check that equations and results are dimensionally
correct
Many calculations are performed with dimensionless
units (e.g. a reduced temperature in molecular
dynamics)
This allows trends in behaviour to be studied
Often dimensionless units are used for exponential,
log or power law arguments
Course C1 Lecture 1

10
Copyright 2001 University of Cambridge. Not to be quoted or copied without permission.
1.9.1 Units and dimensional analysis
In addition to their numerical magnitude, physical quantities
must also posses well-defined units: [m], [m s
1
], etc.
Without units, a quantity can have no physical meaning!
As well as being essential for meaning, units can also be very
helpful for keeping track of how physical quantities are
combined this is called dimensional analysis
In particular physical quantities with differing units should not
be combined together
Also, should not take the logarithm of, exponentiate or
otherwise evaluate a function of quantities with units
Quantities must be non-dimensionalised before they are used
in functions or combined with others of different type
Copyright 2001 University of Cambridge. Not to be quoted or copied without permission.
1.9.2 Relationships among the SI units
[1] http://physics.nist.gov/cuu/Units/units.html
Course C1 Lecture 1

11
Copyright 2001 University of Cambridge. Not to be quoted or copied without permission.
1.9.2 Reduced units
In simulation work, it is common practice to express
thermodynamic parameters in reduced units
The quantities are reduced by forming dimensionless
combinations of simulation parameters
Reduced quantities are usually starred, e.g the reduced
quantities for a Lennard-Jones fluid are:





There is no unique choice of reduced units, but it makes sense
to use the simplest possible dimensionless combination of
simulation parameters

3
1/2
2
* /
* /
* /
B
T k T
p p
t t m



1/ 2
3
* /
* /
* /
v v m
F F
N V

Copyright 2001 University of Cambridge. Not to be quoted or copied without permission.


1.10 Step 9: Displaying the results
Visualisation mapping process produces an Abstract
Visualisation Object (AVO) from the derived data
Each physical quantity represented by the derived
data, such as temperature, density, velocity, etc., is
mapped onto a visual attribute of the AVO, such as
spatial dimensions, time, colour, transparency, etc
The result is an AVO which can either look very much
like a real object, such as a molecule coloured
according to its local charge density, or be a
completely abstract entity, such as a charge density
map projected into some 2D parametric space
Course C1 Lecture 1

12
Copyright 2001 University of Cambridge. Not to be quoted or copied without permission.
1.10.1 Visualisation mapping: examples
Realistic mapping
Atomic site
representation of a
sulphonate sidegroup
and part of PTFE
backbone, with partial
charges indicated on
right-hand figure
Copyright 2001 University of Cambridge. Not to be quoted or copied without permission.
1.10.2 Visualisation mapping: examples
Abstract mapping
Electronic orbital (HOMO) for
Mo
41
cluster embedded in C
180

fullerene.
Isosurface threshold denotes
magnitude and colour denotes
sign of the wavefunction.
Course C1 Lecture 1

13
Copyright 2001 University of Cambridge. Not to be quoted or copied without permission.
1.10.3 Visualisation mapping: map types
2D scatter plots
Shows relationship between two variables, allowing visual
identification of complex dependencies
3D scatter plots
Extension of 2D scatter plot. Often need to use depth
cueing and rotation to identify obscured detail
Coloured height fields
Similar to 2D scatter plot, but using height and colour
Glyphs
Encode multiple variables, e.g. streamlines, arrow plots
Animation
Copyright 2001 University of Cambridge. Not to be quoted or copied without permission.
Modelling strength of carbon nanotube fibres
Course C1 Lecture 1

14
Copyright 2001 University of Cambridge. Not to be quoted or copied without permission.
Summary
In this lecture, we introduced the scope and
objectives of Materials Modelling
We discussed the hierarchy of materials models
based on length scale and summarised the methods
used at each level
The nine principal steps in developing a physical
materials model were presented
The next lecture will discuss advanced methods for
fitting of models to data
Course C1 Lecture 2
1
Dr James Elliott
Advanced methods for model fitting
and data analysis
Quantitative data analysis
and model-fitting methods
Part II Materials Science Course C1
Copyright 2001 University of Cambridge. Not to be quoted or copied without permission.
2.1.1 Fitting models to experimental data
Often, we would like to fit a set of numerical data with a
particular model function, perhaps a straight line
Course C1 Lecture 2
2
Copyright 2001 University of Cambridge. Not to be quoted or copied without permission.
2.1.2 Fitting models to experimental data
Graphical methods or linear regression
Can fit by eye to straight line, or transform function to a
straight line and then fit, e.g.



Estimate error in gradient and intersection point from
distribution of data around the fitted line
Test suitability of fit by computing the residuals about the
fitted line histogram should follow a normal distribution
Any systematic deviations from normal distribution indicate
that fitted function is not suitable
B B
B
exp ln ln
Let ln and fit to obtain / and ln
Q Q
y A y A
k T k T
m
z y z c m Q k c A
T
| |
= =
|
\ .
= = + = =
Copyright 2001 University of Cambridge. Not to be quoted or copied without permission.
2.2.1 Non-linear least squares analysis
We will not discuss theory of non-linear techniques, but they
can be used to fit multi-parameter functions directly without
transforming into a straight line
In Part IB, we covered an example used in polymer science to
fit X-ray diffraction data with triple Gaussian profile
Scattering data is assumed to
consist of two crystalline
reflections superimposed on a
broad amorphous halo
All peaks are modelled by
Gaussian functions
We wanted to deconvolute the
scattering into separate peaks
Course C1 Lecture 2
3
Copyright 2001 University of Cambridge. Not to be quoted or copied without permission.
Non-linear least squares analysis (not examinable)
Start by defining a Gaussian function to represent the 110 crystal
reflection:
gnuplot> crystal_110(x) = a*exp(-(x-b)**2/(2*c**2))
Then define two more functions to represent the 200 crystal
reflection and the amorphous phase:
gnuplot> crystal_200(x) = d*exp(-(x-e)**2/(2*f**2))
gnuplot> amorph(x) = g*exp(-(x-h)**2/(2*i**2))
Combine these all into total intensity function:
gnuplot> total(x) = crystal_110(x)+crystal_200(x)+amorph(x)
Fit this to data set, first setting some sensible initial guesses for
your parameters (we have 9 in total!):
gnuplot>
a=100;b=2.1;c=0.5;d=40;e=2.5;f=0.02;g=30;h=2.78;i=0.02
gnuplot> fit total(x) data.dat via a,b,c,d,e,f,g,h,i

Copyright 2001 University of Cambridge. Not to be quoted or copied without permission.
Non-linear least squares analysis (not examinable)
Output from gnuplot fitting routine gives parameters and
their standard errors








Also of interest is the correlation matrix of fit parameters,
which reveals any interdependencies
Final set of parameters Asymptotic Standard Error
======================= ==========================
a = 109.232 +/- 2.01 (1.84%)
b = 2.33536 +/- 0.01051 (0.45%)
c = 0.31653 +/- 0.006204 (1.96%)
d = 37.1998 +/- 3.693 (9.927%)
e = 2.53854 +/- 0.008686 (0.3422%)
f = 0.0853875 +/- 0.009819 (11.5%)
g = 90.408 +/- 3.604 (3.986%)
h = 2.78811 +/- 0.003543 (0.1271%)
i = -0.0832852 +/- 0.004017 (4.823%)
Course C1 Lecture 2
4
Copyright 2001 University of Cambridge. Not to be quoted or copied without permission.
2.2.2 Data preparation: fitting and interpolation
However, there are dangers inherent to fitting which centre
around the number of free parameters used.
Use as few degrees of freedom
as possible (Occams Razor),
and certainly many fewer than
the total number of data points.
Correlation coefficients (R
2
) and
mean-squared errors show little
about physical meaning of fit.
Can be better handled by
maximum likelihood or neural
network methods (see later)
R
2
= 1.00
R
2
= 0.78
Copyright 2001 University of Cambridge. Not to be quoted or copied without permission.
2.3.1 The _
2
test for goodness of fit
However, often we would like to test quantitatively whether a
particular set of data conform to a model function
We are interested in the distribution of the residuals (i.e. fitting
errors) of the data, D
i
, relative to the model function, F
i
Supposing the errors, X
i
, are a set of independently distributed
normal variables, then the residuals, x
i
, defined as:


have a sum of squares that follows a _
2
(chi-squared) distribution
with (n 1) degrees of freedom
1 2 3
, , ,...,
i n i i
x x x x x F D = =
( )
2
2
2
1
2 2
1 1
where are s.d. of
n n
i i
i
n i i
i i
i i
F D
x
D

= =

= _ o
o o

Course C1 Lecture 2
5
Copyright 2001 University of Cambridge. Not to be quoted or copied without permission.
2.3.2 The _
2
test for goodness of fit
The probability density function for the _
2
distribution is:
/ 2 1
1
/ 2
0
exp( / 2)
( ) where ( ) d
( / 2) 2
n
z t
n
n
x x
p x z t e t
n

= I =
I
}
Generally skew, with a
maximum for n > 2 which
moves further to right as
the number of degrees of
freedom n increases
Copyright 2001 University of Cambridge. Not to be quoted or copied without permission.
2.3.3 The _
2
test for goodness of fit
Generally, we compute the reduced _
2
statistic by dividing by
the number of degrees of freedom, D.O.F. = n 1 p :



where p is the number of free parameters in our model
If reduced _
2
~ 1, then the model is a good fit to the data
If reduced _
2
>> 1, then the model is a bad fit (can compute
exact probability from c.d.f. of _
2
)
If reduced _
2
< 1, then model is said to be over-fitted, in other
words we have too many degrees of freedom (or
overestimated errors in our data)
( )
2
2
R
2
1
1
where are s.d. of
. . .
n
i i
i i
i
i
F D
D
DO F
=

_ = o
o

Course C1 Lecture 2
6
Copyright 2001 University of Cambridge. Not to be quoted or copied without permission.
For example, considering a linear regression model, we can
evaluate what level of error (assume a fixed value for each
datum) is consistent with the linear model fit:
0
10
20
30
40
0 5 10 15 20 25 30 35 40
n = 40
o
y
= 1.56
_
r
2
= 1.04

GOOD FIT
Large n
_
r
2
~ 1
A credible fit
with reasonable
variance
remaining
2.3.4 The _
2
test for goodness of fit
Copyright 2001 University of Cambridge. Not to be quoted or copied without permission.
For example, considering a linear regression model, we can
evaluate what level of error (assume a fixed value for each
datum) is consistent with the linear model fit:
0
10
20
30
40
0 5 10 15 20 25 30 35 40
n = 40
o
y
= 1.00
_
r
2
= 2.53

QUESTIONABLE
Large n
_
r
2
~ 2.5
Fair number of
points more than
1o away from line

2.3.4 The _
2
test for goodness of fit
Course C1 Lecture 2
7
Copyright 2001 University of Cambridge. Not to be quoted or copied without permission.
For example, considering a linear regression model, we can
evaluate what level of error (assume a fixed value for each
datum) is consistent with the linear model fit:
BAD FIT
Large n
_
r
2
~ 10
o too low to
justify linear fit
unexplained
variance
0
10
20
30
40
0 5 10 15 20 25 30 35 40
n = 40
o
y
= 0.50
_
r
2
= 10.11

2.3.4 The _
2
test for goodness of fit
Copyright 2001 University of Cambridge. Not to be quoted or copied without permission.
For example, considering a linear regression model, we can
evaluate what level of error (assume a fixed value for each
datum) is consistent with the linear model fit:
0
10
20
30
40
0 5 10 15 20 25 30 35 40
n = 40
o
y
= 4.00
_
r
2
= 0.16

OVER-FIT
Large n
_
r
2
~ 0.15
o are too high to
justify linear fit


2.3.4 The _
2
test for goodness of fit
Course C1 Lecture 2
8
Copyright 2001 University of Cambridge. Not to be quoted or copied without permission.
2.3.5 The _
2
test for goodness of fit
The _
2
test indicates why it is bad to try to fit a model to
imprecise data (large random errors) with too many degrees of
freedom (ill-constrained)
Consider linear versus sextic polynomial fit:
0
2
4
6
8
10
0 2 4 6 8 10
0
1
2
3
4
0 0.5 1 1.5 2
R
e
d
u
c
e
d

c
h
i
-
s
q
u
a
r
e
Standard error
Linear model
Sextic model
Course C1 Lecture 3
1
Dr James Elliott
Introduction to Monte Carlo method
An overview of statistical
sampling methods and MC
Part II Materials Science Course C1
Copyright 2001 University of Cambridge. Not to be quoted or copied without permission.
3.1 Why Monte Carlo?
The name derives from the association of statistical
sampling methods with games of chance, such as those
played in the famous casinos of Monte Carlo
Although the name Monte Carlo is relatively recent
(1949) and intimately associated with the use of
computers, statistical sampling methods are in fact much
older than this (as we will see in a moment)
In a time when numerical calculations were done by
hand, these methods were used to calculate integrals
which cannot be solved exactly
Modern Monte Carlo (MC) techniques, however, are
primarily designed to attack problems in physics
Course C1 Lecture 3
2
Copyright 2001 University of Cambridge. Not to be quoted or copied without permission.
Statistical sampling: Buffons needle
Probably the most famous example of MC is known as
Buffons needle, an experiment in which the value of t is
estimated by repeatedly dropping a needle onto a surface
ruled with equally spaced lines
The experiment is named after Georges-Louis Leclerc,
Comte de Buffon, who showed in 1777 that if a needle of
length l is thrown at random onto lines of spacing d then
the probability that the needle intersects a line is 2l/td,
provided d > l
Laplace then pointed out in 1820 that if a needle is
thrown down N times, and lands on a line M of those
times, then an estimate for t is given by

( ) Md Nl
N
/ 2
lim

Copyright 2001 University of Cambridge. Not to be quoted or copied without permission.
Illustration of Buffons needle using JAVA applet
Since the estimate for t converges rather slowly, we must
resort to computer simulation to get something
approaching reasonable accuracy

http://www.angelfire.com/wa/hurben/buff.html

Even simulating for tens of thousands of throws, the
accuracy rarely exceeds just a few decimal places
However, the point is to show that deterministic
quantities can be estimated using stochastic processes
Course C1 Lecture 3
3
Copyright 2001 University of Cambridge. Not to be quoted or copied without permission.
3.2 Brief history of MC methods
It was not until the use of mechanical calculating machines
that full power of MC methods could be unleashed
In the early 20th century, mechanical adding machines
were used to calculate firing tables for heavy artillery
The association with armed conflict continued into the
Second World War when MC methods were used in the
development of the hydrogen bomb at Los Alamos using
the worlds first supercomputer ENIAC
Although the first MC calculations on ENIAC came too late
to make any significant contribution to the Manhattan
Project, the techniques used were quickly taken up by the
scientific research community
Copyright 2001 University of Cambridge. Not to be quoted or copied without permission.
3.3 Emergence of modern MC methods
These developments lead to the first paper to coin the
term Monte Carlo by Metropolis and Ulam in 1949
With the arrival of a newer, faster computer called
MANIAC at Los Alamos, there followed a stream of seminal
contributions to the field of MC simulation
In particular a 1953 paper by Nicolas Metropolis, Marshall
and Arianna Rosenbluth, and Edward and Mici Teller on
thermal importance sampling that introduced the famous
Metropolis algorithm
50th Anniversary in 2003, and still one of the most highly
cited scientific papers of all-time (ca. 14,300 citations on
Web of Knowledge as of Oct 2012)
Course C1 Lecture 3
4
Copyright 2001 University of Cambridge. Not to be quoted or copied without permission.
3.4.1 The Monte Carlo method
The goal of a Monte Carlo simulation is the calculation of
the expectation value of some mechanical quantity <Q>.
Ideally, we would just calculate:



which is average of Q over all microstates of the system
weighted with their Boltzmann probability
However, in our simulation we can only consider a tiny
fraction of the total number of states, so we must average
over states sampled in a very particular way
( )
i
i
i
E Q
Z
Q exp
1
=

=
=
M
i
i
Q
M
Q
1
1
Copyright 2001 University of Cambridge. Not to be quoted or copied without permission.
3.4.2 The Monte Carlo method
However, we have so far said nothing about how we choose
each state so it appears with its correct Boltzmann probability.
To answer this question, we need to consider MC as a Markov
process.
A Markov process is a mechanism by which an initial state o is
transformed to a new state v in a stochastic fashion using a set
of transition probabilities P(ov) which satisfy certain
conditions.
o: p
o
, T
o
v: p
v
, T
v
P(ov)
Frenkel 3.1.2
Course C1 Lecture 3
5
Copyright 2001 University of Cambridge. Not to be quoted or copied without permission.
3.4.3 The Monte Carlo method
The transition probabilities for a true Markov process should
satisfy the following conditions:
They should not vary with time
They should only depend on the properties of the initial and final
states, not on any other states the system has passed through
For a given initial state, the sum of the transition probabilities over all
final states must be equal to unity
In a MC simulation, we repeatedly apply a Markov process to
generate a Markov chain of states.
The Markov process is chosen such that it produces a
succession of states which appear with their Boltzmann
probabilities.
This is known as equilibration of the system, although it is not
necessary that the system follow any well-defined kinetic
pathway to equilibrium (more on this later).

Copyright 2001 University of Cambridge. Not to be quoted or copied without permission.
3.4.4 The Monte Carlo method
In order to reach equilibrium, our Markov process should be
ergodic, i.e. it should be possible to reach any state of the
system from any other state.
It should also satisfy the principle of detailed balance, i.e. the
rate at which the system makes transitions into and out of any
microstate must be equal:


The condition of detailed balance imposes time-reversal
symmetry on the system, and gives us a sufficient (but not
necessary) condition for the ratio of our transition
probabilities to give a Boltzmann equilibrium distribution of
microstate occupancies.

( ) ( ) p P p P =
Course C1 Lecture 3
6
Copyright 2001 University of Cambridge. Not to be quoted or copied without permission.
3.4.5 The Monte Carlo method
For our equilibrium distribution to be Boltzmann-like, the ratio
of transition probabilities should be:



In practice, we tune the actual transition probabilities to make
the acceptance ratio, i.e. the probability of a randomly
generated transition being successful, as high as possible.
The only constraints are the above equation, and that the sum
over all transition probabilities is equal to unity.
| |

( )
exp ( )
( )
p P
E E
P p

= =

Copyright 2001 University of Cambridge. Not to be quoted or copied without permission.


3.5.1 The Metropolis algorithm
Finally, we arrive at the Metropolis algorithm, which can
be summarised as follows:
1. Start with a system in (an arbitrarily chosen) state o and evaluate the
energy of current state, E
o
2. Generate a new state v by a small ergodic perturbation to state o,
and evaluate energy of new state, E
v
3. If E
v
E
o
< 0 then accept the new state. If E
v
E
o
> 0 then accept the
new state with probability exp[|(E
v
E
o
)]
4. Return to step 2 and repeat until equilibrium is achieved
The Metropolis algorithm is characterised by having a
transition probability of unity if the new state has a
lower energy than the initial state
This is more efficient than simply accepting states on the
basis of their absolute Boltzmann factor

Course C1 Lecture 3
7
Copyright 2001 University of Cambridge. Not to be quoted or copied without permission.
3.5.2 The Metropolis algorithm
Analogy with trying to measure the depth of River Nile







The Metropolis algorithm is a general MC scheme for
simulating in the NVT canonical ensemble, and it works
reasonably efficiently in a wide range of situations

Frenkel 3.1.2
Copyright 2001 University of Cambridge. Not to be quoted or copied without permission.
3.5.3 The Metropolis algorithm
Requires a source of a large number of good quality
random numbers in order to decide whether a move
which raises the total energy should be accepted
Also, efficiency of the standard Metropolis algorithm can
almost always be improved when applied to a new
problem by giving careful thought to choosing the best
transition probabilities
The result is often a faster simulation, and the
improvement can easily make the difference between
finding an answer to a problem and not finding one
In Part III (M16 Atomistic Modelling), we will describe
these advanced methods in more detail
Course C1 Lecture 3
8
Copyright 2001 University of Cambridge. Not to be quoted or copied without permission.
3.6.1 The 2D Ising model
We will now apply the Metropolis algorithm to the 2D Ising
model to show how the MC method works in practice
The Ising model is a simple model of a magnet which
consists of a number of two-state (up/down) spins on a
lattice. Each spin can interact with its nearest neighbour,
and also with an external magnetic field
=
i j i
i, j i
H s s B s
B
Study magnetisation or specific heat as
a function of temperature
Copyright 2001 University of Cambridge. Not to be quoted or copied without permission.
3.6.2 The 2D Ising model
The MC scheme involves starting the lattice in a random
(T = ) or completely ordered (T = 0) configuration, and
then flipping single spin states at random
This guarantees ergodicity, as every microstate of the
system is accessible, in principle
The new microstate is accepted according to the
Metropolis scheme, i.e. with probability 1 if the energy is
lower, and with Boltzmann probability if the energy is
higher than the previous state
For the square lattice shown, the change in spin energy
with zero external field will be a multiple of 2c,
depending on the sign of the 4 nearest neighbour spins
Course C1 Lecture 3
9
Copyright 2001 University of Cambridge. Not to be quoted or copied without permission.
3.6.3 The 2D Ising model
The nice thing about the 2D Ising model is that it is
exactly solvable (Onsager 1944)
Results of MC simulation can be compared against
theory, which is derived by explicitly writing down and
solving the partition function for this system.
We can compare the mean magnetisation per spin, m,
and the specific heat capacity, c, which are given by:
( )
2
2
2 B
1

=
=
i
i
m s
N
k
c H H
N
[Recall from 3.6.1, H is total energy]
Copyright 2001 University of Cambridge. Not to be quoted or copied without permission.
3.6.4 The 2D Ising model
Comparison of exact results (solid lines) with MC simulations
(points) for mean magnetisation (left) and specific heat capacity
(right) for a 100100 model.
[data taken from Newman and Barkema (Clarendon Press, 1999)]
Reduced temperature (k
B
T/c)
1
=
i
i
m s
N
( )
2
2
2 B

=
k
c H H
N
Course C1 Lecture 3
10
Copyright 2001 University of Cambridge. Not to be quoted or copied without permission.
Illustration of 2D Ising model using JAVA applet
Can study ferromagnetic phase transition of 2D Ising
model in real time using MC applet

http://www.pha.jhu.edu/~javalab/ising/ising.html

Note the appearance of large fluctuations in the
magnetization near the phase transition point
Standard Metropolis algorithm has problems with
convergence at this point (formally, the heat capacity is
divergent at Curie temperature, T
C
)
Copyright 2001 University of Cambridge. Not to be quoted or copied without permission.
3.5 Application to off-lattice systems
It is fairly simple, at least conceptually, to extend the
Metropolis algorithm to off-lattice systems given an
appropriate Hamiltonian
For example, to simulate a monatomic fluid we simply
construct trial moves by randomly displacing particles
If we are simulating molecules instead of atoms, then we
need to include orientational moves for rigid molecules
For flexible molecules, such as polymers, we must also
consider the internal degrees of freedom of each chain
We must ensure that the trial moves form ergodic set,
and that their distribution satisfies the symmetry
requirements of microscopic reversibility
Leach 8
Course C1 Lecture 3
11
Copyright 2001 University of Cambridge. Not to be quoted or copied without permission.
5.6.1 Improving on the Metropolis algorithm
Although the Metropolis algorithm performs quite
well for the Ising model, can be greatly accelerated by
introducing additional moves into the algorithm
One of the great advantages of the MC method is that
these moves need not be physically realistic
They need only obey acceptance rules which generate
a Boltzmann-like distribution of microstates
So, we are permitted to make any move that is
thermodynamically permissible
However, we should be careful that the modified
move set is still ergodic, at least in principle
Copyright 2001 University of Cambridge. Not to be quoted or copied without permission.
3.6.2 Improving on the Metropolis algorithm
Accelerating equilibration
Cluster moves
For example, in the Ising model, instead of swapping single spin states,
we can swap clusters of spin states. Provided we generate these
clusters probabilistically, the algorithm is still ergodic, and requires
many less MC steps per lattice site for equilibration. Also, much better
performance around the Curie point.
Binder 5.1.2
Course C1 Lecture 3
12
Copyright 2001 University of Cambridge. Not to be quoted or copied without permission.
3.6.3 Improving on the Metropolis algorithm
Accelerating equilibration
Exchange of particle identity
For example, in a binary mixture, we can exchange the identity of a
pair of particles, even though they may be separated by a large
distances or by other particles! Such moves can greatly facilitate
mixing of species in a dense system.

Copyright 2001 University of Cambridge. Not to be quoted or copied without permission.
3.6.4 Improving on the Metropolis algorithm
The price paid for using unphysical moves is a loss of
information about the dynamics of the system
Strictly, MC methods should only be used to generate
an equilibrium configuration of the system and
thereby study the average thermodynamic properties
In practice, when using a reasonably physical move
set, MC can also yield valuable information about the
equilibrium dynamics of the system
Such methods are known as kinetic Monte Carlo
(KMC) techniques, and we will study an example in
detail in next lectures case study

Course C1 Lecture 3
13
Copyright 2001 University of Cambridge. Not to be quoted or copied without permission.
Summary
In this lecture, we introduced the concept of statistical
sampling, and how it can be used to calculate
deterministic quantities
We briefly reviewed history of Monte Carlo method,
and described the Metropolis method for thermal
importance sampling
The 2D Ising model was studied as an example of
application of Metropolis MC, and a comparison of
computational results with exact theory
Finally, we discussed some ways of improving on the
basic Metropolis algorithm
Next lecture, we will look at a real case study using MC
Course C1 Lecture 4

1
Dr James Elliott
Case study for Monte Carlo method:
Microstructural Evolution
Statistical models of grain
growth in materials
Part II Materials Science Course C1
Copyright 2001 University of Cambridge. Not to be quoted or copied without permission.
4.1 The problem
Classical theory predicts that grain growth in a
microstructural of polycrystalline material follows a
power law:

where = mean grain size, t = time, n = .
However, measurements indicate n = 0.3 to 0.5 for
many metals and ceramics: why is this?
Can materials modelling help? One approach is to
apply statistical modelling at the microstructural
level to understand the influence of topology,
preferred grain orientations and impurities
n
D Kt =
D
Course C1 Lecture 4

2
Copyright 2001 University of Cambridge. Not to be quoted or copied without permission.
4.2 Hierarchy of materials modelling


Copyright 2001 University of Cambridge. Not to be quoted or copied without permission.
4.3 Typical microstructure






Random grain structures are inherently unstable
Curved boundaries have forces acting on them
Annealing at high T causes boundaries to migrate
towards their centres of curvature, thereby reducing
excess surface free energy
Annealed Cu-Zn alloy
Course C1 Lecture 4

3
Copyright 2001 University of Cambridge. Not to be quoted or copied without permission.
4.4 Grain boundary migration
Grains with less than 6 sides have concave inwards boundaries and shrink
during annealing
Grains with more than 6 sides grow
This assumes 2-D grains, 120 angles at triple junctions and all boundaries
have the same energy.






Net result: number of grains reduces, total G.B. energy reduces and mean
grain size increases
This is known as grain growth and occurs at T > 0.5 T
m
Copyright 2001 University of Cambridge. Not to be quoted or copied without permission.
4.5 Assumptions in the classical theory
All boundaries have the same mobility
No variation of G.B. energy with misorientation
The G.B. velocity is a linear function of driving force
(free energy difference per unit volume)
No impurity segregation or second phase particles
All grains are convex polyhedra and described by a
single curvature parameter, D
Consequences: the grains are always geometrically
self-similar and grain growth is continuous (known as
normal grain growth)
Course C1 Lecture 4

4
Copyright 2001 University of Cambridge. Not to be quoted or copied without permission.
4.6 A model which improves the theory
Construct a microstructure which is non-spherical
and topologically connected
Allow for mutually interacting grains and detailed
boundary environments
Allow for impurity dispersions and anisotropic
boundary energies
Allow for the presence of surfaces
Let the microstructure evolve using a statistical
sampling process
This is called a stochastic model
Srolovitz et al Acta metall 32, 783 (1984) + others
Copyright 2001 University of Cambridge. Not to be quoted or copied without permission.
4.7 The Monte Carlo model
The name derives from the association of statistical
sampling methods with games of chance, such as
those played in the famous casinos of Monte Carlo
There are three stages:

1) Mapping the microstructure onto a discrete
lattice

2) Defining the interaction between lattice sites

3) Evolving the microstructure using statistical
mechanics

Course C1 Lecture 4

5
Copyright 2001 University of Cambridge. Not to be quoted or copied without permission.
4.8 Mapping the microstructure
A fixed lattice is defined (e.g. triangular in 2D) and each lattice
site is given a number S
i
between 1 and Q corresponding to
orientation of the grain in which it is embedded (Potts model)
A grain boundary is defined as line separating two different S
i


Example where
Q = 5
Copyright 2001 University of Cambridge. Not to be quoted or copied without permission.
4.9 Defining the site interaction energy
The interaction between nearest neighbour (nn) sites is given
by:





Thus the system prefers like nn orientations since this does not
increase the energy (H = 0).
In other words, propagation of long-range order.
Q = 2 is known as the Ising model (magnetism, 2 spins|+)
( )
1
i j
S S
nn
H J = o

where 1 and is a constant


i
S Q J s s
1 if or zero otherwise
i j
S S i j
S S o = =
Course C1 Lecture 4

6
Copyright 2001 University of Cambridge. Not to be quoted or copied without permission.
4.10 Evolving the microstructure
Use the Metropolis algorithm, as described in lecture 3
At T = 0, only transitions which lower the energy are accepted
At high T, energetically unfavourable transitions are more
likely to be accepted (P tends to unity)
Successful transitions at the G.B.s results in G.B. migration
Copyright 2001 University of Cambridge. Not to be quoted or copied without permission.
MaterialsSim Grain Growth: JAVA applet
JAVA applet to simulate grain growth via MC algorithm

http://www.blikstein.com/paulo/projects/materialsim/models
/materialsim_grain_growth.html

Can be used to explore grain growth in 2D, both with
and without pinning (see slide 4.18)
Course C1 Lecture 4

7
Copyright 2001 University of Cambridge. Not to be quoted or copied without permission.
4.11 Time dependence of the microstructure
Large grains consume small grains.
Example below shows a Q= 64 model with 40,000 lattice sites.
Unit of time is 1 Monte Carlo step (MCS) per site which
corresponds to 40,000 re-orientation attempts.
Copyright 2001 University of Cambridge. Not to be quoted or copied without permission.
4.12 Effect of increasing Q
Small Q gives irregular and disconnected grains.
Large Q (>64) gives compact and equiaxed grains.

Course C1 Lecture 4

8
Copyright 2001 University of Cambridge. Not to be quoted or copied without permission.
4.13 Comparison with ideal classical theory
Plotting log(D) against log(t) gives the exponent n in the
classical grain growth law.
The value of n is taken from the long time fitted line.
n (gradient) = 0.41
The mean grain size is
determined from a
topological analysis of
the simulated grain structure
Copyright 2001 University of Cambridge. Not to be quoted or copied without permission.
4.14 Q-dependence of grain growth exponent
Exponent n decreases linearly with increasing Q
For Q > 30, n is constant with a value of about 0.4
In the Ising limit (Q=2), n = 1/2






Exponent is independent of temperature up to T = 0.7 T
m
Course C1 Lecture 4

9
Copyright 2001 University of Cambridge. Not to be quoted or copied without permission.
4.15 Comparison with experimental data
Metal
(zone refined)
Exponent n
Al 0.25
Fe 0.40
Pb 0.40
Sn 0.43
Ceramic Exponent n
ZnO 1/3
MgO 1/2
CdO 1/3
UO
2
1/3
The metals are pure, therefore impurities are not affecting n.
However the ceramics are inherently porous which may limit the kinetics
Copyright 2001 University of Cambridge. Not to be quoted or copied without permission.
4.16 Grain size distributions
The frequency of occurrence of a particular grain size is found
to be time invariant.
The distribution function is monomodal as expected for normal
grain growth.
Distribution of grain sizes
is plotted at 15 different
times during the simulation
Course C1 Lecture 4

10
Copyright 2001 University of Cambridge. Not to be quoted or copied without permission.
4.17 The influence of a particle dispersion
A fraction of sites are given Q values different from the rest
and are not allowed to change. These simulate immoveable
particles.

Copyright 2001 University of Cambridge. Not to be quoted or copied without permission.
4.18 Results of particle dispersion
Normal grain growth is observed followed by a sudden
transition to a pinned state. Grain growth stagnates.

Course C1 Lecture 4

11
Copyright 2001 University of Cambridge. Not to be quoted or copied without permission.
4.19 G.B. pinning and growth stagnation
Classical theory by Zener (see Pt 1B Course A) predicts pinning in 2D
when the mean grain size is given by:


The simulations agree with this: the mean grain size and time to
stagnation are inversely proportional to particle concentration.

0
2
r
D
f
t
=
r
0
is particle size
f is particle concentration
Copyright 2001 University of Cambridge. Not to be quoted or copied without permission.
4.20 Effect of preferred grain orientations
To simulate secondary (or abnormal) grain growth the site interaction
energy is modified to include favoured sites Q
k
:



where if Q
k
is a preferred grain and zero otherwise.

A bimodal grain size distribution is obtained

( ) 0
1
i k i j
S Q S S
k nn
H J J = o o

1
i k
S Q
o =
Course C1 Lecture 4

12
Copyright 2001 University of Cambridge. Not to be quoted or copied without permission.
Summary
In this lecture we illustrated the use of a statistical
model to understand microstructural evolution
The main features of the computational methodology
were summarised
The results were compared to classical kinetic theory
and experimental data
The introduction of a connected grain structure lead
to improvements to the classical theory
Course C1 Lecture 5
1
Dr James Elliott
Introduction to the Molecular
Dynamics method
Dynamical simulations at constant
energy and constant temperature
Part II Materials Science Course C1
Copyright 2001 University of Cambridge. Not to be quoted or copied without permission.
5.1 Philosophy of molecular dynamics
In the final part of this course, we will discuss the Monte
Carlo (MC) method which is a probabilistic simulation
technique
Molecular dynamics (MD) differs by being deterministic*,
which means that the future state of the system is in
principle completely determined by its present state
The central idea is to solve Newtons equations of motion
for a system of atoms which interact via a potential
energy function known as a force field
MD is most commonly used to compute equilibrium and
transport properties (e.g. diffusion coefficients)
It is particularly well suited to model macromolecular
systems because of the generality of the algorithm
Course C1 Lecture 5
2
Copyright 2001 University of Cambridge. Not to be quoted or copied without permission.
5.2 Some differences between MD and MC
In MD, successive states are directly connected in time
whereas in MC there is no direct temporal relationship
between configurations (excepting KMC)
MD has a kinetic energy contribution to the total energy,
whereas in MC the total energy is determined solely by
the potential energy function
MD samples naturally from states at constant energy
(microcanonical or NVE ensemble), whereas Metropolis
MC samples from states at constant temperature
(canonical or NVT ensemble)
However, we will see later how to modify the MD
method to sample states at constant temperature
Copyright 2001 University of Cambridge. Not to be quoted or copied without permission.
5.3.1 Historical origins of MD
MD entered the scientific community around a decade
after MC, when Alder and Wainwright investigated the
properties of a simple model for a fluid consisting of so-
called hard spheres
The simulations are analogous to shaking up a container
full of ball bearings and, before the days of computers,
such a technique was used to derive the coordination
number of a random fluid!
Since then, MD has been used to study the properties of
many different hard-core fluids, i.e. those with particles
which interact via discontinuous potentials
These are examples of impulsive dynamical simulations
Course C1 Lecture 5
3
Copyright 2001 University of Cambridge. Not to be quoted or copied without permission.
5.3.2 Modelling B.C. (before computers)
Steel ball hard sphere model for packing of liquid atoms
Copyright 2001 University of Cambridge. Not to be quoted or copied without permission.
5.3.3 Historical origins of MD
It was not until 1967 that MD was used by Verlet to study
a realistic molecular system, in which the atoms
interacted via a Lennard-Jones potential
After this point, MD techniques developed rapidly to
encompass diatomic species, water, small rigid
molecules, flexible hydrocarbons, and now even
macromolecules such as proteins and DNA
These are all examples of continuous dynamical
simulations, and the way in which the atomic motion is
calculated is quite different from that in impulsive
simulations containing hard-core repulsions
Course C1 Lecture 5
4
Copyright 2001 University of Cambridge. Not to be quoted or copied without permission.
5.4 Continuous time molecular dynamics
This is now by far the most common application of MD
By calculating the derivative of a force field, we can find the
forces on each atom as a function of its position.
Requires a method of evolving the positions of the particles
in space and time to produce a true dynamical trajectory
Standard technique is to solve Newtons equations of
motion numerically, using some finite difference scheme,
which is known as integration
This means that we advance the system by some small time
step At, recalculate the forces and velocities, and then
repeat the process iteratively
Provided At is small enough, this produces an acceptable
approximate solution to continuous motion
Leach 7.3
Copyright 2001 University of Cambridge. Not to be quoted or copied without permission.
5.5 Example of integrator for MD simulation
One of the most popular and widely used integrators is
the Verlet method: the new positions of particles are
calculated using positions and accelerations (calculated
from force field) at current time step and old positions:



The Verlet scheme has the advantage of high precision (of
order At
4
), which means that a longer time step can be
used for a given level of fluctuations
The method also enjoys very low drift, provided an
appropriate time step and force cut-off are used
( )
( )
2 3
2 3
1
( ) ( ) ( ) ( )
2
1
( ) ( ) ( ) ( )
2
t t t t t t t O t
t t t t t t t O t
+ A = + A + A + A
A = A + A A
r r v a
r r v a
Course C1 Lecture 5
5
Copyright 2001 University of Cambridge. Not to be quoted or copied without permission.
5.6.1 Other integrators for MD simulations
Although the Verlet method is not particularly fast, this is
relatively unimportant because the time required for
integration is usually small in comparison to the time
required for the force field calculations
The most important concern for an integrator is that it
exhibits low drift, i.e. that the total energy fluctuates
about some constant value. A necessary (but not
sufficient) condition for this is that it is symplectic
Crudely speaking, this means that it should be time
reversible (like Newtons equations), i.e. if we reverse the
momenta of all particles at a given instant, the system
should trace back along its previous trajectory
Frenkel A.3.2
Copyright 2001 University of Cambridge. Not to be quoted or copied without permission.
5.6.2 Other integrators for MD simulations
The Verlet method is symplectic, but methods such as
predictor-corrector schemes are not
Non-symplectic methods generally have problems with
long term energy conservation.
Having achieved low drift, would also like the energy
fluctuations for a given time step to be as low as possible.
Always desirable to use the largest time step possible.
In general, the trajectories produced by integration will
diverge exponentially from their true continuous paths due
to the Lyapunov instability
Although disastrous for deterministic prediction, this does
not affect calculation of mechanical quantities
Frenkel 4.3.4
Course C1 Lecture 5
6
Copyright 2001 University of Cambridge. Not to be quoted or copied without permission.
5.7 Choosing the correct time step
The choice of time step is crucial: too short and phase
space is sampled inefficiently, too long and the energy will
fluctuate wildly and the simulation may become
catastrophically unstable (blow up)
The instabilities are caused by the motion of atoms being
extrapolated into regions where the potential energy is
prohibitively high (e.g. atoms overlapping)
A good rule of thumb is that when simulating an atomic
fluid, the time step should be similar to mean time
between collisions (about 5 fs, or 510
15
s) for Ar at 298K)
For flexible molecules, the time step should be an order of
magnitude less than the period of the fastest motion
(usually bond stretching: CH around 10 fs so use 1 fs)
Copyright 2001 University of Cambridge. Not to be quoted or copied without permission.
5.8.1 JAVA-based MD simulation: DEMOCRITUS
Toy molecular dynamics engine produced at Daresbury
Laboratory using JAVA
Based on continuous MD of Lennard-Jones particles
(see lecture 1 for definition of potential energy function)
DEMOCRITUS.html

Installed on PCs in IA Class Lab, and available for
download from Teaching Page try it out for yourselves!
In particular, run through some of the structured
experiments and make sure you understand the theory
behind them [question sheet]
Course C1 Lecture 5
7
Copyright 2001 University of Cambridge. Not to be quoted or copied without permission.
5.8.2 Radial distribution function
In a monatomic fluid, the RDF is simply the probability
density of finding a particle i at some distance from another
particle j.



In a periodic system with cell volume V, the RDF is usually
normalised, so that the probability density of a random fluid
(i.e. one with no spatial correlations) is unity.
( )

=
=
N
j i
j i ij
r r G r r ) (
dr r
r G
N
V
r g
ij
ij
2
4
) (
) ( =
Copyright 2001 University of Cambridge. Not to be quoted or copied without permission.
5.8.3 Velocity autocorrelation function
By analogy with the spatial autocorrelation function, we
can write the VACF as:



This is a measure of how correlations in the velocities of
particles in the simulation decay as a function of time
It can provide useful information on the absorbance
spectrum of a material, because each relaxation time
corresponds to absorption mode of a particular frequency

= =
+
M
j
N
i
j i j i
t t t
MN
t C
1 1
) ( ) (
1
) ( v v
Course C1 Lecture 5
8
Copyright 2001 University of Cambridge. Not to be quoted or copied without permission.
5.8.4 Transport properties
These relate to the flow of material from one region to
another. Usually, there is some sort of equilibrium being
established, be it thermal or diffusive.
The idea is to solve Ficks first law, which relates the flux
to the activity gradient:



where D is the diffusion coefficient.
Many important industrial problems concern the
diffusion of solvents through materials, or the joining of
two different materials by their inter-diffusion
z
A
D J
z
c
c
=
Copyright 2001 University of Cambridge. Not to be quoted or copied without permission.
5.8.5 Diffusion coefficients
Diffusion in equilibrium is related to the mean-squared
displacement of particles by the Einstein relation.





Usually, the diffusion coefficient is calculated from the
gradient of the mean-squared displacement as a function
of time
Beware, though, as this only applies in the limit of long
time (i.e. once system has reached steady state)


=

t
r t r
D
t
6
) 0 ( ) (
lim
2
Course C1 Lecture 5
9
Copyright 2001 University of Cambridge. Not to be quoted or copied without permission.
5.9.1 MD at constant temperature
As mentioned earlier, MD naturally generates states with
constant energy (microcanonical ensemble)
Although the temperature is related to time average of the
kinetic energy, it cannot easily be set to any desired value


No interesting system is thermally isolated!
There are several methods by which temperature control
can be achieved, some of which generate rigorous states
from canonical ensemble (Part III M16)
Here, we describe two non-rigorous methods
2
B
1
1 3
. .
2 2
N
i i
i
K E mv Nk T
=
= =

Copyright 2001 University of Cambridge. Not to be quoted or copied without permission.


5.9.2 MD at constant temperature
Velocity-scaling algorithm (Woodcock, 1971)
An obvious way to control temperature is to simply scale
the particle velocities towards desired temperature




Hence, multiplying all particle velocities by a scalar factor
at each time step, where T
new
is set to the required
constant temperature, will eventually produce states with
the desired value of temperature
( )
( )
2
2
2
1 1
B B
new
1 2 1 2
1 ( )
2 3 2 3
/ ( )
N N
i i
i i
i i
m v
mv
T T t
Nk Nk
T T t
= =

A = =
=

Course C1 Lecture 5
10
Copyright 2001 University of Cambridge. Not to be quoted or copied without permission.
5.9.3 MD at constant temperature
Berendsen method for coupling to external heat bath
Relies on coupling system to an external heat reservoir,
which is at constant temperature, T
bath
, and can exchange
energy with system until equilibrium is reached
Velocities are rescaled at each step such that change of
temperature is proportion to difference in instantaneous
temperature T(t) and T
bath
( ) ( )
bath bath
2 bath
d ( ) 1
( ) ( )
d
1 1
( )
T t t
T T t T T T t
t
T t
T t
A
= A =
t t
| | A
= +
|
t
\ .
Copyright 2001 University of Cambridge. Not to be quoted or copied without permission.
5.9.4 MD at constant temperature
The parameter controls the relaxation time of the
Berendsen thermostat: when = t then it reduces to
simple velocity scaling (as in 3.9.2)
For a time step of 1 fs (10
15
s), a value of = 0.4 ps
(4 10
13
s) gives t/ = 0.0025, which results in a slow
enough relaxation to produce a stable equilibrium
temperature within a few tens of ps
If is too short, then temperature will fluctuate wildly
If is too long, then simulation will take a long time to
reach equilibrium
Analogous to a critically damped mechanical oscillator

Course C1 Lecture 5
11
Copyright 2001 University of Cambridge. Not to be quoted or copied without permission.
5.9.5 MD at constant temperature
There are some problems with the relatively simple
methods for temperature control as presented
First, they give rise to fictitious forces on atoms, which
acts to redistribute the energy in a rather unphysical way
As a result, larger simulations are required to generate
accurate averages for mechanical quantities
Second, they artificially prolong temperature differences
among different components of system (say, solvent and
solute) even though average temperature is correct
Better methods are based on stochastic collisions or
extended systems discussed in Part III M16
Copyright 2001 University of Cambridge. Not to be quoted or copied without permission.
5.10.1 Tricks of the trade
Although we have outlined the bare bones of an MD
algorithm, there are number of tricks which are required
to transform this into an efficient computer program
These all centre around reducing the effort involved in
the calculation of the interatomic forces, as this is
generally much more time-consuming than integration
Bear in mind that long-ranged force interactions (e.g.
charge-charge, charge-dipole) in 3D scale with the cube
of the number of particles!
Even at shorter ranges (e.g. vdW, dipole-dipole), there
are procedures for minimising the computational effort
required
Course C1 Lecture 5
12
Copyright 2001 University of Cambridge. Not to be quoted or copied without permission.
5.10.2 Tricks of the trade
Look-up tables
Direct evaluation of potential and force expressions can be avoided by
storing the results in a table and using interpolation during the
simulation
Truncated and shifted potentials
Long range potentials (electrostatic) and also vdW interactions are
often truncated at a finite cut-off distance
Also shifted so that the potential is zero at the cut-off, thus avoiding a
discontinuity which can give rise to poor energy conservation
Truncations with periodic boundaries introduce the need for a long-
range correction term
Ewald sum
A much smarter way of calculating Coulomb sum, scales as N ln N
rather than N
3
Leach 6.8.1
Copyright 2001 University of Cambridge. Not to be quoted or copied without permission.
Summary
In this lecture we introduced the molecular dynamics
method and discussed its early history
We mentioned the differences between MD and MC,
in particular that MD is a deterministic simulation
method whereas MC is probabilistic
The choice of an appropriate integration scheme for
the equations of motion was discussed, together with
some practical guidelines for choosing simulation
parameters such as the time step
In the next lecture, we will study fast ion conduction
in fluorite structures using MD
Course C1 Lecture 6
1
Dr James Elliott
with acknowledgement to
Dr David J Cooke (Huddersfield)
Case study for Molecular Dynamics:
Fast Ionic Conductors
Covering material for
Computing Class on fast ion
conduction in CaF
2
Part II Materials Science Course C1
Copyright 2002 University of Cambridge. Not to be quoted or copied without permission.
6.1 Overview
This lecture provides an introduction to a class of
materials known as fast ionic (or superionic) conductors
There will be a separate script to guide you through the
details (this will be explained during the class)
The objective is to explore the properties of such
materials and characterise their behaviour and in doing
so see how the molecular dynamics method can be
used to study ionic solids at an atomistic level

Course C1 Lecture 6
2
Copyright 2002 University of Cambridge. Not to be quoted or copied without permission.
6.2 Background to fast ion conductors
Many inorganic materials conduct ions in the solid state
This occurs because one or more of the ions is capable of
diffusing rapidly through the system while it remains solid
An example of such a material is fluorite (CaF
2
)
Fluorite is a crystalline solid (cubic F, with fluoride ions in
tetrahedral interstices) with a melting point, T
m
= 1633 K
However, at elevated temperatures, the structure shows
an increasing degree of disorder
It is the nature of this disorder that we are going to
investigate and characterise

Copyright 2002 University of Cambridge. Not to be quoted or copied without permission.
6.3 Structure of fluorite CaF
2

To build an atomistic model we
need 3 pieces of information:

1) The dimensions of the unit cell
2) Position and types of ions
3) A space group
(description of the symmetry of the
ions in the unit cell)
For CaF
2
a = b = c = 5.46
Space Group = Fm-3m (225)
Motif:
Ca
2+
0.0 0.0 0.0
F
-
0.25 0.25 0.25
Course C1 Lecture 6
3
Copyright 2002 University of Cambridge. Not to be quoted or copied without permission.
6.4 Simple analytical model for F

diffusion
Based on hopping of ions through a sinusoidally varying
energy landscape, driven by uniform electric field
B
exp( / ) N Q k T = v
| |
B B B
exp( / ) exp( / 2 ) exp( / 2 ) f f f Q k T qdE k T qdE k T
+
= + = v
B B
2
B B
B
2 exp( / )sinh( / 2 )
exp( / ) if
D
V d Q k T qdE k T
d qE
Q k T qdE k T
k T
= v
v
=
Copyright 2002 University of Cambridge. Not to be quoted or copied without permission.
6.5 Potential interaction model for fluorite
We use parameterised functions to
describe the energy of a system as a
function of atoms positions.
V(r
ij
) =
q
i
q
j

r
ij

+ |(r
ij
)
Potentials are fitted to experimental properties
or using ab initio calculations
Published well-tested models of CaF
2
already exist.
We will be using rigid-ion model J. Phys: Condens. Matt. 1:1205-1212 (1989)

Long range interactions
Coulombic energy
Short range interactions
e.g. Buckingham Potential
|(r) = A.exp(-r / ) C / r
6

Course C1 Lecture 6
4
Copyright 2002 University of Cambridge. Not to be quoted or copied without permission.
6.6.1 Calculation of defect energies
Since ionic diffusion is controlled by concentration of defect sites,
the relative energetics of different types of defect is important
Schottky Defect Energy Required to remove one formula unit
Na
x
Na
+ Cl
X
Cl
V

Na
+ V
.
Cl
+ NaCl


E
shot
= E
Navaca
+ E
Clvaca
+E
NaCl
Frenkel Defect Energy required to create an isolated vacancy and interstitial
Na
X
Na
Na
.
i

+ V

Na

Cl
X
Cl
Cl

i
+ V
.
Cl

E
frenk
= E
vaca
+ E
inte
Copyright 2002 University of Cambridge. Not to be quoted or copied without permission.
6.6.2 Calculation of defect energies
Need to perform 5 energy minimisation calculations
Pure CaF
2
(cell contains 4 CaF
2
)
Ca Vacancy
-85.92 eV





F Vacancy
-102.36eV
Ca Interstitial
-121.76eV
F Interstitial
-109.10eV
And four defective CaF
2
cells
E
latt
=
107.36eV

Course C1 Lecture 6
5
Copyright 2002 University of Cambridge. Not to be quoted or copied without permission.
6.7 Checking for effects of finite model size
0.00
1.00
2.00
3.00
4.00
5.00
0 1 2 3 4 5
Cell Dimension / Lattice Cells
D
e
f
e
c
t

e
n
e
r
g
y

/

e
V
/
d
e
f
e
c
t
CATION FRENKEL
ANION FRENKEL
SHOTTKY
The Schottky and Frenkel energies are defined relative to isolated defects
But in the 1x1x1 calculations, the concentration of defects is far higher
The high charge relative to size of cell also causes problems
Results suggest Schottky is slightly favoured over anion Frenkel
Anion Frenkel is now the
most stable intrinsic defect
Suggest anions will move
through system via
interstitial sites
For anion Frenkel and
Schottky a 2x2x2 supercell
is sufficient to achieve
convergence
Copyright 2002 University of Cambridge. Not to be quoted or copied without permission.
6.8 Molecular Dynamics
Whilst static Energy Minimisation can tell us a lot about our
system and the behaviour of defects within them the fact that
there is NO temperature included in them and the fact that we
have no way of considering the atomic motions directly severely
limits what can be done.
MD provide a simple way of studying such phenomena directly.
This will be the topic of the remainder of the lecture.
Many Properties cannot be explained by a static model
Thermal Properties (Heat Capacity), Thermal Expansion,
Phase Transitions (melting), Transport Properties (Diffusion)
Course C1 Lecture 6
6
Copyright 2002 University of Cambridge. Not to be quoted or copied without permission.
6.9 Size Effects and Convergence Testing
To ensure periodic images do not interact, MD codes require the use of a short-
range cut-off for forces, set to at least half the dimensions of the unit cell
We therefore need a cut-off which ensures our results are accurate but
small enough that our system size isnt too large
Size Energy / KJ/mol a / A volume / A3 time / s
1 -10410 5.44 160.89 22
2 -10313 5.52 168.43 306
3 -10312 5.52 168.41 2423
4 -10311 5.52 168.55 11225
5 -10312 5.52 168.37 41144
This system converges rapidly: experience shows that in general as cut-off of
8 10 is required which therefore requires a cell 16 20

This is only a rule of thumb and convergence test should always be performed
when working with a new system
Copyright 2002 University of Cambridge. Not to be quoted or copied without permission.
6.10 Thermal expansion
5.5
5.7
5.9
6.1
6.3
6.5
0 500 1000 1500 2000 2500 3000
Temperature / K
C
e
l
l

D
i
m
e
n
s
i
o
n

/

A
Cell Dimensions Increase
Linearly Solid Phase
Discontinuity Indicates
Phase Change
Region where fast ionic
conduction is likely
A good test of a model is how the cell dimensions respond to Temperature
Course C1 Lecture 6
7
Copyright 2002 University of Cambridge. Not to be quoted or copied without permission.
6.11.1 Radial distribution function: Ca-F at 300K
0
2.5
5
7.5
10
0 2 4 6 8
Distance / A
g
(
r
)
0
30
60
90
120
n
(
r
)
g(r) @ 300K n(r) @ 300K
Series of sharp peaks characteristic of a crystalline solid
1
st
Peak represents
Ca F Bonds
Average
bond length
2.37A Integral gives coordination number = 4
Copyright 2002 University of Cambridge. Not to be quoted or copied without permission.
0
2
4
6
8
10
0 1 2 3 4 5 6 7 8
Distance / A
g
(
r
)
g(r) @ 300K g(r) @ 1500K g(r) @ 2100K
At 1500K, we still
see multiple peaks
but they are
broader Indicating
ions are more
mobile
Above the melting
point we only see
the nearest
neighbour peak
Characteristic of a
liquid
6.11.2 RDFs: Ca-F as function of temperature
Course C1 Lecture 6
8
Copyright 2002 University of Cambridge. Not to be quoted or copied without permission.
6.12 Characterising Ionic Movement
Mean Square Displacement (MSD)
A means of determining the average motion of molecules in a liquid, gas or
solid. It is directly related to diffusion, which can be measured
experimentally, and is easily calculated in an MD simulation. It is, for this
reason, a very important link between modelling and the real world.
Velocity Autocorrelation Function (VACF)
Provides a means of investigating collision processes in molecular
systems. Like the mean square displacement, it can also provide
information about diffusion. It is capable of distinguishing between
solids, liquids and gases from their molecular motion and it reveals the
timescales on which molecular collisions occur.
For more information look at DEMOCRITUS on your PC
Copyright 2002 University of Cambridge. Not to be quoted or copied without permission.
0
5
10
15
20
25
30
35
40
45
0 2 4 6 8 10
Time / ps
M
S
D

/

A

1500
1600
1700
1800
1900
2000
0
5
10
15
20
25
30
35
40
45
0 2 4 6 8 10
Time / ps
M
S
D

/

A

1500
1600
1700
1800
1900
2000
0
5
10
15
20
25
30
35
40
45
0 2 4 6 8 10
Time / ps
M
S
D

/

A

1500
1600
1700
1800
1900
2000
6.13 Mean Square Displacement
Linear plots show F
-
ions are diffusing
Rate of diffusion increases with Temperature
Zero Gradient indicates Ca
2+
cations remain static
Course C1 Lecture 6
9
Copyright 2002 University of Cambridge. Not to be quoted or copied without permission.
6.14 Diffusion coefficient from MSDs
Recall from earlier lecture (5.8.5) the definition of diffusion
coefficient in terms of mean-squared displacement (MSD)



In practical terms, this means we can estimate the diffusion
coefficient from MSDs calculated from molecular dynamics
The overall ionic diffusivity arises from individual events,
including defect creation and annihilation, hopping of ions
between defect sites and interstitial motion
These processes are thermally activated (cf. slide 9.4) and we
can calculate averaged activation barrier also using MD
2
2
( ) (0)
lim ( ) (0) 6
6
t
t
r t r
D r t r Dt
t


= =
`

)
Copyright 2002 University of Cambridge. Not to be quoted or copied without permission.
6.15 Calculating activation energy: Arrhenius Plot
y = -99.412x - 12.679
R
2
= 0.982
-21
-20.5
-20
-19.5
-19
-18.5
0.05 0.06 0.07 0.08 0.09
1 / RT / mol/kJ
l
n

D
E
a
= 99 kJ mol
-1
~ 1eV
Large energy barrier, hence
diffusion only occurs at high
temperatures
T / K 1500 1600 1700 1800 1900 2000
D / m /s 1.07E-09 1.57E-09 3.19E-09 4.12E-09 6.13E-09 7.12E-09
From the gradient of the MSD vs. time plots we can calculate the diffusion
coefficient of the F
-
ions
T E A D a R ln ln = ( ) T E A D a R exp = or
How D varies with temperature is related the the activation energy:
Course C1 Lecture 6
10
Copyright 2002 University of Cambridge. Not to be quoted or copied without permission.
Summary
In this lecture, we considered what is required to build a
model (crystal structure, potential model, etc)
How static calculations can be used to study bulk defects
Finite size effects on static and dynamic systems
The effect of heating on structure of a crystal, and how
this relates to RDF
Ways of studying the motion of particles in a system
(MSD)
How to calculate diffusion coefficients from MSD and use
them to calculate the activation energy for ionic diffusion
We will explore these ideas further in the computing class

C1 Computing Class 1

C1 : Introduction to Materials Modelling : Computing Class

Fast ion conduction in the fluorite lattice

1. Aims and Objectives

The aim of this class is to introduce the methods of molecular mechanics and molecular
dynamics for atomistic simulation. We will look at how to build a simple model of a periodic
ionic solid (calcium fluoride, CaF
2
) using a package called METADISE, and use this to
calculate some defect energies. The structural model will then be used to carry out molecular
dynamics (MD) simulations using a package called DL_POLY, developed at Daresbury
Laboratory. A detailed manual for DL_POLY is contained on the Daresbury Laboratory
website http://www.cse.scitech.ac.uk/ccg/software/DL_POLY/ and is essential
reading for those intending to use the package seriously. However, for the current class, we
will mainly be using METADISE to set up simulations and analysing limited amounts of
output obtained from MD simulations using a package called VMD. Some sample data from
larger calculations will be provided to enable a more quantitative analysis.

By the end of this class you will be able to:

1. Generate the unit cell of a crystal structure given its cell dimensions, space group
and atomic coordinates.
2. Appreciate what is required to define the potential interaction between ions.
3. Use METADISE to generate DL POLY input files for crystalline system.
4. Calculate an activation energy for the fluoride diffusion in CaF
2
.
5. If time, work with the various DL POLY output files and use VMD to generate
animations of the simulation.

2. Molecular mechanics calculations using METADISE

2.1. Generating structural input files for METADISE

To define the structure of a three-dimensional crystalline solid requires the input of three
main sets of information: the unit cell, the fractional coordinates and types of the atoms, and
finally the space group symmetry.
















Double click on the new text file you have just created, and add a Ca
2+
ion at fractional
coordinate (0,0,0) and a F

ion at fractional coordinate (0.25,0.25,0.25) by typing the


following

fractional
Ca 0.0 0.0 0.0
F 0.25 0.25 0.25
ends
Start by logging into one of the Windows PCs, and open the Network Drive labeled I:
(this is the fileserver and saving any files you create here means they will be available in
future on any of the PCs in the Class network). Create a new folder called
C1ComputingClass. Double-click to enter the folder and create a new text file called
caf2.txt by choosing File > New > Text Document from the menu.
C1 Computing Class 2

























You might want to check with a demonstrator that you have set up the input file correctly.















The program will only take a second or so to run and will produce several output files. The
code*.out file is the main output file from METADISE and sum*.out is a summary of this
file. Both can be opened in text editors WordPad or Notepad. The remaining files display the
crystal structure in formats that can be read by various visualization packages and by
METADISE itself (in the case of the .res files). The .xyz .car and .cif are all in a format
that can be read by VIEWER-LITE.





Next add the information about the unit cell. CaF
2
is cubic and has a cell parameter of
5.464 . This information goes above the fractional key word. Finally we need to add
information about the space group, Fm-3m in this case (you may already know about
space groups from course C6, but if not then please accept this for now). Once you have
done this, the input file should like:

cell 5.464 5.464 5.464 90.0 90.0 90.0 Values of a, b, c, , , for CaF
2
unit cell
space full fm-3m 225 FM-3M is space group of lattice
Other commands tell program not to simplify
cell using symmetry, and 225 is reference
fractional number for FM-3M
Ca 0.0 0.0 0.0
F 0.25 0.25 0.25
ends
Finally, we need to add some keywords to tell the program what type of calculation we
want to do and to define the force field we want to use. At this stage we only want to
generate the crystal structure, so all you need to add to the bottom of your file is:

Nopotential No force field (or potential parameters) will be defined
Check Just read in the input we give it then write it back out again
Start We have finished giving input to the program so it can do any
calculation we have asked for
Stop Gives us control of the computer back when the calculation has finished
Save the file, and rename it CaF2.met (hint: remember to disable Hide extensions for know files)

If you set up your working directory as instructed then you can use the following batch
file to launch your METADISE job. Make a new text file called RunMetadise.bat and
add the following lines of text

cd i:\C1ComputingClass
i:
copy %1 input.txt
c:\"Program Files"\C1class\meta516.exe

Having saved this file, you can now drag-and-drop the CaF2.met file onto it to launch it.
You may need to click Refresh (or press F5) to see the list of output files.




Launch VIEWER-LITE using Shortcut on Desktop, and display the CaF
2
crystal you have
just created by opening the af*.car file. If you are not sure what the structure should
look like, ask a demonstrator to check your results. You can manipulate the model (rotate,
zoom) by using the mouse and menu options.
C1 Computing Class 3
2.2 Choosing a potential model

Being able to generate a structural model of our crystal is only the first step of the calculation.
We also need to choose a suitable potential model to describe the interactions in our system
and calculate key properties such as energies, elastic constants and electrostatic constants. We
are now going to select the potential parameters required to model CaF
2
. At this point you
might want to refer back to the briefing notes on force fields and potential models if you are
unclear about any terms used below.



























Once METADISE has completed open the code*.out file and scroll to the bottom of the file.
If the calculation was successful you will find the phrase valid minimization to constant
pressure a few screens up from the bottom. Try searching for text string valid to find it.

Below this you will find the lattice vectors of the relaxed system, the lattice energy and
various bulk properties. These serve as a useful check on how well our chosen model
reproduces the true behaviour of the system we are studying. Make a note of the lattice
energy listed below that phrase: you will need this presently. The fin*.res file contains the
coordinates of the relaxed system in METADISE input file format, useful as the starting point
for additional calculations. Of course, you can also view the relaxed structure in VIEWER-
LITE. The af*.car file contains the structure after minimization and the bf*.car the initial
structure we defined in the input file. Compare the two to see if there has been an appreciable
change in the structure.
Open the input file you used to create the fluorite structure above and change the keyword
nopotential to potential and on the next line add the word ends. The details of the
potential model will go between these two lines. First add the long-range Columbic
interactions. This simply requires details of the atomic species in the cell and their charge.
The keyword Buckingham is used to indicate how the short-range interactions will be
defined. In our model we will assume the CaCa interaction is totally Columbic (a
common assumption in these models) so we only need to add details of the CaF and
FF interactions. Once you have done this, the potential section of your input file should
look like this:

potential keyword to indicate the potential model will follow
species keyword to indicate a list of ionic species and charges will follow
Ca 2.0 Ca
2+

F -1.0 F


ends The end of the list of ionic species
Buckingham keyword to indicate a list of potential parameters will follow
Ca F 797.42 0.3179 0.0 0.0 20.0 Potential parameters for Ca-F interaction
F F 1127.7 0.2753 15.83 0.0 20.0 Potential parameters for F-F interaction
ends The end of the list of potential parameters
ends The end of the potential model definition

Once you have added these parameters to your potential model, the final step is change
the check keyword so it reads conp to request that METADISE performs an energy
minimization calculation to constant pressure. Now, save your file as caf2_pot.met and
run METADISE by same method as in section 2.1.
C1 Computing Class 4

3.0 Molecular dynamics of ion conduction

3.1 Generating input files for DL_POLY










We also need to make a few more modifications to the file. One requirement of DL_POLY is
that the size of the simulation cell must be at least twice the potential cut-off range (i.e. the
point at which the program considers the particles no longer interact). Experience has shown
that in order for the electrostatics to converge adequately the cut-off needs to be about 10 .
Thus we must grow the cell so all the lattice dimensions are approximately 20 .


Open the CaF
2
structure caf2_pot.met that you generated in section 2.2 in WordPad and
add the following line to the top of the file:

print dlpoly 1

This indicates that we require DL_POLY input files to be generated when we run
METADISE.

The CaF
2
unit cell is cubic and has a cell dimension of 5.464 . So in order to fulfill the
cut-off criterion described above we will need to scale the unit cell so it is four times
larger in each linear dimension (i.e. 64 times in volume) The METADISE keyword for
this is grow 4 4 4, and this command is added immediately above the start command.

Finally, before running METADISE, change the keyword conp back to check. This will
save time as we dont need to minimize the cell's geometry, since we will be using
DL_POLY to do this. Save the amended file as caf2_4x4x4.met and submit it to
METADISE.

Once the program has run you should get the same output files as we generated in section
2, but in addition you should have three files with the suffix *.dlp.
C1 Computing Class 5











































The DL_POLY jobs will take around 10 minutes to run if you find that yours is terminating
immediately, or lasting for significantly longer than 10 minutes, please inform a
demonstrator. Once the job has finished, you should find a number of new output files in the
working directory: HISTORY, OUTPUT, RDFDAT, REVCON, REVIVE and STATIS.





Open the file CONFIG*.dlp in WordPad. This file contains information about the systems
configuration and is equivalent to the LATTICE and BASIS section of a METADISE
input file. Close the file and rename it CONFIG (all capitals with no suffix ignore any
warnings about changing suffix type).

Now open the file FIELD*.dlp. This contains information about the force field and is
analogous to the potential section of a METADISE file. Hence, the order in which the
atoms appear is important, and must be exactly the same order as in the CONFIG file.
Because we are only using a simple pair-wise potential model the FIELD file is quite
simple, however this is not always the case. Close the file and rename it FIELD (again, all
capitals with no suffix ignore any warnings about changing suffix type).

Open the remaining file, CONTROL*.dlp. This file, as its name suggests, contains all the
control variables for the simulation, i.e. it tells the program what to do. METADISE
generates a template file with some standard values for a typical simulation; however for
the simulation we are going to perform we will need to change a few of these values.

1. Check that the time step is set at 0.001 ps (1 fs)
2. Change the number of steps to 10000
3. Select an npt constant pressure ensemble by placing # in front of the line
ensemble nve and removing the # from in front of the line below and changing
the keyword nst to npt. The # is the comment character and means that the
program will not read the remainder of the line. Running the NPT ensemble
enables the size of the simulation cell to change during the MD run.
4. Change the values nstraj= 1 istraj= 250 to nstraj= 0 istraj= 100. This
changes how often the program writes out to the HISTORY file (more on this later)
5. Select a temperature to run: since we investigating ion mobility as a function of
temperature, each pair of students has been assigned a different temperature. This
is written by hand on the front of you script. Replace the 300 K in CONTROL file
by your designated value

Once you have made these changes save the file as CONTROL. (again, all capitals with no
suffix ignore any warnings about changing suffix type).

To run DL POLY, create a batch file called RunDL_POLY.bat with following text:

cd i:\C1ComputingClass
i:
c:\"Program Files"\C1class\dlpoly213.exe

Then, save this file to the same directory as your FIELD, CONFIG and CONTROL files, and
double-click the batch file to launch (no need to drag-and-drop files).
Open the OUTPUT file in WordPad or Note Pad and search for the word Diffusion. Under
this line, you should find your diffusion coefficients calculated for Ca and F ions. What
do you notice about their magnitude? Report the magnitude of the F diffusion coefficient
to a demonstrator, so that results for the class can be collated.
C1 Computing Class 6

3.2 Arrhenius plot for ionic diffusion in CaF
2


By simulating the CaF
2
structure at a range of different temperatures, the change in rate of
ionic diffusion (as measured by the diffusion coefficient) as a function of temperature can be
used to determine the thermal activation barrier for the ionic transport. This value can be
compared directly with the Schottky defect formation energy presented in lectures, to shed
some light on the mechanisms of diffusion at finite temperature.














3.3 Structural analysis and visualization using VMD

In order to look in more detail at structural mechanisms of ionic diffusion in CaF
2
, it is
necessary to visualize the trajectories directly using a package called VMD (Visual Molecular
Dynamics). As well as visualization, VMD can also calculate radial distribution functions to
enable a more quantitative structural analysis. A shortcut to launch this program can be
found on your Desktop.









VMD can build various visual representations of your model, which are accessed from the
Graphics menu of the main window. You can rotate and zoom in/out on these using mouse.












Using either class data, or sample data provided by demonstrator, produce an Arrhenius
plot of ln(D) versus 1/T, as shown in the lecture notes on slide 6.15. The formula for the
Arrhenius relationship is:

T E A D a R exp or T E A D a R ln ln

where R = 8.314 J K
1
mol
1
and A is some constant. Use this to determine a value for the
activation energy E
a
for F diffusion in CaF
2
. How does this value compare with the
Schottky defect formation energy determined in lectures? (slide 6.7). What does this
suggest about the structural mechanism of F diffusion in CaF
2
?
Launch VMD from the shortcut. After a few seconds, you should see three windows
appear, the top-most being the VMD Main window. From the File menu of the main
window, select New Molecule and Browse to the directory in which you carried out
your DL_POLY simulation in 3.2 above. Then, select HISTORY file and change the setting
of Determine file type drop-down menu to DLPOLY V2 History. Now, select Load
and VMD will load in the frames of your simulation. If you dont see anything appear in
the VMD Display window, please ask a demonstrator for help.
Select Representations from the Graphics menu to bring up the Graphical
Representations control panel. Change the Drawing Method to VDW and you should
be able to see the Ca (blue) and F (green) ions clearly. Increase Sphere Resolution to
around 20 to get better definition of the spheres. Now, change text in Selected Atoms
box from all to name CA. You should now just see the Ca ions. What do you notice about
their arrangement? Now, change Material to Transparent, and then click on Create
Rep button near top left-hand corner of Graphical Representations box. This will create
a new representation, which is initially identical to the first. Change text in Selected
Atoms box in new representation from name CA to name F, and change Material back to
Opaque You should now just see both the Ca and F ions, but Ca will be transparent.
What differences can you see between the arrangements of Ca and F ions?
C1 Computing Class 7

You can step through the frames in your simulation by returning to the VMD Main window
and clicking on the advance single frame button.


You can also animate the frames by pressing play button, and adjust the speed from the
slider. Although your simulations will only have a small number of frames, some evidence of
F motion should be seen at the higher temperatures. However, simulations at 300 K should
show very different behaviour. A demonstrator will be able to show you a longer movie with
a larger number of frames, for comparison.

3.3.1 Calculating RDFs with VMD

To show quantitatively the different degrees of structural order in Ca and F sub-lattices, the
radial distribution function can be used. To access this from VMD, go to the Extensions
menu from the main window, and from the Analysis sub-menu, select Radial Pair
Distribution Function g(r). This should bring up the following window:









Change the text in Selection 1 and Selection 2 boxes to name CA, as above, and then
click on Compute g(r) button. Then, repeat this with Selection 1 and Selection 2
boxes containing name F. This will generate the Ca and F pair radial distribution functions.
What do you notice about their form? Can you use these to make a qualitative statement
about the relative degree of ordering in the Ca and F sub-lattices?

If you have time, you can plot the CaF RDFs as well, by entering Selection 1 as name
CA and Selection 2 as name F, respectively. How do these compare with versions in
briefing notes. If you have time outside class, you can make a series of plots of g(r) at
different temperatures to see the effect of temperature on the ionic ordering.
Part II Materials Science and Metallurgy C1 Introduction to Materials Modelling



1. (a) Explain what is meant by a multiscale computer model, and give an example of a
problem in materials science where it could be advantageous to use this type of model.
What is the main technical difficulty in its implementation?

(b) Outline why quantitative modelling of materials production and processing may be of
interest to industry, despite the cost of developing the model.

2. The Lennard-Jones 12-6 potential takes the following form:



12 6
( ) 4 V r
r r
(
o o | | | |
= c
(
| |
\ . \ .
(



where r is the distance between 2 atoms, o is the distance to the zero in V(r) and c is the
energy minimum in V(r). Typical values of o and c, appropriate for Ar, are o = 0.34 nm and
c = 0.01 eV. In a simulation program, however, it is conventional to work in reduced, or
dimensionless, quantities. In reduced form, the potential becomes:



12 6
1 1
*( *) 4
* *
V r
r r
(
| | | |
=
(
| |
\ . \ .
(


where V* = V/c and r* = r/o .

(a) Show that, using the definitions of Lennard-Jones potential parameters o and c, the units
of reduced temperature and number density are T* = k
B
T/c and * = No
3
/V,
respectively, where N is the number of atoms in the simulation cell, V is the cell volume
and k
B
is Boltzmann's constant.

Below is the simulated T*-* phase diagram for Ar obtained using this potential and
molecular dynamics:


Regions 1, 3 and 5 correspond to the solid, liquid and gaseous states of Ar.
Part II Materials Science and Metallurgy C1 Introduction to Materials Modelling



(b) How are the critical points (T*, *) = (1.33, 0.35) and (T*, *) = (0.70, 0.83) commonly
referred to, and what are the actual values of T and at these points in K and Mg m
-3
.

(c) Calculate the reduced number density * of a hard-sphere model of solid fcc Ar.


3. Using the JAVA applet DEMOCRITUS, downloadable from URL below, plot the pressure-
density relationship for the Lennard-Jones system (as described in question 1) at T = 500.

www.msm.cam.ac.uk/teaching/camonly/DEMOCRITUS.zip

Contrast the behaviour observed at low densities (0.1 to 0.25) with that at higher densities
(above 0.25), and explain any differences by referring to the form of LJ potential.


4. The viscosity of a glass-forming ionic liquid above its glass transition temperature (T
g
) is
studied using atomistic molecular dynamics simulations at constant temperature. Describe a
method for achieving temperature control in molecular dynamics based on velocity scaling,
and comment briefly on its advantages and disadvantages.

The viscosity calculated from molecular dynamics simulations at a range of temperatures is
tabulated below. Using the _
2
test for goodness of fit, demonstrate that the data are well-
described by an Arrhenius law of the form:

0
exp
A
T
q | |
=
|
q
\ .


where q
0
is the viscosity at some reference temperature.


g
/ T T

( )
0
ln / q q

0.600 0.350
0.500 0.450
0.400 0.602
0.300 0.705
0.200 0.982
0.100 1.121


[hint: the reduced _
2
statistic is given by

( )
( )
2
2
R 2
1
1
1
n
i i
i
i
F D
n p
=

_ =
o

, where F
i
are the
predictions from model with number of parameters p, and D
i
are the n data with standard
errors o
i
. You may assume the standard errors in values of q/q
0
are fixed at 0.03]




Part II Materials Science and Metallurgy C1 Introduction to Materials Modelling



5. Show that if a needle of length l is thrown down in a random orientation onto a set of thin
parallel lines spaced equally by distance l, then the probability of it intersecting a line is
given by 2 / t. Describe how this could be used experimentally to estimate numerically,
and estimate how many throws it would take to determine a value accurate to 5 d.p.

[hint: recall that the mean and variance of binomial distribution are np and np(1 p)]


6. Describe the microstructural characteristics of normal grain growth and contrast with
abnormal grain growth. Sketch the grain size distribution in each case. How do the
distributions vary with time? For a two-dimensional grain structure, explain how the
stability of a grain is related to the number of its sides.

Briefly describe how the Monte Carlo method can be used to simulate grain growth using
the Metropolis algorithm, and explain why it predicts the grain growth exponent more
accurately than classical kinetic theory.

Using the JAVA applet for simulating Monte Carlo grain growth at the URL below, test the
prediction of classical theory due to Zener that maximum grain size and time to stagnation
are inversely proportional to second phase particle concentration.

www.blikstein.com/paulo/projects/materialsim/models/materialsim_grain_growth.html

[hint: start by maximizing width and height sliders for simulation size to 501 atoms,
then set fraction-element2 slider to desired concentration, and initialize simulation with a
random starting point.

Then, run simulation until a plateau is observed in the grain size versus time graph. You
may need to run several different simulations using different initial conditions for each
second phase particle concentration, and average the results over many simulations. Use the
mouse pointer to read off the grain size and time values, or advance in single steps to obtain
data for tabulation in external program, e.g. Excel.

Use the _
2
test for goodness of fit to determine the confidence in your fit, taking into
account fluctuation errors estimated above.]

También podría gustarte