simulations at nanoscales
TRANSCRIPT
Simulations at Nanoscales
Prof. Yan WangWoodruff School of Mechanical Engineering
Georgia Institute of TechnologyAtlanta, GA 30332, [email protected]
Multiscale Systems Engineering Research Group
Molecular Dynamics
Center locations of atoms:
Inter-atomic potential function:
Force on atom i caused by N−1 other atoms:
+: repulsive force
−: attractive force
Momentum of atoms:
domain
{ }1, ,N
Nr r r= …
( )NrU
( )N
ii
rF
r
∂= −
∂U
{ } 11 1, , , ,N N
N N
dr drp p p m m
dt dt
⎧ ⎫⎪ ⎪= = ⎨ ⎬⎪ ⎪⎩ ⎭
… …
Multiscale Systems Engineering Research Group
Molecular Dynamics
For an isolated system, Hamiltonian = total energy
MD simulation computes the phase-space trajectory
Newtonian Dynamics View Hamiltonian Dynamics ViewMotion is a response to an applied force
No explicit forces. Motion occurs to preserve the Hamiltonian function.
3N dimensional of configurationspace ri(t)’s
Phase space = 3N dimensional configuration space ri(t)’s + 3Ndimensional momentum space pi(t)’s
i i
ii i
p dr
p m dt∂
= =∂H
i
i
dp
r dt∂
= −∂H
2
2i
i ii
d rm F
rdt
∂= = −
∂U
( , )N Nr p const=H
11
1( , ) ( , , )
2
NN N
i i Ni i
r p p p r r Em=
= + =∑H Ui …
Multiscale Systems Engineering Research Group
A simple example of phase-spaceone-dimensional harmonic oscillator
21( )
2x xγ=U
2 21 12 2
E p x constm
γ= + =
F xx
γ∂= − = −
∂U
Multiscale Systems Engineering Research Group
Lennard-Jones Pair Potential
( )
n m
ijij ij
u r kr rσ σε
⎡ ⎤⎛ ⎞ ⎛ ⎞⎢ ⎥⎜ ⎟ ⎜ ⎟= −⎢⎜ ⎟ ⎜ ⎟ ⎥⎝ ⎠ ⎝ ⎠⎢ ⎥⎣ ⎦
12 8
( ) 4ij
ij ij
u rr rσ σε
⎡ ⎤⎛ ⎞ ⎛ ⎞⎢ ⎥⎜ ⎟ ⎜ ⎟= −⎢⎜ ⎟ ⎜ ⎟ ⎥⎝ ⎠ ⎝ ⎠⎢ ⎥⎣ ⎦
m
n mn nkn m m
−⎛ ⎞= ⎜ ⎟− ⎝ ⎠
where
- σ is the inter-atomic distance where u(σ)=0 - ε is the minimum energy
Lennard-Jones(12,6):
Multiscale Systems Engineering Research Group
Reduce Computational Complexity
The most time-consuming part of a MD simulation is the calculation of the forces from pairwise potentials .
Truncated Potential: introducing the cut-off distance rc (where u(r)=0 for r> rc).
e.g. in L-J(12,6), rc=2.5σdiscontinuity at r=rc
error introduces small fluctuations in E
Shifted-Force Potential:
where
( ) ( )Nij
i j
r u r<
= ∑∑U
( )( )
( )0
cs
c
duF r r
F r drr r
∆⎧− + ≤⎪= ⎨⎪ >⎩
( )c
cr r
duF F r
dr∆
=
= − =
Multiscale Systems Engineering Research Group
Implementation - Neighbor List
For each atom i, a list of neighboring atoms that lie within a distance rL of atom i is maintained. rL is slightly larger than rc , and typically rL = rc
+0.3σ. The force on atom i is only contributed by those listed atoms. The neighbor list is updated periodically over several (e.g. 10) consecutive time steps.For a 3D Lennard-Jones fluid at density ρσ3=0.8, each atom has about 75 neighbors lying within a radius rL=2.8σ. In average, 75/2≈40 storage locations per atom.
Multiscale Systems Engineering Research Group
Verlet AlgorithmFrom Taylor series
(1)
(2)
Eq.(1)+Eq.(2)
Eq.(1)−Eq.(2)
Not self-starting: x(0) and v(0) are not enough to start
2 (3) 3 41 1( ) ( ) '( ) ''( ) ( ) ( )
2 ! 3 !r t t r t r t t r t t r t t O t∆ ∆ ∆ ∆ ∆+ = + + + +
2 (3) 3 41 1( ) ( ) '( ) ''( ) ( ) ( )
2 ! 3 !r t t r t r t t r t t r t t O t∆ ∆ ∆ ∆ ∆− = − + − +
2 4( ) 2 ( ) ( ) '( ) ( )r t t r t r t t v t t O t∆ ∆ ∆ ∆+ = − − + +
2( ) ( )( ) ( )
2
r t t r t tv t O t
t
∆ ∆ ∆∆
+ − −= +
Multiscale Systems Engineering Research Group
System of Units in MD ProgramsWith u*=u/ε and r*=r/σ, the unitless form of Lennard-Jones(12,6) is
Others:
12 61 1
* ( *) 4* *
u rr r
⎡ ⎤⎛ ⎞ ⎛ ⎞⎢ ⎥= −⎜ ⎟ ⎜ ⎟⎢ ⎥⎝ ⎠ ⎝ ⎠⎣ ⎦
Multiscale Systems Engineering Research Group
Truncation and Round-off Errors in Forward Finite Difference Method
Integration step size Δt
Total Global Error
Round-off error dominates
Truncation error dominates
Multiscale Systems Engineering Research Group
Gear’s Predictor-Corrector Algorithm
Predict (by Tayler series)
2 3 4 5(3) (4) (5)( ) ( ) ( ) ( )
( ) ( ) '( ) ''( ) ( ) ( ) ( )2 ! 3 ! 4 ! 5 !i i i i i i i
t t t tt t t t t t t t t
∆ ∆ ∆ ∆∆ ∆+ ≈ + + + + +r r r r r r r2 3 4
(3) (4) (5)( ) ( ) ( )'( ) '( ) ''( ) ( ) ( ) ( )
2 ! 3 ! 4 !i i i i i i
t t tt t t t t t t t
∆ ∆ ∆∆ ∆+ ≈ + + + +r r r r r r2 3
(3) (4) (5)( ) ( )''( ) ''( ) ( ) ( ) ( )
2 ! 3 !i i i i i
t tt t t t t t t
∆ ∆∆ ∆+ ≈ + + +r r r r r2
(3) (3) (4) (5) ( )( ) ( ) ( ) ( )
2 !i i i i
tt t t t t t
∆∆ ∆+ ≈ + +r r r r
(4) (4) (5)( ) ( ) ( )i i it t t t t∆ ∆+ ≈ +r r r
(5) (5)( ) ( )i it t t∆+ ≈r r
Multiscale Systems Engineering Research Group
Gear’s Predictor-Corrector AlgorithmEvaluate
• where u(rij) is the potential energy function that act between atoms i and j , and is the unit vector
Correct (by inter-atomic force)
( )ˆ( ) ( )ij
i ijj i ij
u rt t t t
r∆ ∆
≠
∂+ = − +
∂∑F r
ijr
''( ) ( ) /i i it t t t m∆ ∆+ = +r F
''( ) ''( )i it t t t∆ ∆= + − +D r r
0( ) ( )i it t t t α∆ ∆+ ← + +r r R
1'( ) '( )i it t t t
tα∆ ∆∆
+ ← + +R
r r
2 2
2 !''( ) ''( )
( )i it t t t
tα∆ ∆
∆+ ← + +
Rr r
(3) (3)3 3
3 !( ) ( )
( )i it t t t
tα∆ ∆
∆+ ← + +
Rr r
(4) (4)4 4
4 !( ) ( )
( )i it t t t
tα∆ ∆
∆+ ← + +
Rr r
(5) (5)5 5
5 !( ) ( )
( )i it t t t
tα∆ ∆
∆+ ← + +
Rr r
2( )
2 !
t∆=R D
Multiscale Systems Engineering Research Group
Gear’s Predictor-Corrector Algorithm
Coefficients
αi order=3 order=4 order=5
α0 1/6 19/120 3/16
α1 5/6 3/4 251/360
α2 1 1 1
α3 1/3 1/2 11/18
α4 1/12 1/6
α5 1/60
Multiscale Systems Engineering Research Group
Comparison by Energy Conservation( )21
_ (0) ( )M
kglobal error E E k t∆
== −∑
( )21
1_ _ _ (0) ( )
M
kglobal error per step E E k t
M∆
== −∑
Gear’s predictor-corrector algorithm
1-D collision of two L-J atoms
Multiscale Systems Engineering Research Group
Macroscopic Properties
Macroscopic properties result from the collective behavior of individual atoms.Any measurable property A(rN(t),pN(t)) is a function of the phase point.
Phase-space trajectory
The measured value <A> at the macroscopic scale is an average over a time interval t:
( )0
0
1( ), ( )
t tN N
t
A A dt
τ τ τ+
< >= ∫ r p
( ){ }( ), ( ) , 1, ,N Nk t k t k M∆ ∆ =r p …
( )1
1( ), ( )
M N N
kA A k t k t
M∆ ∆
=< >= ∑ r p
or
Multiscale Systems Engineering Research Group
Thermodynamic Properties
Average kinetic energy
Temperature
Pressure
1 1
3 1( ) ( )
2 2
M N
k i ik i
E NkT k t k tmM
∆ ∆= =
< >= = ∑∑ p pi
1 1
1( ) ( )
3
M N
i ik i
T k t k tmkNM
∆ ∆= =
= ∑∑ p pi
( )11
3ij
iji j ij
du rPr
kT NkT drρ <
= − ∑∑
Multiscale Systems Engineering Research Group
Thermodynamic Properties
Constant-volume heat capacity• fluctuation of internal energy
or
Adiabatic compressibility
vV
EC
T
⎛ ⎞∂= ⎜ ⎟∂⎝ ⎠
( ) ( )22 22
2 2 2
1 1 1vC E E E E E
kT kT kTδ ⎛ ⎞= = − = −⎜ ⎟
⎝ ⎠1
* *
*
3 11
2v
v
k
C NC N NT
NK E
−⎡ ⎤⎛ ⎞
= = − −⎢ ⎥⎜ ⎟⎢ ⎥⎝ ⎠⎣ ⎦
Kinetic energy
1s
s
VV P
κ⎛ ⎞∂
= − ⎜ ⎟∂⎝ ⎠
( )1
* * 2* * * * *
3 * *
167 8
3s
s c
T NP U P
T
κ ε ρκ ρ δσ ρ
−⎡ ⎤
= = − − −⎢ ⎥⎣ ⎦
Internal energy per atom
Multiscale Systems Engineering Research Group
Thermodynamic Properties
Thermal Pressure Coefficient vV
PT
γ⎛ ⎞∂
= ⎜ ⎟∂⎝ ⎠3
* * * * *
*2
2 13
vv v k
C E Pk T
γ σγ ρ δ δ
⎡ ⎤= = −⎢ ⎥
⎣ ⎦
Multiscale Systems Engineering Research Group
Issues in Property Estimation
How long a simulation run should be?Ideally, a measurement in thermodynamic equilibrium is
( )0
0
1lim ( ), ( )
t tN N
tt
A A dt
τ τ τ+
→∞< >= ∫ r p
Multiscale Systems Engineering Research Group
Issues in Property Estimation
Existence of metastable statese.g. one-dimensional harmonic oscillator
21 1
2 21 1 2 2 1
1( )
2( )3 1 1
( ) ( ) ( )4 2 2
x x xx
x x x x x
γ
γ γ
⎧<⎪⎪= ⎨
⎪ + − ≥⎪⎩
U
Multiscale Systems Engineering Research Group
Issues in Property Estimation
Not all properties are defined as time averages over some function of the phase-space trajectory, e.g.
entropy
free energies
chemical potential
Multiscale Systems Engineering Research Group
Kinetic Monte Carlo (KMC)KMC is a type of discrete-event stochastic simulation methods KMC is extensively used in physics and chemistryKMC
defines a discrete set of states of the system (i.e. all possible configurations)simulates state transitions between states which are triggered by events (also called processes in chemistry-oriented literature) that cause state changes.
e.g. vapor deposition
e.g. 2H2O ↔ 2H2 + O2
(b) possible events
a1
a2 a3
a4a5
a7
a6
solid surface
(a) discrete states
particles
states: combinations of # of speciesH2O n n-2 n-4 …H2 0 2 4 …O2 0 1 2 …events: reactionsa1: → a2: ←
rate
propensity
Multiscale Systems Engineering Research Group
How KMC Works – event selection
The inter-arrival time Tj of event j is assumed to be exponentially distributed as
The probability that the inter-arrival time of event j is the minimum among M independent events
Therefore, uniformly sample to choose the next event
( )j jT Exponential a∼
timeevent 1
timeevent j
timeevent M
Tj
1 1Pr[ min( , , )] / ( )
j M j MT T T a a a= = + +…
a1 a2 aj aM
Multiscale Systems Engineering Research Group
How KMC Works – clock advancement
The inter-arrival time Tj of event j is
The earliest time T(1)=min(T1,…,TM) of any event occurs is
Therefore, exponentially sample to advance clock
timeevent 1
timeevent j
timeevent M
Tj
timeoverall next event
( ) ( )1 exp ( 1, , )j j
P T a j Mτ τ≤ = − − = …
( )( ) ( )( ) ( ) ( )1 1
1 11 1 1 exp
M
jj
M
jjaP T P T P Tτ τ τ τ
= =⎛ ⎞≤ = − > = − > = − −⎜ ⎟⎝ ⎠∏ ∑
( )1ln / where 0,1
M
jjT a Uniformρ ρ
== − ∑ ∼
Multiscale Systems Engineering Research Group
Initiate regular lattice sites;Specify regular species on each regular site;
Define all possible events;
WHILE stop criteria are not met Update a list of J active sites with sitePropensityj> 0 for site j
where is sum of all event propensitiesat site j
Update ;//choose a site for the next eventGenerate r1~Uniform(0,1);Find mth site where ;//choose an event from the chosen siteGenerate r2~Uniform(0,1);Find nth event where ;Fire event n at site m and update species at neighboring sites;//update event listFOR all events associated with site m
Add the event into the event list of site m;ENDUpdate propensities for site m and neighboring sites;//update system timeGenerate r3~Uniform(0,1);Advance system time T to T+Δt where Δt=−lnr3/totalProp;
END
1
J
j jtotalProp sitePropensity
== ∑
j jkksitePropensity propensity= ∑
1
11 1
m m
j jj jsitePropensity totalProp r sitePropensity
−
= =< × ≤∑ ∑
1
21 1
n n
mk kmk mkpropensity sitePropensity r propensity
−
= =< × ≤∑ ∑
Stochastic Simulation Algorithm (SSA)
Example: deposition
a1
a2 a3
a4a5
a7
a6
Multiscale Systems Engineering Research Group
An Example of KMC for Chemical Reactions
PLac
RNAP
PLacRNAP
TrLacZ1
RbsLacZ
TrLacZ2TrLacY1TrLacY2
RbsLacY
Ribosome
RbsRibosomeLacZ
RbsRibosomeLacY
TrRbsLacZ
TrRbsLacY
LacY
LacZ
dgrLacZ
dgrRbsLacZ
dgrLacY
dgrRbsLacY
0.17
10
1
10.0151
0.36
0.17 0.45
0.17
0.45
0.4
0.4
0.036
0.015
6.42E-5
6.42E-5
0.3
0.3
lactose
LacZlactose
14
product
9.52E-5
431
Reactions of LacZ and LacY proteins in E. coli
Multiscale Systems Engineering Research Group
Accelerating KMC: τ-Leap
Based on the relation between Exponential and Poisson distributionsHow to choose τ ?
Lower Bound:
Upper Bound (Leap Condition): τ is small enough such that the change in the state during [t,t+τ] is so slight that no propensity function will suffers an appreciable change.
How to choose aj(x) to generate Poisson variates kj’s to finish state change
1( )jja
τ >∑ x
1
M
j jj
k=
⎯⎯→ +∑x x v
Multiscale Systems Engineering Research Group
Accelerating KMC: Binomial τ-Leap
In the original τ-leap, it is possible to have generate negative number of species, e.g.
S1 + S2 --> S3 with species sizes x1 = 1000, x2 = 1, and rate c=0.1. Propensity is a = cx1x2 = 100 There are two reactions: S1 + S2 --> S3, S1 --> S4 with a leap.
Instead of generating kj~Poisson(aj(x)τ), generating kj~Binomial(Nj, aj(x)τ/Nj) which explicitly considers the current size of species as Nj .
Nj = x1 for S1 --> S3Nj = min(x1, x2) for S1 + S2 --> S4Nj = x1/2 for S1 + S1 --> S5
Multiscale Systems Engineering Research Group
Further ReadingsMolecular Dynamics
J.M. Haile (1992) Molecular Dynamics Simulation: Elementary Methods. John Wiley & Sons, New York.
Kinetic Monte CarloChatterjee A. and Vlachos D.G. (2007) An overview of spatial microscopic and accelerated kinetic Monte Carlo methods. Journal of Computer-Aided Materials Design, 14:253-308 Gillespie D.T. (1976) A general method for numerically simulating the stochastic evolution of coupled chemical reactions. Journal of Computational Physics, 22: 403-434 Gillespie D.T. (2001) Approximate accelerated stochastic simulation of chemically reacting systems. Journal of Chemical Physics, 115: 1716-1733 Rathinam M., Petzold L.R., Cao Y., and Gillespie D.T. (2003) Stiffness in stochastic chemically reacting systems: The implicit tau-leaping method. Journal of Chemical Physics, 119(24): 12784-12794 Tian T. and Burrage K. (2004) Binomial leap methods for simulating stochastic chemical kinetics, Journal of Chemical Physics, 121(21): 10356(1-9) Cai X. and Xu Z. (2007) K-leap method for accelerating stochastic simulation of coupled chemical reactions. Journal of Chemical Physics, 126(7): 074102(1-10)