Sie sind auf Seite 1von 19

Molecular dynamics meets the physical world:

Thermostats and barostats

Justin Finnerty
j.finnerty@grs-sim.de, 2011
Scientific theories of physical world

•Energy is invariant

•Real world has quantum selection rules

•E = PV/nRT

•With constant energy we have PV = nRT


Molecular dynamics review
Phase-space and trajectories

• State of classical system (canonical): described by position and momenta of


all particles (notation q is position and p is momentum).

• Phase space point X = (q,p) gives 6N degrees of freedom


� �
• Extract property from ensemble �A� = A(q, p)P (q, p)dqdp

P (q, p) = Q−1 e−E(q,p)/kB T


� �
Q = e−E(q,p)/kB T dqdp

• Intractable to evaluate over phase space

• N = 100; q, p assume +1,-1 in each coordinate; 26N ≅ 4x10180 calc of A


and E
Molecular dynamics review
Properties of ensemble average

• MD ansatz. Probability function P(q,p) means phase space is “empty” except


around local energy minima. Means integrand is near-zero (if A does no go to
∞ with increasing energy) except around local energy minima

• Key is to pick “reasonable” starting geometry

• Role of MD “equilibration” phase is to generate low-energy (high-probability)


system - “equilibration” here does not refer to chemical “equilibrium” but to
relaxing the system to get energy minima, hopefully close to the chemical
“equilibrium”.

• If we start in region with high P(q,p) energy conserving evolution over time will
continue to sample high P(q,p) phase space (note these are unique and non-
intersecting trajectories)
Molecular dynamics review
Time average of trajectories

• Sampling periodically along trajectory evolving in time gives


M
1 �
�A� = A(ti )
M i

1 t0 +t
�A� = lim A(t)dt
t→∞ t t
0

• MD ansatz is starting from an initial low energy phase point (ie high P(q,p))
and moving along an iso-energetic time evolving trajectory will sample
properties of interest with high probability weights


• End of sampling uses property value convergence (�A� − A(ti ))2
Molecular dynamics review
pressure, temperature, volume

• Pressure (F is pairwise potential function):


  
N N
1  1 � � |pi | 
• P = Fij |qi − qj | +
V 3 i j>i
mi

• Temperature:
N
1 � |pi |2
• T =
3N kB i=1 mi

• Volume:

• parameters of the unit cell


Physically important conditions

• Basic MD is constant energy: micro-canonical nVE

• Constant temperature (volume and/or pressure vary) : nVT

• Biological reactions

• Constant pressure (volume and/or temperature vary) : nPT

• Chemical reaction occurring open to the atmosphere


Control of system variables to maintain
temperature or pressure

• Stochastic methods

• constrain a system variable to preset distribution function

• Strong-coupling methods

• scale system variable to give exact preset derived value

• Weak-coupling methods

• scale system variable in direction of desired derived value

• Extended system dynamics

• extend degrees of freedom to include temperature or pressure terms


Thermostat

• Stochastic Langevin thermostat apply friction and random force to momenta


�N
dpi
= (Fij |qi − qj |) − γpi + Ri (t)
dt j
• Andersen thermostat assign velocity of random particle to new velocity
from Maxwellian distribution

• Strong coupling isokinetic/Gaussian thermostat scale velocity


�N
dpi
= (Fij |qi − qj |) − αpi
dt j
• Weak coupling Berendsen bath unit-cell immersed in surrounding bath at T0
N
� � �
dpi p T0
= (Fij |qi − qj |) − i −1
dt j
τT T

• τ is relaxation constant
Nosé-Hoover thermostat

• Hoover, Phys. Rev. A 31 (1985) 1695; S. Nosé, J. Chem. Phys. 81 (1984) 511;
S. Nosé, Mol. Phys. 52 (1984) 255

• add extra term η to the equations of motion


N �
� N
dp pη
= Fij |qi − qj | − p
dt i j>i
Q
N

dpη |pi |2 3
= − nkB T
dt i
2mi 2

• The Q can be considered to be some fictional “heat bath mass”. Large Q


gives weak coupling, Nosé suggested Q ~ 6nkBT

• temperature is second-order differential


Example temperature control
6.5 Controlling the system 203
1.4

1.3
T (ε/kB)

1.2

1.1 LD
Berendsen
NoséHoover
1
0 1 2 3 4 5
*
t

Figure 6.12 The temperature response of a Lennard–Jones fluid under control of


three thermostats (solid line: Langevin; dotted line: weak-coupling; dashed line:
Nosé–Hoover) after a step change in the reference temperature (Hess, 2002a, and
by permission from van der Spoel et al., 2005.)

p2ηM −1
ṗηM = − kB T. (6.135)
Nosé-Hoover thermostat

• Energy (Hamiltonian H) of the simulated (physical) system fluctuates.


However, the energy of the system + heat bath (Hamiltonian H’) is conserved
Q 2
H� = H + pη + 3nkB T f (pη )
2

• If the system is ergodic the stationary state can then be shown to be a


canonical distribution
� � 2
��
p Q
exp −β V + + p2η
2m 2
Barostats

• Weak coupling Berendsen bath

• scale each dimension by μ: where β is isothermal compressibility - don’t


need to know exactly as it appears as ratio with τ (a relaxation constant)
  
� �1/3 N N
β∂t 1  1 � � |pi | 
µ= 1− (P0 − P ) P = F |q
ij i − q j | +
τ V 3 i j>i
mi

• This is similar to the Berendsen thermostat where we scale velocities by λ.


� � ��1/2
∂t T0
λ= 1+ −1
τ T
• Together give realistic fluctuations in T and P (J. Chem. Phys. 81 (1984) 3684)

• Note: pressure scale dimension, temperature scale velocity


Berendson barostat

Instantaneous pressure vs time and instantaneous temperature vs time in an


MD simulation of 256 particles at a density of 0.8442, using the Berendsen
barostat to impose an instantaneous pressure jump from 1.0 to 6.0. Each
curve corresponds to a different value of the rise time constant τ
Parrinello-Rahman Barostat

• The extended dimension of Nosé-Hoover thermostat can be applied to


pressure to give a Nosé-Hoover barostat

• The Parrinello-Rahman barostat (J. Appl. Phys. 52 (1981) 7182) extended this
further by making each unit vector of the unit-cell independent so that

• as with Nosé-Hoover the volume is a variable in the simulation.

• additionally allows dynamic shape change (gives control of stress as well


as pressure)

• The additional terms in the equations of motion are of similar type to that
shown for the Nosé-Hoover thermostat (though somewhat more complex!)
does indic
might have been guessed by the title given to this subsection.
after quen
Figure 3 shows the details of the changes with the passage of
only the s
time. The MD cell, i.e., the h matrix, undergoes large and
but it also
swift changes which cannot possibly be described as elastic
shells sho
Parrinello-Rahman barostat deformations. In fact, as Fig. 3 shows, when equilibrium was
reached the average values of the components of h* were
cle positio
were pres
(h Tl) = 5.54 ± 0.03, (h!2) = 9.76 ± 0.06,
here that
the c axis
• Graph of MD simulation of a metal Havi
under a c
crystal after application of external .x TI = 20
stress. temperatu
was no st
veal the s
• Note second order decay of the ing the lo
three variables hii related to the quench te
unit-vectors ................. ,............................. "' .......

• (Temperature change is due to release


of elastic energy as crystal structure
changes) 0 •

ff
8

6
(a)
...................... ........... .......... ''' ............. " ... ...... .............

o 500 1000
Consequences of control method

method pro con

stochastic canonical disturb dynamics

non-Hamiltonian
strong coupling canonical in phase space disturb dynamic
accuracy

no well-defined ensemble ensemble average ok


weak coupling
good for non-equilibrium perturbation not ok

canonical in configuration more computation


extended dynamics
space disturb dynamics
Consequences of control method

method pro con

now considered less


Berendsen thermostat fast, smooth first-order
reliable for simulation at
and barostat approach to equilibrium
equilibrium

maintain canonical
ensemble.
Nosé-Hoover thermostat considered most reliable
slow, second-order
and Parinello-Rahman for simulation at
approach to equilibrium
barostat equilibrium and for
predicting thermo-
dynamic properties
Group discussion: MD calculation process

• What impacts will the different control methods have on parallel MD code?
(steps in right square not necessarily shown in actual order)

• Pressure and temperature are global properties calculated as ensemble averages

equilibrate solve equations of motion

pass start condition sample

experiment apply control

pass end condition propagate ensemble

Das könnte Ihnen auch gefallen