Alden Johnson, Teresa Johnson, Aimee...
Transcript of Alden Johnson, Teresa Johnson, Aimee...
Thermostats in Molecular Dynamics Simulations
Alden Johnson, Teresa Johnson, Aimee Khan
University of Massachusetts Amherst
December 6th, 2012
Alden Johnson, Teresa Johnson, Aimee Khan (UMass Amherst)Thermostats in MD Simulations December 6th, 2012 1 / 29
An Interest in Thermostats
Thermostat: A modification of the Newtonian MD scheme with thepurpose of generating a statistical ensemble at a constant temperature.
Match experimental conditions
Manipulate temperatures in algorithms such as simulated annealing
Avoid energy drifts caused by accumulation of numerical errors.
Alden Johnson, Teresa Johnson, Aimee Khan (UMass Amherst)Thermostats in MD Simulations December 6th, 2012 2 / 29
Statistical Ensembles
Ensemble: a large collection of microscopically defined states of asystem, with certain constant macroscopic properties
Microcanonical (NVE)
◮ Arises in Newtonian MD simulation◮ Conserves total energy
Canonical (NVT)
◮ Implement thermostats to sample from here◮ Relevant to real behavior in experiment
Alden Johnson, Teresa Johnson, Aimee Khan (UMass Amherst)Thermostats in MD Simulations December 6th, 2012 3 / 29
Microcanonical Ensemble
Consider an isolated system
Microstate: complete description of a state of the system,microscopically
The probabilities of being in a certain microstate for themicrocanonical ensemble are uniform over all possible states
Alden Johnson, Teresa Johnson, Aimee Khan (UMass Amherst)Thermostats in MD Simulations December 6th, 2012 4 / 29
Canonical Ensemble
Follows a Gibbs distribution for probability pj of being in a givenmicrostate j with energy Ej
pj =e−βEj
Zβ, Zβ =
∑
j
e−βEj
β =1
kBT
Derivation follows from maximizing entropy
Alden Johnson, Teresa Johnson, Aimee Khan (UMass Amherst)Thermostats in MD Simulations December 6th, 2012 5 / 29
Ergodic Hypothesis
The ergodic hypothesis says the long time average of an observable f
coincides with an ensemble average of the observable 〈f 〉.
f = limt→∞
1
t
∫ t
0f (x(s)) ds
〈f 〉 =∫
Γf (x) dµ(x)
where µ is the ensemble measure and Γ is the phase space of theobservable.
Alden Johnson, Teresa Johnson, Aimee Khan (UMass Amherst)Thermostats in MD Simulations December 6th, 2012 6 / 29
Molecular Dynamics Simulation
Phase space is collection of positions q and momenta p of particles insystem
The Hamiltonian Form{
dqt = ∇pH(qt , pt) dt
dpt = −∇qH(qt , pt) dt
H(q, p) = Ekin(p) + V (q), Ekin(p) =1
2pTM−1p
Alden Johnson, Teresa Johnson, Aimee Khan (UMass Amherst)Thermostats in MD Simulations December 6th, 2012 7 / 29
Sampling from Ensembles
A canonical ensemble (constant average energy) is a distribution ofmicrocanonical ensembles (constant energy)
To sample from the canonical ensemble, the following thermostatsmodulate the energy entering and leaving the boundaries of thesystem
Alden Johnson, Teresa Johnson, Aimee Khan (UMass Amherst)Thermostats in MD Simulations December 6th, 2012 8 / 29
Velocity Rescaling
Velocities are described by Maxwell-Boltzmann distribution
P(vi ,α) =
(
m
2πkBT
)12
e−
mv2i,α2kBT
Adjust instantaneous temperature by scaling all velocities
Average Ekin per degree of freedom related to T via the equipartitiontheorem
⟨
mv2i ,α
2
⟩
=1
2kBT
Alden Johnson, Teresa Johnson, Aimee Khan (UMass Amherst)Thermostats in MD Simulations December 6th, 2012 9 / 29
Velocity Rescaling
Ensemble average → average over velocities of all particles: defineinstantaneous temperature Tc for a finite system
kBTc =1
Nf
∑
i ,α
mv2i ,α
Tc 6= T until rescaling
v ′i ,α =
√
T
Tcvi ,α
Alden Johnson, Teresa Johnson, Aimee Khan (UMass Amherst)Thermostats in MD Simulations December 6th, 2012 10 / 29
Velocity Rescaling
Disadvantages
◮ Results do not correspond to any ensemble
⋆ Does not allow the proper temperature fluctuations
◮ Localized correlation not removed
◮ Not time reversible
Advantages
◮ Straightforward to implement
◮ Good for use in warmup / initialization phase
Alden Johnson, Teresa Johnson, Aimee Khan (UMass Amherst)Thermostats in MD Simulations December 6th, 2012 11 / 29
Nose-Hoover
Based on extended Lagrangian formalism
◮ Deterministic trajectory
◮ Simulated system contains virtual variables related to real variables
⋆ Coordinates q′
i = qi
⋆ Momenta p′
i = pi/s
⋆ Time t′ =
∫ t
0dts
⋆ s: additional degree of freedom, acts as external system
Alden Johnson, Teresa Johnson, Aimee Khan (UMass Amherst)Thermostats in MD Simulations December 6th, 2012 12 / 29
Nose-Hoover
Hamiltonian given by
H =
N∑
i=1
p2i
2mi s2+ V (q) +
Qs2
2+ (3N + 1)kBT ln s
Logarithmic term required for proper time scaling: canonical ensemble
Effective mass Q associated with s◮ Determines thermostat strength◮ Q too small: system not canonical◮ Q too large: temperature control inefficient
Microcanonical dynamics on extended system give canonicalproperties
Alden Johnson, Teresa Johnson, Aimee Khan (UMass Amherst)Thermostats in MD Simulations December 6th, 2012 13 / 29
Nose-Hoover
Disadvantages
◮ Extended system not guaranteed to be ergodic
Advantages
◮ Easy to implement and use
⋆ Implement as a chain
⋆ Each link: apply thermostatting to the previous thermostat variable
◮ Increasing Q lengthens decay time of response to instantaneoustemperature jump
◮ Deterministic and time reversible
Alden Johnson, Teresa Johnson, Aimee Khan (UMass Amherst)Thermostats in MD Simulations December 6th, 2012 14 / 29
Langevin
Consider the motion of large particles through a continuum of smallerparticles
dqidt
=pi
mi
dpidt
= −δV (q)
δqi− γpi + σGi
◮ Viscous drag force proportional to velocity −γpi◮ Smaller particles give random pushes to large particle
Fluctuation-dissipation relation
σ2 = 2γmikBT
Alden Johnson, Teresa Johnson, Aimee Khan (UMass Amherst)Thermostats in MD Simulations December 6th, 2012 15 / 29
Langevin
Disadvantages
◮ Difficult to implement drag for non-spherical particles: γ related toparticle radius
◮ Momentum transfer lost: cannot compute diffusion coefficients
Advantages
◮ Damping + random force 7→ correct canonical ensemble
◮ Ergodic
◮ Can use larger time step
Alden Johnson, Teresa Johnson, Aimee Khan (UMass Amherst)Thermostats in MD Simulations December 6th, 2012 16 / 29
Andersen
Couple a system to a heat bath to impose desired temperature
Equations of motion are Hamiltonian with stochastic collision term
Strength of coupling specified by ν, the stochastic collision frequency
When particle has collision, new velocity is sampled from N (0,√T )
Alden Johnson, Teresa Johnson, Aimee Khan (UMass Amherst)Thermostats in MD Simulations December 6th, 2012 17 / 29
Andersen
Disadvantages
◮ Newtonian dynamics + stochastic collisions → Markov chain
◮ Algorithm randomly decorrelates velocity: dynamics are not physical
Advantages
◮ Allows sampling from canonical ensemble
Alden Johnson, Teresa Johnson, Aimee Khan (UMass Amherst)Thermostats in MD Simulations December 6th, 2012 18 / 29
Thermostats Summary
Thermostat Description Canonical? Stochastic?
Velocity Rescaling KE fixed to match T no no
Nose-Hoover extra degree of freedomacts as thermal reser-voir
yes no
Langevin noise and drag balanceto give correct T
yes yes
Andersen momenta occasionallyre-randomized
yes yes
Alden Johnson, Teresa Johnson, Aimee Khan (UMass Amherst)Thermostats in MD Simulations December 6th, 2012 19 / 29
Applied Math Masters Project
Molecular Dynamics Simulation
◮ Implemented in MATLAB and C++
◮ Simulations in 2 and 3 dimensions
◮ Periodic and walled boundary conditions
◮ External fields such as gravity
◮ Optimization⋆ OpenMP
⋆ CUDA
Alden Johnson, Teresa Johnson, Aimee Khan (UMass Amherst)Thermostats in MD Simulations December 6th, 2012 20 / 29
Lennard-Jones Potential
Alden Johnson, Teresa Johnson, Aimee Khan (UMass Amherst)Thermostats in MD Simulations December 6th, 2012 21 / 29
Numeric Integration
Verlet Algorithm
pn+1/2 = pn − ∆t
2∇V (qn)
qn+1 = qn +∆tM−1pn+1/2
pn+1 = pn+1/2 − ∆t
2∇V (qn+1)
◮ Preserves modified Hamiltonian
Alden Johnson, Teresa Johnson, Aimee Khan (UMass Amherst)Thermostats in MD Simulations December 6th, 2012 22 / 29
Thermostat Implementation
Velocity Rescaling
◮ pi →√
TTcpi
Anderson◮ ν = 1%, 0.1%, 0.05%◮ Velocities are sampled from N (0,
√T )
Langevin◮ BBK algorithm
pn+1/2 = pn − ∆t2 ∇V (qn)− ∆t
2 γ(qn)M−1pn +√
∆t2 σ(qn)G n
qn+1 = qn +∆tM−1pn+1/2
pn+1 = pn+1/2−∆t
2∇V (qn+1)−∆t
2γ(qn+1)M−1pn+1+
√
∆t
2σ(qn+1)G n+1
◮ γ chosen to be constant◮ σ =
√2γMkBT
◮ G sampled from a standard normal distribution
Alden Johnson, Teresa Johnson, Aimee Khan (UMass Amherst)Thermostats in MD Simulations December 6th, 2012 23 / 29
Velocity Rescaling - Instantaneous Temperature
0 2000 4000 6000 8000 100000
0.5
1
1.5
2
2.5
3
3.5
4
4.5
5T
emp
time step
Alden Johnson, Teresa Johnson, Aimee Khan (UMass Amherst)Thermostats in MD Simulations December 6th, 2012 24 / 29
Anderson - Instantaneous Temperature
0 2000 4000 6000 8000 100000
1
2
3
4
5
6
Tem
p
time step
ν = 1%ν = 0.1%ν = 0.05%
Alden Johnson, Teresa Johnson, Aimee Khan (UMass Amherst)Thermostats in MD Simulations December 6th, 2012 25 / 29
Anderson - Histogram of Velocity Distribution
−10 −5 0 5 100
0.02
0.04
0.06
0.08
0.1
0.12
0.14
0.16
0.18
0.2
velocity
p(v)
Alden Johnson, Teresa Johnson, Aimee Khan (UMass Amherst)Thermostats in MD Simulations December 6th, 2012 26 / 29
Langevin Instantaneous Temperature
0 2 4 6 8 10
x 104
1
2
3
4
5
6
7
Tem
p
time step
γ = 0.1γ = 0.01γ = 0.001
Alden Johnson, Teresa Johnson, Aimee Khan (UMass Amherst)Thermostats in MD Simulations December 6th, 2012 27 / 29
Langevin - Histogram of Velocity Distribution
−10 −5 0 5 100
0.02
0.04
0.06
0.08
0.1
0.12
0.14
0.16
0.18
0.2p(
v)
velocity
Alden Johnson, Teresa Johnson, Aimee Khan (UMass Amherst)Thermostats in MD Simulations December 6th, 2012 28 / 29
References
Barsegov, Valeri (2007)
Different ensembles in molecular dynamics simulations
http://faculty.uml.edu/vbarsegov/teaching/bioinformatics/lectures/MDEnsemblesModified.pdf
Carloni, Paolo (2009)
Simulation of Biomolecules
http://www.grs-sim.de/cms/upload/Carloni/Presentations/Strodel3.pdf
Hunenberger, Philippe H. (2005)
Thermostat Algorithms for Molecular Dynamics Simulations
Adv. Polym. Sci. 173:105-149
Tuckerman, Mark E.(2010)
Statistical Mechanics: Theory and Molecular Simulation
Oxford Graduate Texts
Zhao, Yanxiang (2011)
Brief introduction to the thermostats
http://www.math.ucsd.edu/ y1zhao/ResearchNotes/ResearchNote007Thermostat.pdf
Alden Johnson, Teresa Johnson, Aimee Khan (UMass Amherst)Thermostats in MD Simulations December 6th, 2012 29 / 29