molecular dynamicshome.ku.edu.tr/~okeskin/cmse520/md1.pdf · molecular dynamics • time is of the...

51
1 Molecular Dynamics Time is of the essence in biological processes therefore how do we understand time-dependent processes at the molecular level? How do we do this experimentally? How do we do this computationally?

Upload: others

Post on 24-May-2020

10 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: Molecular Dynamicshome.ku.edu.tr/~okeskin/CMSE520/MD1.pdf · Molecular Dynamics • Time is of the essence in biological ... Statistical Mechanics • Ensemble – very many copies

1

Molecular Dynamics

• Time is of the essence in biological processes therefore how do we understand time-dependent processes at the molecular level?

• How do we do this experimentally?• How do we do this computationally?

Page 2: Molecular Dynamicshome.ku.edu.tr/~okeskin/CMSE520/MD1.pdf · Molecular Dynamics • Time is of the essence in biological ... Statistical Mechanics • Ensemble – very many copies

2

• Methods of Computer Simulation

– Molecular Dynamicsand– Monte Carlo

Page 3: Molecular Dynamicshome.ku.edu.tr/~okeskin/CMSE520/MD1.pdf · Molecular Dynamics • Time is of the essence in biological ... Statistical Mechanics • Ensemble – very many copies

3

Page 4: Molecular Dynamicshome.ku.edu.tr/~okeskin/CMSE520/MD1.pdf · Molecular Dynamics • Time is of the essence in biological ... Statistical Mechanics • Ensemble – very many copies

4

What Is Molecular Dynamics?• Simulating the Brownian motion of proteins (and

other macromolecules).

• Formally, solving Newton’s equations of motion for every atom in the system.

• Connecting the “trajectory” with thermodynamic properties.

• Ultimately, understanding macromolecular properties from first principles.

What is a molecular dynamics simulation?

• Simulation that shows how the atoms in the system move with time

• Typically on the nanosecond timescale

• Atoms are treated like hard balls, and their motions are described by Newton’s laws.

Page 5: Molecular Dynamicshome.ku.edu.tr/~okeskin/CMSE520/MD1.pdf · Molecular Dynamics • Time is of the essence in biological ... Statistical Mechanics • Ensemble – very many copies

5

Page 6: Molecular Dynamicshome.ku.edu.tr/~okeskin/CMSE520/MD1.pdf · Molecular Dynamics • Time is of the essence in biological ... Statistical Mechanics • Ensemble – very many copies

6

Characteristic protein motions

> 5 Å20 ns

(20 ps)ms – hrs

Globalprotein tumbling(water tumbling)protein folding

1-5 Åns – µs

Medium scaleloop motions

SSE formation

< 1 Å0.01 ps0.1 ps1 ps

Local:bond stretchingangle bendingmethyl rotation

AmplitudeTimescaleType of motion

Periodic (harmonic)

Random (stochastic)

Energy Landscape

Unfolded StateExpanded, disordered Molten Globule

Compact, disordered

Native StateCompact, Ordered

BarrierHeight

1 ms to 1s

1 µs

Barrier crossing time~ exp[Barrier Height]

Page 7: Molecular Dynamicshome.ku.edu.tr/~okeskin/CMSE520/MD1.pdf · Molecular Dynamics • Time is of the essence in biological ... Statistical Mechanics • Ensemble – very many copies

7

Why MD simulations?

• Link physics, chemistry and biology

• Model phenomena that cannot be observed experimentally

• Understand protein folding…

• Access to thermodynamics quantities (free energies, binding energies,…)

Page 8: Molecular Dynamicshome.ku.edu.tr/~okeskin/CMSE520/MD1.pdf · Molecular Dynamics • Time is of the essence in biological ... Statistical Mechanics • Ensemble – very many copies

8

Why do we do computer simulations in biophysics and biochemistry?

Systems with many particles behave in qualitatively different ways than systems with a small number of particles

By simulating a system in thermal equilibrium,we can see qualitativelyand quantitatively what is happening.

We can calculate explicit observable quantities to confirm that our model (and our understanding of the system) is correct.

If we succeed, we will be able to predict behavior thatwe would not expect without the simulations.

“The goal of computation is understanding –not numbers.”

Page 9: Molecular Dynamicshome.ku.edu.tr/~okeskin/CMSE520/MD1.pdf · Molecular Dynamics • Time is of the essence in biological ... Statistical Mechanics • Ensemble – very many copies

9

How do you run a MD simulation?• Get the initial configuration

From x-ray crystallography or NMR spectroscopy (PDB)

• Assign initial velocities

At thermal equilibrium, the expected value of the kinetic energy of the system at temperature T is:

This can be obtained by assigning the velocity components vi from a random Gaussian distributionwith mean 0 and standard deviation (kBT/mi):

TkNvmE B

N

iiikin )3(

21

21 3

1

2 == ∑=

i

Bi m

Tkv =2

For each time step:

Compute the force on each atom:

Solve Newton’s 2nd law of motion for each atom, to get newcoordinates and velocities

Store coordinates

Stop

How do you run a MD simulation?

XEXEXF∂∂

−=−∇= )()(

)(XFXM =••

X: cartesian vectorof the system

M diagonal mass matrix.. means second order

differentiation withrespect to time

Newton’s equation cannot be solved analytically:Use stepwise numerical integration

Page 10: Molecular Dynamicshome.ku.edu.tr/~okeskin/CMSE520/MD1.pdf · Molecular Dynamics • Time is of the essence in biological ... Statistical Mechanics • Ensemble – very many copies

10

What the integration algorithm does

• Advance the system by a small time step ∆t during which forces are considered constant

• Recalculate forces and velocities

• Repeat the process

If ∆t is small enough, solution is a reasonable approximation

Page 11: Molecular Dynamicshome.ku.edu.tr/~okeskin/CMSE520/MD1.pdf · Molecular Dynamics • Time is of the essence in biological ... Statistical Mechanics • Ensemble – very many copies

11

Molecular dynamics (MD) simulations

• A deterministic method based on the solution of Newton’s equation of motion

Fi = mi aifor the ith particle; the acceleration at each step is calculated from the negative gradient of the overall potential, using

Fi = - grad Ei - = - ∇ Ei

Newton’s Laws

( )2

2

In general, is a 3N-dimensional vector

F mad rm U rdt

r

=

=−∇

r r

r r r

r

E

Page 12: Molecular Dynamicshome.ku.edu.tr/~okeskin/CMSE520/MD1.pdf · Molecular Dynamics • Time is of the essence in biological ... Statistical Mechanics • Ensemble – very many copies

12

∇ Ei = Gradient of potential?

• Derivative of E with respect to the position vector ri = (xi, yi, zi)T at each step

axi ~ -∂E/∂xiayi ~ -∂E/∂yi

azi ~ −∂E/∂zi

Ei = Σk(energies of interactions between i and all other residues k located within a cutoff distance of Rc from i)

Non-Bonded Interaction Potentials• Electrostatic interactions of the form

Eik(es) = qiqk/rik• Van de Waals interactions

Eij(vdW) = - aik/rik6 + bik/rik

12

Bonded Interaction Potentials• Bond stretching Ei(bs) = (kbs/2) (li – li0)2

• Bond angle distortion Ei(bad) = (kθ/2) (θi – θi0)2

• Bond torsional rotation Ei(tor) = (kφ/2) f(cosφi)

Interaction potentials include;

Page 13: Molecular Dynamicshome.ku.edu.tr/~okeskin/CMSE520/MD1.pdf · Molecular Dynamics • Time is of the essence in biological ... Statistical Mechanics • Ensemble – very many copies

13

A Potential Energy Function

( ) ( )

( )

2 20 0

1 212 6

1 12 2

1 1 cos2

1 2

bbonds bond

angles

dihedralangles

nonbondedpairs

V K b b K

K n

A C q qr r r

θ

φ

θ θ

φ δ

ε

= − + −

+ + −⎡ ⎤⎣ ⎦

⎡ ⎤+ + +⎢ ⎥⎣ ⎦

∑ ∑

Page 14: Molecular Dynamicshome.ku.edu.tr/~okeskin/CMSE520/MD1.pdf · Molecular Dynamics • Time is of the essence in biological ... Statistical Mechanics • Ensemble – very many copies

14

Page 15: Molecular Dynamicshome.ku.edu.tr/~okeskin/CMSE520/MD1.pdf · Molecular Dynamics • Time is of the essence in biological ... Statistical Mechanics • Ensemble – very many copies

15

Statistical Mechanics

• Ensemble – very many copies of the system of interest evolving independently.

• Calculate averages of important quantities over the ensemble.

• Thermodynamic quantities can be derived from the appropriate averages.

The Ergodic Hypothesis

• Averages taken over a single system for a sufficiently long time will yield the same values as ensemble averages.

• Molecular dynamics generates the values to be averaged.

• Practical issues:– How long is long enough?– Is the force field U(r) good enough?

Page 16: Molecular Dynamicshome.ku.edu.tr/~okeskin/CMSE520/MD1.pdf · Molecular Dynamics • Time is of the essence in biological ... Statistical Mechanics • Ensemble – very many copies

16

Page 17: Molecular Dynamicshome.ku.edu.tr/~okeskin/CMSE520/MD1.pdf · Molecular Dynamics • Time is of the essence in biological ... Statistical Mechanics • Ensemble – very many copies

17

Page 18: Molecular Dynamicshome.ku.edu.tr/~okeskin/CMSE520/MD1.pdf · Molecular Dynamics • Time is of the essence in biological ... Statistical Mechanics • Ensemble – very many copies

18

• Without the out-of-plane term, the bonded structures would behave differently

• To achieve the desired geometry (known from experiments) additional terms should be added in the force field (these help a benzene ring to be planar!)

• E(w)= k(1-cos2w) is one way...

Cross-terms: 1, 2 and 3 force fields

• The presece of cross terms in a force field reflects couplings between the internal coordinates.

• As a bond angle is decreased, it is found that the adjacent bonds stretch to reduce the interaction between the 1,3 atoms.

Page 19: Molecular Dynamicshome.ku.edu.tr/~okeskin/CMSE520/MD1.pdf · Molecular Dynamics • Time is of the essence in biological ... Statistical Mechanics • Ensemble – very many copies

19

Types of cross-terms

• Stretch-stretch• Stretch-torsion• Stretch-bend• Bend-torsion• Bend-bend

Page 20: Molecular Dynamicshome.ku.edu.tr/~okeskin/CMSE520/MD1.pdf · Molecular Dynamics • Time is of the essence in biological ... Statistical Mechanics • Ensemble – very many copies

20

Example 1: gradient of vdW interaction with k, with respect to ri

• Eik(vdW) = - aik/rik6 + bik/rik

12

• rik = rk – ri• xik = xk – xi• yik = yk – yi• zik = zk – zi• rik = [ (xk – xi)2 + (yk – yi)2 + (zk – zi)2 ]1/2

∂E/∂xi = ∂ [- aik/rik6 + bik/rik

12] / ∂xi

where rik6 = [ (xk – xi)2 + (yk – yi)2 + (zk – zi)2 ]3

Page 21: Molecular Dynamicshome.ku.edu.tr/~okeskin/CMSE520/MD1.pdf · Molecular Dynamics • Time is of the essence in biological ... Statistical Mechanics • Ensemble – very many copies

21

Example 2: gradient of bond stretching potentialwith respect to ri

• Ei(bs) = (kbs/2) (li – li0)2

• li = ri+1 – ri• lix = xi+1 – xi

• liy = yi+1 – yi

• liz = zi+1 – zi

• li = [ (xi+1 – xi)2 + (yi+1 – yi)2 + (zi+1 – zi)2 ]1/2

∂Ei(bs) /∂xi = - miaix(bs) (induced by deforming bond li)

= (kbs/2) ∂ {[ (xi+1– xi)2 + (yi+1– yi)2 + (zi+1– zi)2 ]1/2 – li0}2/∂xi

= kbs (li – li0) ∂ {[ (xi+1– xi)2 + (yi+1– yi)2 + (zi+1– zi)2 ]1/2 – li

0}/∂xi

= kbs (li – li0) (1/2) (li

-1) ∂ (xi+1– xi)2/∂xi = - kbs (1 – li0/ li ) (xi+1– xi)

•Ei(bs) = (kbs/2) (li – li0)2

Page 22: Molecular Dynamicshome.ku.edu.tr/~okeskin/CMSE520/MD1.pdf · Molecular Dynamics • Time is of the essence in biological ... Statistical Mechanics • Ensemble – very many copies

22

The Verlet algorithm

Perhaps the most widely used method of integrating the equations of motion is

that initially adopted by Verlet [1967] .The method is based on positions r(t),

accelerations a (t), and the positions r(t -dt) from the previous step.

The equation for advancing the positions reads as

r(t+dt) = 2r(t)-r(t-dt)+ dt2a(t)

There are several points to note about this equation. It will be seen that the

velocities do not appear at all. They have been eliminated by addition of the

equations obtained by Taylor expansion about r(t):

r(t+dt) = r(t) + dt v(t) + (1/2) dt2 a(t)+ ...

r(t-dt) = r(t) - dt v(t) + (1/2) dt2 a(t)-

The velocities are not needed to compute the trajectories, but they are useful

for estimating the kinetic energy (and hence the total energy). They may be

obtained from the formula

v(t)= [r(t+dt)-r(t-dt)]/2dt

You need r(t) and r(t-dt)to find r r(t+dt)

i

Fi

Time=t

Time=t+dt

Page 23: Molecular Dynamicshome.ku.edu.tr/~okeskin/CMSE520/MD1.pdf · Molecular Dynamics • Time is of the essence in biological ... Statistical Mechanics • Ensemble – very many copies

23

Initial velocities (vi)

using the Boltzmann distribution at the given temperature

vi = (mi/2πkT)1/2 exp (- mivi2/2kT)

How to generate MD trajectories?

• Known initial conformation, i.e. ri(0) for all atom i• Assign vi (0), based on Boltzmann distribution at given T• Calculate ri(δt) = ri(0) + δt vi (0)• Using new ri(δt) evaluate the total potential Vi on atom i• Calculate negative gradient of Vi to find ai(δt) = -∇Vi /mi

• Start Verlet algorithm using ri(0), ri(δt) and ai(δt) • Repeat for all atoms (including solvent, if any)• Repeat the last three steps for ~ 106 successive times

(MD steps)

Page 24: Molecular Dynamicshome.ku.edu.tr/~okeskin/CMSE520/MD1.pdf · Molecular Dynamics • Time is of the essence in biological ... Statistical Mechanics • Ensemble – very many copies

24

• Using accelerations of the current time step, compute the velocities at half-time step:v(t+∆t/2) = v(t – ∆t/2) + a(t)∆t

• Then determine positions at the next time step:X(t+∆t) = X(t) + v(t + ∆t/2)∆t

t-∆t/2 t t+∆t/2 t+∆t t+3∆t/2 t+2∆t

v X

A widely-used algorithm: Leap-frog Verlet

v

Choosing a time step ∆t

• Not too short so that conformations are efficiently sampled

• Not too long to prevent wild fluctuations or system ‘blow-up’

• An order of magnitude less than the fastest motion is ideal– Usually bond stretching is the fastest motion:

C-H is ~10fs so use time step of 1fs– Not interested in these motions?

Constrain these bonds and double the time step

Page 25: Molecular Dynamicshome.ku.edu.tr/~okeskin/CMSE520/MD1.pdf · Molecular Dynamics • Time is of the essence in biological ... Statistical Mechanics • Ensemble – very many copies

25

Minimization

• Energy minimization is very widely used in molecular modelling and is an integral part of techniques such as conformational search procedures.

• Min is also used to prepare a system for MD in order to relieve any unfavorable interactions in the initial configuration of the system.

• Especially important in complex systems such as proteins.

Energy Minimization

Local minima:

A conformation X is a local minimum if there exists a domain D in the neighborhood of X such that for all Y≠X in D:

U(X) <U(Y)

Global minimum:

A conformation X is a global minimum if U(X) <U(Y)

for all conformations Y ≠X

Page 26: Molecular Dynamicshome.ku.edu.tr/~okeskin/CMSE520/MD1.pdf · Molecular Dynamics • Time is of the essence in biological ... Statistical Mechanics • Ensemble – very many copies

26

The minimizers

Some definitions:

Gradient:The gradient of a smooth function f with continuous first and secondderivatives is defined as:

HessianThe n x n symmetric matrix of second derivatives, H(x), is calledthe Hessian:

( ) ⎥⎦

⎤⎢⎣

⎡∂∂

∂∂

∂∂

=∇Ni xf

xf

xfXf ......1

⎟⎟⎟⎟⎟⎟⎟⎟⎟

⎜⎜⎜⎜⎜⎜⎜⎜⎜

∂∂

∂∂∂

∂∂∂

∂∂∂

∂∂∂

∂∂∂

∂∂∂

∂∂∂

∂∂

=

2

22

1

2

22

1

2

1

2

1

2

21

2

......

...............

......

...............

......

)(

NjNN

Nijii

Nj

xf

xxf

xxf

xxf

xxf

xxf

xxf

xxf

xf

xH

The minimizers

Steepest descent (SD):

The simplest iteration scheme consists of following the “steepestdescent” direction:

Usually, SD methods leads to improvement quickly, but then exhibitslow progress toward a solution.They are commonly recommended for initial minimization iterations,when the starting function and gradient-norm values are very large.

Minimization of a multi-variable function is usually an iterative process, in whichupdates of the state variable x are computed using the gradient, and in some(favorable) cases the Hessian.

Iterations are stopped either when the maximum number of steps (user’s input)is reached, or when the gradient norm is below a given threshold.

)(1 kkk xfxx ∇−=+ α(α sets the minimumalong the line definedby the gradient)

Page 27: Molecular Dynamicshome.ku.edu.tr/~okeskin/CMSE520/MD1.pdf · Molecular Dynamics • Time is of the essence in biological ... Statistical Mechanics • Ensemble – very many copies

27

Minimization• Minimization follows gradient of potential to

identify stable points on• energy surface• – Let U(x) = a/2(x-x0)2• – Begin at x’, how do we find x0 if we don’t

know U(x) in detail?• • How can we move from x’ to x0?• – Steepest descent based algorithms (SD):• • x��x’ = x+δ• • δ = -κ∂U(x)/ ∂x = -κa(x- x 0)• – This moves us, depending on κ, toward

the minimum.• – On a simple harmonic surface, we will

reach the minimum, x0, i.e. converge, in a certain number of steps related to κ.

• • SD methods use first derivatives only• • SD methods are useful for large systems

with large forces

The minimizersConjugate gradients (CG):

In each step of conjugate gradient methods, a search vector pk isdefined by a recursive formula:

The corresponding new position is found by line minimization alongpk:

the CG methods differ in their definition of b:

- Fletcher-Reeves:

- Polak-Ribiere

- Hestenes-Stiefel

( ) kkkk pxfp 11 ++ +−∇= β

kkkk pxx λ+=+1

)()()()( 11

1kk

kkFRk xfxf

xfxf∇•∇∇•∇

= +++β

[ ])()(

)()()( 111

kk

kkkPRk xfxf

xfxfxf∇•∇

∇−∇•∇= ++

[ ][ ])()(

)()()(

1

111

kkk

kkkHSk xfxfp

xfxfxf∇−∇•

∇−∇•∇=

+

+++β

Page 28: Molecular Dynamicshome.ku.edu.tr/~okeskin/CMSE520/MD1.pdf · Molecular Dynamics • Time is of the essence in biological ... Statistical Mechanics • Ensemble – very many copies

28

The minimizersNewton’s methods:

Newton’s method is a popular iterative method for finding the 0 of a one-dimensional function:

( )( )k

kkk xg

xgxx'1 −=+

x0x1x2x3

The equivalent iterative scheme for multivariate functions is based on:

( ) ( )kkkkk xfxHxx ∇−= −+

11

Several implementations of Newton’s method exist, that avoid computingthe full Hessian matrix: quasi-Newton, truncated Newton, “adopted-basisNewton-Raphson” (ABNR),…

It can be adapted to the minimization of a one –dimensional function, in whichcase the iteration formula is: ( )

( )k

kkk xg

xgxx'''

1 −=+

Page 29: Molecular Dynamicshome.ku.edu.tr/~okeskin/CMSE520/MD1.pdf · Molecular Dynamics • Time is of the essence in biological ... Statistical Mechanics • Ensemble – very many copies

29

Page 30: Molecular Dynamicshome.ku.edu.tr/~okeskin/CMSE520/MD1.pdf · Molecular Dynamics • Time is of the essence in biological ... Statistical Mechanics • Ensemble – very many copies

30

Periodic boundary conditions

Page 31: Molecular Dynamicshome.ku.edu.tr/~okeskin/CMSE520/MD1.pdf · Molecular Dynamics • Time is of the essence in biological ... Statistical Mechanics • Ensemble – very many copies

31

Page 32: Molecular Dynamicshome.ku.edu.tr/~okeskin/CMSE520/MD1.pdf · Molecular Dynamics • Time is of the essence in biological ... Statistical Mechanics • Ensemble – very many copies

32

Page 33: Molecular Dynamicshome.ku.edu.tr/~okeskin/CMSE520/MD1.pdf · Molecular Dynamics • Time is of the essence in biological ... Statistical Mechanics • Ensemble – very many copies

33

Page 34: Molecular Dynamicshome.ku.edu.tr/~okeskin/CMSE520/MD1.pdf · Molecular Dynamics • Time is of the essence in biological ... Statistical Mechanics • Ensemble – very many copies

34

Page 35: Molecular Dynamicshome.ku.edu.tr/~okeskin/CMSE520/MD1.pdf · Molecular Dynamics • Time is of the essence in biological ... Statistical Mechanics • Ensemble – very many copies

35

Notes on computing the energy

∑∑ +⎥⎥

⎢⎢

⎟⎟⎠

⎞⎜⎜⎝

⎛−⎟

⎟⎠

⎞⎜⎜⎝

⎛=

nonbondedji ij

ji

nonbondedji ij

ij

ij

ijijNB r

qqrR

rR

U, 0,

612

42

επεε

The direct computation of the non bonded interactions involve all pairs of atoms and has a quadratic complexity (O(N2)).This is usually prohibitive for large molecules.

Bonded interactions are local, and therefore their computation has a linearcomputational complexity (O(N), where N is the number of atoms in the molecule considered.

Reducing the computing time: use of cutoff in UNB

Notes on computing the energy

Tamar Schlick, “Molecular Modeling and Simulation”, Springer

Page 36: Molecular Dynamicshome.ku.edu.tr/~okeskin/CMSE520/MD1.pdf · Molecular Dynamics • Time is of the essence in biological ... Statistical Mechanics • Ensemble – very many copies

36

( ) ( )∑∑ +⎥⎥

⎢⎢

⎟⎟⎠

⎞⎜⎜⎝

⎛−⎟

⎟⎠

⎞⎜⎜⎝

⎛=

ji ij

jiijij

ji ij

ij

ij

ijijijijNB r

qqrS

rR

rR

rSU, 0,

612

42

επεωεω

Cutoff schemes for faster energy computation

ωij : weights (0< ωij <1). Can be used to exclude bonded terms, or to scale some interactions (usually 1-4)

S(r) : cutoff function.

Three types:

1) Truncation:⎩⎨⎧

≥<

=brbr

rS01

)(b

Cutoff schemes for faster energy computation

2. Switching

a b

[ ]⎪⎩

⎪⎨

>≤≤−+

<=

brbraryry

arrS

03)(2)(1

1)( 2

with 22

22

)(abarry

−−

=

3. Shifting

b

brbrrS ≤

⎥⎥⎦

⎢⎢⎣

⎡⎟⎠⎞

⎜⎝⎛−=

22

1 1)(

brbrrS ≤⎥⎦⎤

⎢⎣⎡ −=

2

2 1)(

or

Page 37: Molecular Dynamicshome.ku.edu.tr/~okeskin/CMSE520/MD1.pdf · Molecular Dynamics • Time is of the essence in biological ... Statistical Mechanics • Ensemble – very many copies

37

• Shifting function is an important concept if the non bonded interactions are concerned.

• In a simulation using periodic boundary condition, minimal image convention should be seriously taken in to account.

• The cut off distance should be half of the periodic box in order to preventsystem from interacting with itself.

However, this truncation causes discontinuity in potential energy function, so the potential function can not be differentiated. Therefore, a cut off length rc < Lx/2 is introduced and the potential energy functions are modified as follows:

• For the Lennard-Jones potential it is conventionally taken as rc = 2.5σ.

Notes on computing the energy

Tamar Schlick, “Molecular Modeling and Simulation”, Springer

Various cutoff schemes, potential switch and two types of potential shift with buffer regions of 8-12A (electrostatic), and 6-10 A (vdw)

Switch function alters the non-bonded energy smoothly and gradually over the buffer region [a-b].

Shift functionavoid the sudden changes in force that occur with truncation and switch functions.

Page 38: Molecular Dynamicshome.ku.edu.tr/~okeskin/CMSE520/MD1.pdf · Molecular Dynamics • Time is of the essence in biological ... Statistical Mechanics • Ensemble – very many copies

38

Stoichastic Dynamics: Governing dynamic equations include stochastic forces that mimic solvent effects, in addition to systematic force.

Page 39: Molecular Dynamicshome.ku.edu.tr/~okeskin/CMSE520/MD1.pdf · Molecular Dynamics • Time is of the essence in biological ... Statistical Mechanics • Ensemble – very many copies

39

An ensemble is a collection of all possible systems which have different microscopic states but have an identical macroscopic or thermodynamic state.

There exist different ensembles with different characteristics.

• Microcanonical ensemble (NVE) : The thermodynamic state characterized by a fixed number of atoms, N, a fixed volume, V, and a fixed energy, E. This corresponds to an isolated system.

• Canonical Ensemble (NVT): This is a collection of all systems whose thermodynamic state is characterized by a fixed number of atoms, N, a fixed volume, V, and a fixed temperature, T.

• Isobaric-Isothermal Ensemble (NPT): This ensemble is characterized by a fixed number of atoms, N, a fixed pressure, P, and a fixed temperature, T.

• Grand canonical Ensemble (µVT): The thermodynamic state for this ensemble is characterized by a fixed chemical potential, µ, a fixed volume, V, and a fixed temperature, T.

MD at Constant T and PThe study of molecular properties as a function of T and P, rather than V and E is of general interest

Thus microcanonical ensembles that allow energy and volume to fluctuate and require constant T and/or P are inappropriate for systems.

Page 40: Molecular Dynamicshome.ku.edu.tr/~okeskin/CMSE520/MD1.pdf · Molecular Dynamics • Time is of the essence in biological ... Statistical Mechanics • Ensemble – very many copies

40

Molecular Dynamics ensembles

• The method discussed above is appropriate for the micro-canonical ensemble: constant N (# of particles) V (volume) and ET (total energy = E + Ekin)

• In some cases, it might be more appropriate to simulate under constant Temperature (T) or constant Pressure (P):– Canonical ensemble: NVT– Isothermal-isobaric: NPT– Constant pressure and enthalpy: NPH

How do you simulate at constant temperature and pressure?How do you simulate at constant temperature and pressure?

• Bath supplies or removes heat from the system as appropriate

• Exponentially scale the velocities at each time step by the factor λ:

where τ determines how strong the bath influences the system

Simulating at constant T: the Berendsen scheme

systemHeat bath

Berendsen et al. Molecular dynamics with coupling to an external bath. J. Chem. Phys. 81:3684 (1984)

⎟⎠⎞

⎜⎝⎛ −

∆−=

TTt bath11

τλ T: “kinetic” temperature

Page 41: Molecular Dynamicshome.ku.edu.tr/~okeskin/CMSE520/MD1.pdf · Molecular Dynamics • Time is of the essence in biological ... Statistical Mechanics • Ensemble – very many copies

41

Simulating at constant P: Berendsen scheme

• Couple the system to a pressure bath

• Exponentially scale the volume of the simulation box at each time step by a factor λ:

where κ : isothermal compressibility τP : coupling constant

systempressure bath

Berendsen et al. Molecular dynamics with coupling to an external bath. J. Chem. Phys. 81:3684 (1984)

( )bathP

PPt−

∆−=

τκλ 1 ⎟

⎞⎜⎝

⎛•+= ∑

=

N

iiikin FxE

vP

132

where

υ : volumexi: position of particle iFi : force on particle i

MD as a tool for minimizationEnergy

positionEnergy minimizationstops at local minima

Molecular dynamicsuses thermal energyto explore the energysurface

State A

State B

Page 42: Molecular Dynamicshome.ku.edu.tr/~okeskin/CMSE520/MD1.pdf · Molecular Dynamics • Time is of the essence in biological ... Statistical Mechanics • Ensemble – very many copies

42

Crossing energy barriers

A

B

I

∆G

Position

Ener

gy

time

Posi

tion

State A

State B

The actual transition time from A to B is very quick (a few pico seconds).

What takes time is waiting. The average waiting time for going from A to B can beexpressed as:

kTG

BA Ce∆

→ =τ

R.H. Stote et al, Biochemistry, v.43, no.24, p.7687-7697 (2004)

Page 43: Molecular Dynamicshome.ku.edu.tr/~okeskin/CMSE520/MD1.pdf · Molecular Dynamics • Time is of the essence in biological ... Statistical Mechanics • Ensemble – very many copies

43

HW:”””””” ht 34<Z<111111111111111111111111111111111111111 >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> Baaaaaaaaaaaaaaaaaaaaaaaaaaaaaq111111111111111111111111vccbvb y

Page 44: Molecular Dynamicshome.ku.edu.tr/~okeskin/CMSE520/MD1.pdf · Molecular Dynamics • Time is of the essence in biological ... Statistical Mechanics • Ensemble – very many copies

44

Molecular Simulations

• Molecular Mechanics: energy minimization

• Molecular Dynamics: simulation of motions

• Monte Carlo methods: sampling techniques

Page 45: Molecular Dynamicshome.ku.edu.tr/~okeskin/CMSE520/MD1.pdf · Molecular Dynamics • Time is of the essence in biological ... Statistical Mechanics • Ensemble – very many copies

45

Monte Carlo: random sampling

A simple example:Evaluate numerically the one-dimensional integral:

Instead of using classical quadrature, the integral can be rewritten as

∫=b

adxxfI )(

)()( xfabI −=<f(x)> denotes the unweighted average of f(x) over [a,b], and can bedetermined by evaluating f(x) at a large number of x values randomlydistributed over [a,b]

Monte Carlo method!

Page 46: Molecular Dynamicshome.ku.edu.tr/~okeskin/CMSE520/MD1.pdf · Molecular Dynamics • Time is of the essence in biological ... Statistical Mechanics • Ensemble – very many copies

46

Page 47: Molecular Dynamicshome.ku.edu.tr/~okeskin/CMSE520/MD1.pdf · Molecular Dynamics • Time is of the essence in biological ... Statistical Mechanics • Ensemble – very many copies

47

Brief Account of MC, MDN ~ 100 – 10,000Periodic boundariesPrescribed intermolecular potential

Monte Carlo

Specify N, V, T

Generate random moves

Sample with P α exp(-Υ /kT)

Take averages

Obtain equilibrium properties

Molecular Dynamics

Specify N, V, E

Solve Newton’s equations Fi = mi ai

Calculate ri(t), vi(t)

Obtain equilibrium and nonequilibrium properties

Take averages

Monte Carlo Simulation• MC techniques applied to molecular simulation,

almost always involves a Markov process– move to a new configuration from an existing

one according to a well-defined transition probability

• Simulation procedure– generate a new “trial” configuration by making a

perturbation to the present configuration– accept the new configuration based on the ratio

of the probabilities for the new and old configurations, according to the Metropolis algorithm

– if the trial is rejected, the present configuration is taken as the next one in the Markov chain

– repeat this many times, accumulating sums for averages

new

old

U

U

e

e

β

β

State k

State k+1

taken from D. A. Kofke’s lectures on Molecular Simulation, SUNY Buffalohttp://www.eng.buffalo.edu/~kofke/ce530/index.html

Page 48: Molecular Dynamicshome.ku.edu.tr/~okeskin/CMSE520/MD1.pdf · Molecular Dynamics • Time is of the essence in biological ... Statistical Mechanics • Ensemble – very many copies

48

Differences Between MC and MD

• MD gives information about dynamical behavior, as well as equilibrium, thermodynamic properties. Thus, transport properties can be calculated. MC can only give static, equilibrium properties

• MC can be more easily adapted to other ensembles:- µ, V, T (grand canonical)- N, V, T (canonical)- N, P, T (isobaric-isothermic)

• In MC motions are artificial - in MD they are natural

• In MC we can use special techniques to achieve equilibrium. For example, can ‘observe’ formation of micelles, slow phase transitions.

Page 49: Molecular Dynamicshome.ku.edu.tr/~okeskin/CMSE520/MD1.pdf · Molecular Dynamics • Time is of the essence in biological ... Statistical Mechanics • Ensemble – very many copies

49

The Monte Carlo Method• In MC simulations the average value is approximated by generating a large number of trial configurations xN using a random number generator, and replacing the integrals by sums over a finite number of configurations.

•Random sampling: Suppose we choose configurations xN randomly, so the average becomes

( ) ( )

( )

exp

expj

j

A j j kTA

j kT

−⎡ ⎤⎣ ⎦=

−⎡ ⎤⎣ ⎦

∑∑

U

U

Monte Carlo Sampling for protein structure

∫ ⎟⎠⎞

⎜⎝⎛−

⎟⎠⎞

⎜⎝⎛−

=dZ

kTZE

kTXE

XP)(exp

)(exp)(

The probability of finding a protein (biomolecule) with a total energy E(X) is:

Partition function

Estimates of any average quantity of the form:

∫= dXXPXAA )()(using uniform sampling would therefore be extremely inefficient.

Metropolis and coll. developed a method for directly sampling according to theactual distribution.

Metropolis et al. Equation of state calculations by fast computing machines. J. Chem. Phys. 21:1087-1092 (1953)

Page 50: Molecular Dynamicshome.ku.edu.tr/~okeskin/CMSE520/MD1.pdf · Molecular Dynamics • Time is of the essence in biological ... Statistical Mechanics • Ensemble – very many copies

50

Monte Carlo for the canonical ensemble

• The canonical ensemble corresponds to constant NVT.• The total energy (Hamiltonian) is the sum of the kinetic

energy and potential energy: E=Ek(p)+Ep(X)• If the quantity to be measured is velocity independent, it

is enough to consider the potential energy:

⎟⎠

⎞⎜⎝

⎛−

⎟⎠

⎞⎜⎝

⎛−

=

⎟⎠

⎞⎜⎝

⎛−⎟

⎠⎞

⎜⎝⎛−

⎟⎠

⎞⎜⎝

⎛−⎟

⎠⎞

⎜⎝⎛−

=

dXkT

XE

dXkT

XEXA

dXdpkT

XEkT

pE

dXdpkT

XEkT

pEXAA

p

p

pk

pk

)(exp

)(exp)(

)(exp)(exp

)(exp)(exp)(

The kinetic energydepends on themomentum p; it canbe factored and canceled.

Monte Carlo for the canonical ensemble

∫ ⎟⎠

⎞⎜⎝

⎛−

⎟⎠

⎞⎜⎝

⎛−

=dZ

kTZE

kTXE

XPp

p

)(exp

)(exp

)(

)( YX →π

Let:

And let be the transition probability from state X to state Y.

Let us suppose we carry out a large number of Monte Carlo simulations, such thatthe number of points observed in conformation X is proportional to N(X). The transition probability must satisfy one obvious condition: it should not destroythis equilibrium once it is reached. Metropolis proposed to realize this usingthe detailed balance condition:

⎟⎟⎠

⎞⎜⎜⎝

⎛ −−==

→→

→=→

kTXEYE

XPYP

XYYX

XYYPYXXP

pp )()(exp

)()(

)()(

)()()()(

ππ

ππor

Page 51: Molecular Dynamicshome.ku.edu.tr/~okeskin/CMSE520/MD1.pdf · Molecular Dynamics • Time is of the essence in biological ... Statistical Mechanics • Ensemble – very many copies

51

Monte Carlo for the canonical ensemble

⎪⎩

⎪⎨

>⎟⎟⎠

⎞⎜⎜⎝

⎛ −−

=→)()(1

)()()()(

exp)(XEYEif

XEYEifkT

XEYEYX

pp

pppp

π

There are many choices for the transition probability that satisfy the balancecondition. The choice of Metropolis is:

The Metropolis Monte Carlo algorithm:

1. Select a conformation X at random. Compute its energy E(X)

2. Generate a new trial conformation Y. Compute its energy E(Y)

3. Accept the move from X to Y with probability:

4. Repeat 2 and 3.

⎟⎟⎠

⎞⎜⎜⎝

⎛ −−=

kTXEYE

P pp )()(exp,1min(

Pick a random numberRN, uniform in [0,1].If RN < P, accept themove.

Monte Carlo for the canonical ensemble

Notes:

1. There are many types of Metropolis Monte Carlo simulations, characterized by the generation of the trial conformation.

2. The random number generator is crucial

3. Metropolis Monte Carlo simulations are used for finding thermodynamics quantities, for optimization, …

4. An extension of the Metropolis algorithm is often used for minimization: the simulated annealing technique, where the temperature is lowered as the simulation evolves, in an attempt to locate the global minimum.