15
Molecular dynamics: thermostats & barostats

Molecular dynamics: thermostats & barostats

  • Upload
    others

  • View
    1

  • Download
    0

Embed Size (px)

Citation preview

Molecular dynamics: thermostats & barostats

• Solution of Newton’s equations leads naturally to NVE

!

• Very rare case when system is isolated (most of time: heat bath)

Microcanonical ensemble

N,V,E Microcanonical (NVE) ensemble Time averages

Stat. Mech.

Ri =Pi

Mi

Pi = Fi

1. Average kinetic energy should correspond to the desire temperature

!

2. Dynamics of system to be consistent with the canonical distribution

MD at constant temperature

system

bath

Canonical NVT ensemble Time averages

< A >=

RAe��Ed3Rd3PRe��Ed3Rd3P

,< A >=1

T

Z T

0A(t)dt

What do we expect from an NVT molecular dynamics simulation?

< K >=3

2NeffkT

P ({Ri}{Pi}) =1

Ze��H({Ri}{Pi})

Ri =Pi

Mi

Pi = Fi

Stat. Mech.

Ri =Pi

Mi

Pi = Fi

+…

Isothermal: Anderson approach

• Coupling the system with a heat bath

Stochastic collisions between randomly selected particles with the bath that result in a new velocity consistent with the desired temperature

• Two parameters:

• T: the desire temperature

• ν: frequency of collision (strength coupling with heat bath)

• Algorithm:

1. Integrate the equation of motion from initial set of {Ri} {Pi} for time Δt

2. Number of atoms that underwent collisions during Δt is: νΔt (select randomly)

3. Assign new velocities to selected atoms from a Maxwell-Boltzmann distribution at temperature T

For example: if particle i undergo a collision, the momentum of particle i after collision is chosen at random from a Boltzmann distribution at the temperature T

Andersen, J. Chem. Phys. 72, 2384 (1980)

Isothermal: Anderson approach

• Coupling the system with a heat bath

Stochastic collisions between randomly selected particles with the bath that result in a new velocity consistent with the desired temperature

Pros!• Leads to canonical distribution

!

Cons!• Collisions affect atomic dynamics (e.g. diffusion coefficient): the dynamics

is not physical

Andersen, J. Chem. Phys. 72, 2384 (1980)

< A >=

RAe��Ed3Rd3PRe��Ed3Rd3P

,< A >=1

T

Z T

0A(t)dt

Isothermal: Anderson approach

Daan Frenkel & Berend Smit

• Can we modify the equations of motion to obtain desired temperature?

Isothermal: Berendsen approach

�(t) =T (t)� T0

T (t)

Berendsen thermostat • Direct feedback to control temperature • γ is a heat flow variable (can be negative or positive) • γ defined in terms of instantaneous temperature (T) and thermostat temperature (T0) • MD temperature converges to desired thermostat temperature

Pros!Thermalizes system to desired temperature efficiently

Cons!Does not lead to the canonical distribution

Even if correct K not good fluctuations

Berendsen, Postma, van Gunsteren, DiNola and Haak, J. Chem. Phys. 81, 3684 (1984).

Ri =Pi

Mi

Pi = Fi � �Pi

Berendsen Nosé-Hoover

Isothermal: Nosé-Hoover approach

Ri =Pi

Mi

Pi = Fi � �Pi

�(t) =T (t)� T0

T (t)

direct feedback integral feedback

If T(t) > T0: direct rescaling of the velocities

to match T0

Ri =Pi

Mi

Pi = Fi � �Pi

�(t) =T (t)� T0

T (t)

If T(t) > T0: thermostat coupling constant

starts growingHeat flow variable has its own equation of motion!

Enable kinetic energy fluctuations Nose, Mol. Phys. 52, 255 (1984) Hoover, Phys. Rev. A, 31 1695 (1985)

Pros!• Leads to canonical distribution • Time reversible

Cons!• Approach equilibrium: can lead

to oscillations (be careful with coupling constant)

• Persistent, non-canonical oscillations can occur

Daan Frenkel & Berend Smit

Isothermal: Nosé-Hoover approach

LAMMPS NVT: A Nose-Hoover thermostat will not work well for arbitrary values of Tdamp. If Tdamp is too small, the temperature can fluctuate wildly; if it is too large, the temperature will take a very long time to equilibrate. A good choice for many models is a Tdamp of around 100 timesteps. Note that this is NOT the same as 100 time units for most units settings.

LAMMPS documentation

Molecular dynamics in various ensembles

• Thermostats:

• Andersen: stochastic, based on collisions

• Berendsen: direct feedback to control kinetic energy

• Nosé Hoover (most used): integral feedback

• Barostats

• Hoover, Rahman and Parrinello

• Cell volume (liquids) or cell parameters (in solids) are allowed to fluctuate to equilibrate the system to an external stress state

Parrinello and Rahman, Phys. Rev. Lett., 45, 1196 (1980) Parrinello and Rahman, J. Appl. Phys. 52, 7182 (1981)

Melchionna, Ciccoti and Holian, Mol Phys. 78, 533 (1993) Martyna, Tobias, and Klein, J. Chem. Phys. 101 4177 (1994)

Holian, Voter, and Ravelo, Phys. Rev. E. 52, 2338 (1995)

SummaryMicrocanonical (NVE) Canonical (NVT) Isobaric/Isothermal (NPT)

P ({Pi}, {Ri}) =1

⌦(N,V,E)

⌦(N,V,E) =X

micro

�(E �H({Ri

}, {Pi

}))

S = klog⌦(N,V,E)

P ({Ri}, {Pi}) =e�

EkT

Z(N,V, T )P ({Ri}, {Pi}, V ) =

e�E�PV

kT

Z(N,P, T )

Z(N,V, T ) =X

micro

e�EkT Z(N,V, T ) =

X

V

X

micro

e�E�PV

kT

F (N,V, T ) = �kT logZ G(N,P, T ) = �kT logZ

Probability distribution

Free energy (macro ↔ micro)

+ grand canonical

• 3 dimension and N particle

!

• In most cases c.m. motion is set to zero at time zero (constant of motion → it remains zero)

!

• Often angular momentum is zeroed (and remains zero)

!

• Instantaneous temperature:

Equipartition of energy

< K >=3

2NkT

< K >=3N � 3

2kT

< K >=3N � 6

2kT

T (t) =2K(t)

Neffk

Fluctuations• Fluctuation from equilibrium are also related to materials properties

!

!

• Specific heat (heat added to an object to the resulting temperature change)

!

• Compressibility (volume change as a response to a pressure change)

< �A2 >=1

Z t

0[A(t)� < A >]2dt =< A2 > � < A >2

CV =@ < E(N,V, T ) >

@T< �H2 >= kT 2CV

�V =1

V

@V (N,V, T )

@P< �V >= kT < V > �V

Classical harmonic oscillator• Harmonic solid: analytical derivation

• At low T dynamics can be approximated to a set of uncoupled harmonic oscillators

• Normal modes in molecules & phonons in crystals

= + +

• When does classical mechanics for atoms stop working?

!

!

!

!

!

• Temperature at which quantum effects kick in depends on frequency

Quantum effectsEn

ergy

Interatomic distance

kT >> ~!kT ⇠< ~!

classical regimequantum regime

If decrease T: smaller oscillations Equilibrium distance decrease

T = 0: no more motion (Heisenberg not satisfy)

CV (N,V, T ) =@E

@T= 3Nk

CV = k3NX

i=1

✓~!i

kT

◆2 e�~!i

(e�~!i + 1)2