Thermostat MD

  • Upload
    srokkam

  • View
    226

  • Download
    0

Embed Size (px)

Citation preview

  • 7/30/2019 Thermostat MD

    1/29

    Thermostats in Molecular Dynamics Simulations

    Alden Johnson, Teresa Johnson, Aimee KhanUniversity of Massachusetts Amherst

    December 6th, 2012

    Alden Johnson, Teresa Johnson, Aimee Khan (UMass Amherst)

    Thermostats in MD Simulations December 6th, 2012 1 / 29

  • 7/30/2019 Thermostat MD

    2/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

  • 7/30/2019 Thermostat MD

    3/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

  • 7/30/2019 Thermostat MD

    4/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

  • 7/30/2019 Thermostat MD

    5/29

    Canonical Ensemble

    Follows a Gibbs distribution for probability pj of being in a givenmicrostate j with energy Ej

    pj =eEj

    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

  • 7/30/2019 Thermostat MD

    6/29

    Ergodic Hypothesis

    The ergodic hypothesis says the long time average of an observable fcoincides with an ensemble average of the observable f.

    f = limt

    1

    tt

    0 f(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

  • 7/30/2019 Thermostat MD

    7/29

    Molecular Dynamics Simulation

    Phase space is collection of positions q and momenta p of particles insystem

    The Hamiltonian Formdqt = pH(qt, pt) dtdpt = qH(qt, pt) dt

    H(q, p) = Ekin

    (p) + V(q), Ekin

    (p) =1

    2pTM1p

    Alden Johnson, Teresa Johnson, Aimee Khan (UMass Amherst)Thermostats in MD Simulations December 6th, 2012 7 / 29

  • 7/30/2019 Thermostat MD

    8/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

  • 7/30/2019 Thermostat MD

    9/29

    Velocity Rescaling

    Velocities are described by Maxwell-Boltzmann distribution

    P(vi,) = m

    2kBT12

    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

    2 kBT

    Alden Johnson, Teresa Johnson, Aimee Khan (UMass Amherst)Thermostats in MD Simulations December 6th, 2012 9 / 29

  • 7/30/2019 Thermostat MD

    10/29

    Velocity Rescaling

    Ensemble average average over velocities of all particles: defineinstantaneous temperature Tc for a finite system

    kBTc =1

    Nfi,

    mv2

    i,

    Tc = T until rescaling

    v

    i, =T

    Tcvi,

    Alden Johnson, Teresa Johnson, Aimee Khan (UMass Amherst)Thermostats in MD Simulations December 6th, 2012 10 / 29

  • 7/30/2019 Thermostat MD

    11/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

  • 7/30/2019 Thermostat MD

    12/29

    Nose-Hoover

    Based on extended Lagrangian formalism

    Deterministic trajectory

    Simulated system contains virtual variables related to real variables

    Coordinates qi = qi

    Momenta pi = 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

  • 7/30/2019 Thermostat MD

    13/29

    Nose-Hoover

    Hamiltonian given by

    H =Ni=1

    p2i

    2mis2+ V(q) +

    Qs2

    2+ (3N + 1)kBTln 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 inefficientMicrocanonical dynamics on extended system give canonicalproperties

    Alden Johnson, Teresa Johnson, Aimee Khan (UMass Amherst)Thermostats in MD Simulations December 6th, 2012 13 / 29

  • 7/30/2019 Thermostat MD

    14/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 instantaneous

    temperature jump

    Deterministic and time reversible

    Alden Johnson, Teresa Johnson, Aimee Khan (UMass Amherst)Thermostats in MD Simulations December 6th, 2012 14 / 29

  • 7/30/2019 Thermostat MD

    15/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 = 2mikBT

    Alden Johnson, Teresa Johnson, Aimee Khan (UMass Amherst)Thermostats in MD Simulations December 6th, 2012 15 / 29

  • 7/30/2019 Thermostat MD

    16/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 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

    A d

  • 7/30/2019 Thermostat MD

    17/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

    A d

  • 7/30/2019 Thermostat MD

    18/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

    Th S

  • 7/30/2019 Thermostat MD

    19/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 occasionally

    re-randomized

    yes yes

    Alden Johnson, Teresa Johnson, Aimee Khan (UMass Amherst)Thermostats in MD Simulations December 6th, 2012 19 / 29

    A li d M th M t P j t

  • 7/30/2019 Thermostat MD

    20/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

    L d J P t ti l

  • 7/30/2019 Thermostat MD

    21/29

    Lennard-Jones Potential

    Alden Johnson, Teresa Johnson, Aimee Khan (UMass Amherst)Thermostats in MD Simulations December 6th, 2012 21 / 29

    Numeric Integration

  • 7/30/2019 Thermostat MD

    22/29

    Numeric Integration

    Verlet Algorithm

    pn+1/2 = pn t2V(qn)

    qn+1 = qn + tM1pn+1/2

    p

    n+1

    = p

    n+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

  • 7/30/2019 Thermostat MD

    23/29

    Thermostat Implementation

    Velocity Rescaling

    pi

    T

    Tcpi

    Anderson = 1%, 0.1%, 0.05% Velocities are sampled from N(0,T)

    Langevin

    BBK algorithmpn+1/2 = pn t

    2V(qn) t

    2(qn)M1pn +

    t2(qn)Gn

    qn+1 = qn + tM1pn+1/2

    pn+1

    = pn+1/2

    t

    2 V(qn+1

    )t

    2 (qn+1

    )M1

    pn+1

    +t

    2 (qn+1

    )Gn+1

    chosen to be constant =

    2MkBT

    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

  • 7/30/2019 Thermostat MD

    24/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

    5

    Temp

    time step

    Alden Johnson, Teresa Johnson, Aimee Khan (UMass Amherst)Thermostats in MD Simulations December 6th, 2012 24 / 29

    Anderson Instantaneous Temperature

  • 7/30/2019 Thermostat MD

    25/29

    Anderson - Instantaneous Temperature

    0 2000 4000 6000 8000 100000

    1

    2

    3

    4

    5

    6

    Temp

    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

  • 7/30/2019 Thermostat MD

    26/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

  • 7/30/2019 Thermostat MD

    27/29

    Langevin Instantaneous Temperature

    0 2 4 6 8 10

    x 104

    1

    2

    3

    4

    5

    6

    7

    Temp

    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

  • 7/30/2019 Thermostat MD

    28/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.2

    p(v)

    velocity

    Alden Johnson, Teresa Johnson, Aimee Khan (UMass Amherst)Thermostats in MD Simulations December 6th, 2012 28 / 29

  • 7/30/2019 Thermostat MD

    29/29