1.021 , 3.021, 10.333, 22.00 I ntroduc tion to Modeling and Simulation
Spring 2011
Part I – C ontinuum and partic le me thods
Property calculation II
Lecture 4
Markus J. Buehler
1
Laboratory for Atomistic and Molecular Mechanics Department of Civil and Environmental Engineering Massachusetts Institute of Technology
Content overview
I. Particle and continuum me thods
1. Atoms, molecul e s, chemistry
2. Continuum modeling approac hes and solution approaches
3. Statistical mechanics
4. Molecular dynamics, Monte Carlo
5. Visualization and data analysis
6. Mechanical proper ties – applic ation: how things fail (and how to prevent it)
7. Multi-scale modeling par adigm
8. Biological systems (simulation in biophysics) – h ow proteins work and how to model them
II. Quantum mechanical methods
1. It’s A Q uantum World: T he Theory of Quantum Mechanics
2. Quantum Mechanics: Practice Makes Perfect
3. The Many-Body Problem: Fr om Many-Body to Single- Particle
4. Quantum modeling of materials
5. From Atoms to Solids
6. Basic pr operties of mater i als
7. Advanced proper ties of materials
8. What else can we do?
Lectures 2-13
Lectures 14-26
Overview: Material covered so far…
Lecture 1: Broad introduction to IM/S
Lecture 2 : Introduction to atomistic and continuum modeling (multi-scale modeling paradigm, difference between continuum and atomistic approach, case study: diffusion)
Lecture 3 : Basic statistical mechanics – property calculation I (property calculation: microscopic states vs. macroscopic properties, ensembles, probability density and partition function)
Lecture 4 : Property calculation II (Advanced property calculation, introduction to chemical interactions, Monte Carlo methods)
Lecture 4: Property calculation II
Outline:
1. Advanced analysis methods: R adial distribution function (RDF)
2. Introduction: How to model chemical interactions
2.1 How to identify parameters in a Lennard-Jones potential
3. Monte-Carlo (MC) approach: Metropolis-Hastings algorithm
3.1 Application to integration
3.2 Metropolis-Hastings algorithm
Goal of today’s lecture:
- Learn how to analyze structure of a material based on atomistic simulation result (solid, liquid, gas, different crystal structure, etc.)
- Introduction to potential or force field ( Lennard-Jones )
- P resent details of MC algorithm – b ackground and
implementation 4
1. Advanced analysis methods: Radial distribution function (RDF)
Goals
Define algorithms that enable us to “make sense” of positions, velocities etc. and time histories to relate with experimentally measurable quantities
So far: temperature, MSD (mean square displacement function)
Here: extend towards other properties
MD modeling of crystals – s olid, liquid, gas phase
Crystals: Regular, ordered structure
The corresponding particle motions are small-amplitude vibrations about the lattice site, diffusive mo vements over a local region, and long free flights interrupted by a collis ion every now and then.
Liquids: Partic les follow Brownian motion (collis i ons)
Gas: Very long free paths
Image by MIT OpenCou r seWare. A f te r J. A. Barker and D. Hender s o n.
Atomistic trajectory – through MSD
Court e sy of Sid Yip. Us ed with per m iss i o n .
Need pos itions over time – what if not available? 8
How to characterize material state (solid, liquid, gas)
Application: Simulate phase transformation (melting)
9
© Trivedi Chemistry. All rights reserved. This content is excluded from our Creative Commons license. For more information, see http://ocw.mit.edu/fairuse .
http://ww w .t2i2edu.com/WebMov ie/1Chap1_files /image002.jpg
How to characterize material state (solid, liquid, gas)
Regular spacing
Neighboring particles found at characteristic distances
Irregular spacing
Neighboring particles found at approximate distances (smooth variation)
More irregular spacing
More random distances, less defined
© Trivedi Chemistry. All rights reserved. This content is excluded from our Creative Commons license. For more information, see http://ocw.mit.edu/fairuse .
10
How to characterize material state (solid, liquid, gas)
Regular spacing
Neighboring particles found at characteristic distances
Irregular spacing
Neighboring particles found at approximate distances (smooth variation)
More irregular spacing
More random distances, less defined
Concept:
© Trivedi Chemistry. All rights reserved. This content is excluded from our Creative Commons license. For more information, see http://ocw.mit.edu/fairuse .
Measure distance of particles to their neighbors
Average over large number of particles
11
Average over time (MD) or iterations (MC)
Formal approach: Radial distribution function (RDF)
Ratio of density of atoms at distance r (in control area dr ) by overall density = relative density of atoms as function of radius
Reference atom
g ( r )
r
( r ) /
dr
Formal approach: Radial distribution function (RDF)
Overall dens ity of atoms (volume)
g ( r ) ( r ) /
Local dens ity
The radial distribution function is defined as
Provides information about the density of atoms at a given radius r ; ( r ) is the local density of atoms
Formal approach: Radial distribution function (RDF)
The radial distribution function is defined as
Overall dens ity of atoms (volume)
g ( r ) ( r ) /
Local dens ity
Provides information about the density of atoms at a given radius r ; ( r ) is the local density of atoms
Discrete:
N um b er of atoms in the interv al r r
2
g ( r )
2
N ( r ) 1
r
2
Volume o f this shell ( dr )
( r r )
g ( r ) 2 r 2 dr
Number of particles that lie in a spherical shell 14
of radius r and thickness dr
Radial distribution function
( r
r
2
)
2
r considered volume
N ( r r )
2
g ( r ) 2
( r
r )
Density
N / V
Note: RDF can be measured experimentally using x-ray or 15
neutron-scattering techniques
Radial distribution function:
Which one is solid / liquid?
© s ourc e u n known. All right s res e rved. This con t en t is exclud ed from our C r eat i ve Co mmo ns lice n se . Fo r mo re i n fo rm a t io n, see http:/ /ocw. m it.edu/fai ruse .
Interpretation: A peak indicates a particularly
favored separation distance for the neighbors to a given particle Thus, RDF reveals details about the atomic structure of the system being simulated
Java applet:
http://physchem.ox.ac.uk/~rkt/lectures/liqsolns/liquids.html 16
Radial distribution function
solid
liquid
© s ourc e u n known. All right s res e rved. This con t en t is exclud ed from our C r eat i ve Co mmo ns lice n se . Fo r mo re i n fo rm a t io n, see http:/ /ocw. m it.edu/fai ruse .
Interpretation: A peak indicates a particularly
favored separation distance for the neighbors to a given particle Thus, RDF reveals details about the atomic structure of the system being simulated
Java applet:
http://physchem.ox.ac.uk/~rkt/lectures/liqsolns/liquids.html 17
Radial distribution function: JAVA applet
Java a p plet: http://physchem.ox.ac.uk/~rkt/lec tures/liqsolns/liquids.htm l
Ima g e removed for c o pyright rea s on s.
Screen sh ot of th e radi al di stri but ion function Ja va appl et.
18
g ( r )
g ( r )
Radial distribution function: Solid versus liquid versus gas
5
5
4
S o l i d A r g o n
4
Gaseous Ar (90 K)
3
3
Liquid Ar (90 K)
2
2
Gaseous Ar (300 K)
L i q u i d A r g o n
1
1
0 0
0 . 2
0 . 4
d i s t a n c e / n m
0 . 6
0 . 8
0 0
0 . 2
0 . 4
d i s t a n c e / n m
0 . 6
0 . 8
Image by MIT OpenCou r seWare.
Note: The first peak corresponds to the nearest neighbor shell, the second peak to the second nearest neighbor shell, etc.
In FCC: 12, 6, 24, and 12 in first four shells 19
Notes: Radial distribution function (RDF)
Pair correlation function (consider only pairs of atoms)
Provides structural information
Can provide information abou t dynamical change of structure, but not about transport properties (how fast atoms move)
Notes: Radial distribution function (RDF)
Pair correlation function (consider only pairs of atoms)
Provides structural information
Can provide information abou t dynamical change of structure, but not about transport properties (how fast atoms move)
Additional comments:
Describes how - on average - a toms in a system are radially packed around each other
Particularly effective way of describing the structure of disordered molecular systems (liquids)
In liquids there is continual movement of the atoms and a single snapshot of the system shows only the instantaneous disorder it is extremely useful to be able to deal with the average structure
Example RDFs for several materials
RDF and crystal structure
1 st nearest neighbor (NN)
3 rd NN 2 nd NN
…
Image by MIT OpenCou r seWare.
Peaks in RDF characterize NN distance, can infer from RDF about crystal structure
Face centered cubic (FCC), body centered cubic (BCC)
Image from Wi ki medi a Common s , h t t p : / / c om m o n s . w ik imed ia. o rg
Aluminum , NN: 2.863 Å ( a 0 =4.04 Å)
Copper , NN: 2.556 Å ( a 0 =3.615 Å) )
See also: http://www.webelements.com/
Chromium , N N :
2.498 Å ( a 0 =2.91 Å)
Iron , NN: 2.482 Å ( a 0 =2.86 Å) 24
Hexagonal closed packed (HCP)
a
a
a
c
Image by MIT OpenCou r seWare.
Image by MIT OpenCou r seWare.
Imag e court e sy of the U.S. Navy.
Cobalt
a : 250.71 pm
b : 250.71 pm
c : 406.95 pm
α : 90.000°
β : 90.000°
γ : 120.000°
NN: 2.506 Å
Zinc
a : 266.49 pm
b : 266.49 pm
c : 494.68 pm
α : 90.000°
β : 90.000°
γ : 120.000°
NN: 2.665 Å 25
Graphene/carbon nanotubes
RDF
Imag es removed du e t o copyrigh t restric t ion s. Pl e a se see : h t t p : //w eblog s 3. n r c. n l / t ech n o /w p- c o n t ent/up load s/08042 4_Grafeen/Graphen e_xyz.jpg ht tp:/ /dept s . w ashi ngt o n.edu/pol ylab/i m ages/cn1. j pg
Graphene/carbon nanotubes (rolled up graphene)
NN: 1.42 Å, second NN 2.46 Å … 26
RDF of water (H 2 O)
Court e sy of Mar k Tuckerma n. Used wi th permission. 28
http://ww w .nyu.edu/class es/tuckerman/stat.mech/l ectures/lecture_8/node1.html
RDF of water (H 2 O)
O-O distance
Imag es c o u r t e sy of Ma r k Tuckerman. Used wit h permis s i on.
H-O distance
29
http://ww w .nyu.edu/class es/tuckerman/stat.mech/l ectures/lecture_8/node1.html
RDF of water (H 2 O)
O-O distance
H- bonding ( ≈ 2.8 Å)
Imag es c o u r t e sy of Ma r k Tuckerman. Used wit h permis s i on.
H-O distance
H-O covalent bonding ( ≈ 1 Å)
30
http://ww w .nyu.edu/class es/tuckerman/stat.mech/l ectures/lecture_8/node1.html
2. Introduction: How to model chemical
interactions
31
Molecular dynamics: A “bold” idea
r i ( t 0
t )
r i ( t 0
t ) 2 r i ( t 0
) t
a i
( t 0
) t 2
...
a i
f i / m
Positions at t 0 - t
Positions at t 0
Accelerations at t 0
Forces between atoms… how to obtain? 32
33
Often: Assume pair-wise interaction between atoms
How are forces calculated?
Force magnitude: Derivative of potential energy with respect to atomic distance
f d U ( r )
d r
f
r
x 2
x 1
To obtain force vector f i , t ake projections into the three axial directions
f f
x
i
i
r
Atomic interactions – quantum perspective
How electrons from different atoms interact defines nature of chemical bond
Density distribution of electrons around a H-H molec u le
Ima g e rem o ved du e t o copyrigh t re str i c t ion s . Pleas e s e e t h e an ima t io n of hydrogen bon ding orb i t a ls at h t t p : //w in t e r. grou p. sh e f . ac. uk/ orb itron/MOs/H 2 /1s1s-sig m a/ind e x.html
34
Much more about it in part II
Concept: Interatomic potential
Ener gy U
r
1/r 12 (or Exponential)
Repulsion
Radius r (Distance between atoms)
e
Attraction
1/r 6
“point particle” representation
Image by MIT OpenCou r seWare.
Interatomic bond - model
Ener gy U
r
1/r 12 (or Exponential)
Repulsion
Radius r (Distance between atoms)
e
Attraction
1/r 6
r 0
Harmonic oscillator
~ k(r - r 0 ) 2
r
Image by MIT OpenCou r seWare. Image by MIT OpenCou r seWare.
Atomic interactions – different types of chemical bonds
Prima ry bonds (“strong”)
Ionic (ceramics, quartz, felds par - rocks )
Covalent ( silicon )
Metallic (copper, nickel, gold , silver) (high melting point, 1000-5,000K)
Secondary bonds (“weak”)
Van der Waals ( wax , low melting point)
Hy drogen bonds (proteins, spider silk ) (melting point 100-500K)
Ionic: Non-directional (point charges interacting)
Covalent: Directional (bon d angles, torsions matter)
Metallic: Non-directional (electron gas concept)
Difference of material properties originates from different atomic interactions 37
ij
ij
Interatomic pair potentials: examples
( r ij )
D exp 2 ( r
r 0
) 2 D exp ( r
r 0 )
Morse potential
( r ij )
4
r ij
12 6
r
ij
Lennard-Jones 12:6 potential
(excellent model for noble Gases, Ar, Ne, Xe..)
r
6
( r ) A exp i j C
ij
r
Buck ingham potential
ij
38
Harmonic approximation
What is the difference between these models?
Shape of potential (e.g. behavior at short or long distances, around equilibrium)
Number of parameters (to fit) Ability to describe bond breaking
Lennard-Jones potential
Parameters ,
12
6
4
( r )
r
r
Sir J. E. Lennard-Jones (Cambridge U K )
Lennard-Jones 12:6
Lennard-Jones potential: schematic & parameter meaning
LJ 12:6
potential
~
r
: well depth (energy stored per bond)
proportional to point where force vanishes (equilibrium distance between atoms)
r
r
4
12
6
Lennard-Jones 12:6
( r )
r
2.1 How to identify parameters in a Lennard-Jones potential
(=force field training, force field fitting, parameter coupling, etc.)
Parameter identification for potentials
Typically done based on more accurate (e.g. quantum mechanical ) results (or experimental measurements, if available)
Properties used include:
Lattice constant, cohesive bond energy, elastic modulus (bulk, shear, …), equations of state, phonon frequencies (bond vibrations), forces, stability/energy of different crystal structures, surface energy, RDF, etc.
Potential should closely re produce these reference values
Challenges : mixed systems, different types of bonds, reactions
Multi-scale paradigm
Show earlier: molecular dynamic s provides a powerful approach to relate the diffusion constant that appears in conti nuum models to atomistic t rajectories
Force field fitting to identify param eters for potentials (based on quantum mechanic al results) is yet another “step” in this multi-scale paradigm
Time scale
force fie l d fitting
diffusion calculation s
MD
Continuum model
“Empirical”
or experimental parameter feeding
m
mechanics ( part II )
Quantu
Len g th scale
44
-d /dr (eV/A)
Derivative of LJ potential ~ force
0.2
0.1
F = _ d ( r ) = - '
d r
0
-0.1
( r )
F max, LJ
-0.2
2
r 0
3
4
5
r (A)
o
Image by MIT OpenCou r seWare.
EQ r 0
relates to equilibrium spacing crystal 45
Properties of LJ potential as function of
parameters ,
Equilibrium distance between atoms r 0 and maximum force
6
2
r 0
F max, LJ
2 . 394
first derivative zero (force)
second derivative
zero (=loss of convexity, spring constant=0)
FCC
r 0
distance of nearest ne ighbors in a lattice r 0
Image from Wi ki medi a Common s , ht tp:/ /commons.wi ki m edi a . o rg
Determination of parameters for atomistic interactions
Example (based on elastic properties) of FCC lattice
Approach: Express bulk modulus as function of potential parameters
Second derivative of potential is related to spring constant
(=stiffness) of chemical bonds
1 / 4
Young’s modulus
0
a
0
Shear modulus
K E /( 3 ( 1 2 ))
E 8 / 3
r 2 k
/ 2 / V
V 3 / 4
47
Determination of parameters for atomistic interactions
Example (based on elastic properties) of FCC lattice
Approach: Express bulk modulus as function of potential parameters
Second derivative of potential is related to spring constant
(=stiffness) of chemical bonds
1 / 4
Young’s modulus
0
a
0
Shear modulus
K E /( 3 ( 1 2 ))
E 8 / 3
r 2 k
/ 2 / V
V 3 / 4
( r ) 4
12
r
6
r
2 ( r )
48
k r 2
' '
Determination of parameters for atomistic interactions
Example (based on elastic properties) of FCC lattice
Approach: Express bulk modulus as function of potential parameters
Second derivative of potential is related to spring constant
(=stiffness) of chemical bonds
1 / 4
Young’s modulus
0
a
0
Shear modulus
K E /( 3 ( 1 2 ))
E 8 / 3
r 2 k
/ 2 / V
V 3 / 4
( r ) 4
12
r
6
r
2 ( r )
k
r 2
' '
49
K 64 / 3
Bulk modulus copper E = 140 GPa
Lennard-Jones potential – example for copper
0.2
0.1
(eV)
0
-0.1
-0.2
2
r 0 3 4 5
o
r (A)
Image by MIT OpenCou r seWare.
LJ potential – parameters for copper 50
3. Monte Carlo approaches
How to solve…
A
A ( p , r ) ( p , r ) drdp
p r
Probability density distribution
Virtually impossible to carry out analytically Must know all possible configurations
Therefore: Require numerical simulation
Molecular dynamics OR Monte Carlo
3.1 Application to integration
“Random sampling”
Monte Carlo scheme
Method to carry out integration over “domain”
Want:
A
f ( x ) d
E.g. : Area of circle (value of )
d 2
54
0
A C 4 A C 4
4 A C
d 1
f ( x ) 1
inside outside
Conventional way…
Evaluate integrand at predetermi ned values in the domain (e.g. quadratic grid)
Evaluate integral at discrete points and sum up
…..
What about playing darts..
Public domain imag e.
Alternative way: integration through MC
…..
Playing darts: Randomly select point in domain Evaluate integral a these points
Sum up results to solve integral
Monte Carlo scheme for integration
x i
Step 1 : Pick random point
in
Step 2 : Accept/reject point based on criterion (e.g. if inside or outside of circle and if in area not yet counted)
Step 3 : If accepted, add to the total sum
f ( x i ) 1
A
A
C f
( x ) d
C 16
A 1 f ( )
C
N
x i
A
i
N A : Attempts
made
Court e sy of John H. Ma th ews. Used wi th permi s sion.
58
http://math.fullerton.edu/mat hews/n2003/MonteCarloPiMod.html
Java applet: how to calculate pi
http://polymer.bu.edu/java/jav a/montepi/montepiapplet.html
Court e sy of the Cent er for Pol ymer Studies a t Bo sto n Uni v e r sity. U s e d wi th per m is sio n .
59
4
2
-4
-2
2
4
-2
-4
Example: more complicated shapes
© N . Ba ker. All righ ts res e rved. This c o nt en t is exclud ed fro m our C r e a t i ve 60
Co mmo ns lice n se . Fo r mo re i n fo rm a t io n, see http:/ /ocw. m it.edu/fai ruse .
How to apply to ensemble average?
Similar method can be used to apply to integrate the ensemble average
Need more complex iteration scheme (replace “ random sampling ” b y “ importance sampling ”)
E.g. Metropolis-Hastings algorithm
A 1 A
N
i
A
i
Want:
A
A ( p , r ) ( p , r ) drdp
p r
Challenge: sampling specific types of distributions
We want to
Integrate a sharply-peaked function
Us e Monte Carlo with uniformly-distributed random numbers (e.g. here from -1 to 1)
f x ex p 1 0 0 x 12
1
0.8
0.6
Random numbers drawn from here
0.4
0.2
- 1 -0. 5 0 .5 1
Challenge: sampling specific types of distributions
We want to
Integrate a sharply-peaked function
Us e Monte Carlo with uniformly-distributed random numbers (e.g. here from -1 to 1)
f x ex p 1 0 0 x 12
1
What happens?
Very few points contribute to the integral (~9%)
Poor computational efficiency/convergence
Random numbers drawn from here
0.8
0.6
0.4
0.2
Solution: use a different distribution of random numbers to sample “ importance sampling ”
- 1 -0. 5 0 .5 1
63
3.2 Metropolis-Hastings algorithm
“Importance sampling”
Averaging over the ensemble
Property A 1 Property A 2 Property A 3
A
1 A A
A
C 1 C 2
macro 3 1 2 3
C 3
Averaging over the ensemble
Property A 1 Property A 2 Property A 3
A
1 A A
A
C 1 C 2
macro 3 1 2 3
C 3
Instead, we must average with proper weights that represent the probability of a system in a particular microscopic state!
(I.e., not all microscopic states are equal)
A macro
1 A 1
2 A 2
3 A 3
1 ( r 1 ,
p 1 ) A 1 ( r 1 ,
p 1 )
2 ( r 2 ,
p 2 ) A 2 ( r 2 ,
p 2 )
3 ( r 3 ,
p 3 ) A 3 ( r 3 ,
p 3 )
Probability to find system in st ate C 1
66
How to apply to ensemble average?
Similar method can be used to apply to integrate the ensemble average
A
A ( p , r ) ( p , r ) drdp
“discrete”
N A A exp H ( r , p ) / k T
p r
1
H ( p , r )
A
i 1
exp
A A
H ( r , p
B
) / k
T
( p , r )
exp
Q
k B T
N A
i 1
A A B
Computationally inefficient: If states are created “randomly” that have low probability….
To be computationally more effective, need more complex iteration scheme (replace “ random sampling ” b y “ importance
sampling ”) 67
Importance sampling
Core concept: Picking states with a biased probability: Importance sampling (sampling the “correct” way…)
N A A exp H ( r , p ) / k T
A
i 1
exp
N A
i 1
A
H ( r A ,
A B
p A ) / k B T
A
1 N A
N
A ( r A ,
p A )
Corresponding to…
A i 1
A
1 A A A
A
1 A A A
3 1 1 2 2 3 3
3 1 2 3
Importance sampling
Core concept: Picking states with a biased probability: Importance sampling (sampling the “correct” way…)
A
A ( p , r ) ( p , r ) drdp
( p , r )
1 exp
H ( p , r )
Q
p r
k B T
Notice: Probability (and thus importance) related to energy of state
Importance sampling: Metropolis algorithm
Leads to an appropriate “chain” of states, visiting each state with correct probability
Concept:
Pick random initial state
Move to trial states
Accept trial state with certain probability (based on knowledge about behavior of system, i.e ., energy states)
Original reference: J. Chem. Phys. 21 ,1087, 1953
Metropolis-Hastings Algorithm
Concept: Generate set of random microscopic configurations Accept or reject with certain scheme
State A State B
new state B
Random move to 71
72
Metropolis-Hastings Algorithm: NVT
Have: State A (initial state) + en erg y functio n H(A)
Step 2: if H(B)<H(A) then a = 1 a = true/false
else for acceptance
Draw random number 0 < p < 1
H ( B ) H ( A )
if p exp k T a = 1
else B
a = 0
endif a =variable either 0 or 1 (used to detect acceptance
endif of state B when a =1)
Step 3: if a = 1 then accept state B
“Downhill” m oves always accepted, uphill moves A 1 A ( i )
endif
with finite (“thermal”) probability N A i 1 .. N A
Step 1: Gen e rate n e w state B (random move)
Metropolis-Hastings Algorithm: NVT
Have: State A (initial state) + en erg y functio n H(A)
Step 1: Gen e rate n e w state B (random move)
Step 2: if H(B)<H(A) then a = 1 a = true[1]/false[0]
73
H ( B ) H ( A )
if p exp k T a = 1
else B
a = 0
endif a =variable either 0 or 1 (used to detect acceptance
endif of state B when a =1)
Step 3: if a = 1 then accept state B
A 1 A ( i )
endif
“Downhill” m oves always accepted, uphill moves
with finite (“thermal”) probability N A i 1 .. N A
“Downhill” m oves always accepted
else
Draw random number 0 < p < 1
for acceptance
Metropolis-Hastings Algorithm: NVT
Have: State A (initial state) + en erg y functio n H(A)
Step 1: Gen e rate n e w state B (random move)
Step 2: if H(B)<H(A) then a = 1 a = true[1]/false[0]
else
a = 1
Draw random number 0 < p < 1
for acceptance
“Downhill” m oves
H ( B ) H ( A )
always accepted,
if p exp
k T
uphill moves with finite
else B
74
endif of state B when a =1)
Step 3: if a = 1 then accept state B
“Downhill” m oves always accepted, uphill moves A 1 A ( i )
endif
with finite (“thermal”) probability N A i 1 .. N A
(“thermal”) probability
a = 0
endif
a =variable either 0 or 1 (used to detect acceptance
Metropolis-Hastings Algorithm: NVT
Have: State A (initial state) + en erg y functio n H(A)
Step 1: Gen e rate n e w state B (random move)
Step 2: if H(B)<H(A) then a = 1 a = true[1]/false[0]
else
Draw random number 0 < p < 1
for acceptance
if p exp
H ( B ) H ( A )
a = 0
a = 1
else
k
T
B
endif Step 3: if
endif
endif
a = 1
then accept state B
a =variable either 0 or 1 (used to detect acceptance of state B when a =1)
75
Metropolis-Hastings Algorithm: NVT
Have: State A (initial state) + en erg y functio n H(A)
Step 1: Gen e rate n e w state B (random move)
Step 2: if H(B)<H(A) then a = 1 a = true[1]/false[0]
else
Draw random number 0 < p < 1
for acceptance
repeat
N A times
H ( B ) H ( A )
a = 1
if p exp
k T
a = 0
else B
endif Step 3: if
endif
a = 1
then accept state B
a =variable either 0 or 1 (used to detect acceptance of state B when a =1)
endif
A
1
76
N A i 1 .. N
A ( i )
A
Arrhenius law - explanation
E
Consider two states, A and B
H ( B ) H ( A )
H ( B )
H ( A )
H ( B ) H ( A )
A B iteration
State B has higher energy than state A
Otherwis e accepted anyway!
77
Arrhenius law - explanation
H ( B ) H ( A )
H ( B ) H ( A )
H ( B )
H ( A )
H ( B ) H ( A )
E E
iteration radius
Energy difference between states A and B
(“uphill”)
Probability
of success
of overcoming the barrier at temperature T
exp
H ( B ) H ( A )
k T
B
78
Arrhenius law - explanation
Probability of success
exp
H ( B )
H ( A )
of overcoming the barrier
Random number 0 < p < 1
k B T
(equal probability to draw any number between 0 and 1)
Acceptance if:
p exp
H ( B )
H ( A )
k B T 1
E.g. when exp(..) = 0.8 most choices for p will be below, that is, high er
chance for acceptance
0.8
0.1
…. 0
low barrier
high barrier
H ( B ) H ( A )
Play “1D darts” 79
Summary: Metropolis-Hastings Algorithm
Have: State A (initial state) + en erg y functio n H(A)
Step 1: Gen e rate n e w state B (random move)
Step 2: if H(B)<H(A) then a = 1 a = true[1]/false[0]
else
Draw random number 0 < p < 1
for acceptance
repeat
N A times
H ( B ) H ( A )
a = 1
if p exp
k T
a = 0
else B
endif Step 3: if
endif
a = 1
then accept state B
a =variable either 0 or 1 (used to detect acceptance of state B when a =1)
endif
A
1
80
N A i 1 .. N
A ( i )
A
Summary: MC scheme
Have achieved:
A
A ( p , r ) ( p , r ) drdp
A 1 A
N
i
A i 1 .. N A
p r
Note:
• Do not need forces between atoms (for accelerations)
• O nly valid for equilibrium processes
81
Property calculation with MC: example
Averaging leads to “correct” thermodynamical property
Error in Monte Carlo decreases as N A
A
Iteratio n
“MC time” 82
Other ensembles/applications
Other ensembles carried out by modifying the acceptance criterion (in Metropolis-Hastings algorithm),
e.g. NVT, NPT; goal is to reach the appropriate distribution of states according to the corresponding probability distributions
Move sets can be adapted for other cases, e.g. not just move of particles but also rotations of side chains (=rotamers), torsions , etc.
E.g. application in protein folding problem when we’d like to determine the 3D folded structure of a protein in thermal equilibrium, NVT
83
After: R.J. Sadus
Possible Monte Carlo moves
Trial moves
Rigid body trans lation
Rigid body rotation
Internal conformational changes (soft vs. stiff modes)
Titration/electronic states
…
Questions:
How “big” a move should we take?
Move one particle or many?
After N. Baker (WUSTL)
Image by MIT OpenCou r seWare.
84
Monte Carlo moves
How “big” a move should we take?
Smaller moves : better acceptance rate, slower sampling
Bigger moves : faster sampling, poorer acceptance rate
Move one particle or many?
Possible to achieve more efficient sampling with correct multi- particle moves
One-particle moves must choose
particles at r andom Image by MIT OpenCou r seWare. 85