molecular dynamics basics i - home - gclab · 2009-03-21 · molecular dynamics •this simple...

55
1 WS2004/2005 Molecular Dynamics Basics I Michela Taufer The material used in class is based on material from: Scientific Computing and Visualization (course given at USC) http://cacs.usc.edu/education/cs596_f05.htmlHigh Performance Computing and Simulations (course given at USC) at http://cacs.usc.edu/education/cs653_s06.html Molecular dynamics simulatiosn with Charmm at http://www.ch.embnet.org/MD_tutorial/ The material is also based on these two books: The Art of Molecular Dynamics Simulation by D.C. Rapaport Molecular modeling, Principles and Applications by A. R. Leach 3 A first rudimental model Three most familiar states of matter: o solid o liquid o gas Rudimental model for a substance capable to exist in one of the most familiar states of matter: o Spherical particles that interact with each other particle = atom

Upload: others

Post on 06-Jun-2020

0 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: Molecular Dynamics Basics I - Home - GCLab · 2009-03-21 · Molecular Dynamics •This simple application is the principle on which the Molecular Dynamics algorithm is based!! •Given

1

WS2004/2005

Molecular Dynamics Basics I

Michela Taufer

The material used in class is based on material from:Scientific Computing and Visualization (course given at USC)http://cacs.usc.edu/education/cs596_f05.htmlHigh Performance Computing andSimulations (course given at USC) at http://cacs.usc.edu/education/cs653_s06.htmlMolecular dynamics simulatiosn with Charmm at http://www.ch.embnet.org/MD_tutorial/

The material is also based on these two books:The Art of Molecular Dynamics Simulation by D.C. RapaportMolecular modeling, Principles and Applications by A. R. Leach

3

A first rudimental model

• Three most familiar states of matter:o solido liquido gas

• Rudimental model for a substance capable to exist inone of the most familiar states of matter:o Spherical particles that interact with each other

particle = atom

Page 2: Molecular Dynamics Basics I - Home - GCLab · 2009-03-21 · Molecular Dynamics •This simple application is the principle on which the Molecular Dynamics algorithm is based!! •Given

2

4

Physical system

Physical system is equivalent to a set of atomic coordinates(vector notation):

where is the set of real numbers

!

"

atom

container

5

Limits

Model: very simplePhysical system that can be represented: limited, e.g., gas

at low density BUT has much in common with moredetailed models and is simple computationally

atom

container that keeps the atoms together

Page 3: Molecular Dynamics Basics I - Home - GCLab · 2009-03-21 · Molecular Dynamics •This simple application is the principle on which the Molecular Dynamics algorithm is based!! •Given

3

6

Data structures in md.c

int nAtom --> N, the number of atomsNMAX --> Maximum number of atoms that can be handled

by the programdouble r[NMAX][3] --> r[i][0], r[i][1], and r[i][2] are the x, y,

and z coordinates of the i-th atom, where i = 0, .., N-1

7

Trajectory

• A mapping from time to a point in the 3-dimensional space:

• A trajectory of an N-atom system is regarded as a curve in 3N-dimensional space:

• A point on the curve is then specified by a 3N-element vector:

Page 4: Molecular Dynamics Basics I - Home - GCLab · 2009-03-21 · Molecular Dynamics •This simple application is the principle on which the Molecular Dynamics algorithm is based!! •Given

4

8

Velocity: definition

• To answer the question: how fast and in what direction aatom is moving?

• Velocity is the short-time limit of an average speed:

9

Velocity: data structures

double rv[NMAX][3]rv[i][0], rv[i][1], and rv[i][2] are the x, y, and z components of

the velocity vector of the i-th atom.

Page 5: Molecular Dynamics Basics I - Home - GCLab · 2009-03-21 · Molecular Dynamics •This simple application is the principle on which the Molecular Dynamics algorithm is based!! •Given

5

10

Acceleration: definition

• To answer the question: is the atom accelerating ofdecelerating?

• Rate at which a velocity changes:

11

Acceleration: definition

• The acceleration of a particle can be estimated fromthree consecutive positions on its trajectory separated bysmall time increments:

Page 6: Molecular Dynamics Basics I - Home - GCLab · 2009-03-21 · Molecular Dynamics •This simple application is the principle on which the Molecular Dynamics algorithm is based!! •Given

6

12

Acceleration: data structures

double ra[NMAX][3]ra[i][0], ra[i][1], and ra[i][2] are the x, y, and z components of

the acceleration vector, , of the i-th atom.

13

Atom interactions

• Interaction between pairs of atoms• Interaction responsible for providing the two principal

features of an interatomic force:1. Short range repulsion: interaction repeals at close range

2. Long range attraction: atoms must attract each otherover a range of separation

Page 7: Molecular Dynamics Basics I - Home - GCLab · 2009-03-21 · Molecular Dynamics •This simple application is the principle on which the Molecular Dynamics algorithm is based!! •Given

7

14

Potential functions

• Potential functions that exhibit these characteristics(repulsion and attraction) provide useful models for realsubstances

• Best-known of these potentials: Lennard-Jones (L-J)

15

Lennard-Jones potential (I)

Atoms: i and jLocations: ,Potential energy:

where:

!

u rij( ) =4"

#

rij

$

% & &

'

( ) )

12

*#

rij

$

% & &

'

( ) )

6+

,

- -

.

/

0 0

0 rij 1 rc

rij < rc

2

3 4

5 4

!

rij = rji

is a distance unit and

defines a length scale

is a unit of energy and governs

the strength of interactions

Page 8: Molecular Dynamics Basics I - Home - GCLab · 2009-03-21 · Molecular Dynamics •This simple application is the principle on which the Molecular Dynamics algorithm is based!! •Given

8

16

Lennard-Jones potential (II)

Pair potential:

17

Newton’s Second Law of motion:definition• Newton’s equation of motion is given by:

where Fi is the force exerted on particle i, mi is the massof particle i and ai is the acceleration of particle i.

• The force can also be expressed as the gradient of thepotential energy:

Page 9: Molecular Dynamics Basics I - Home - GCLab · 2009-03-21 · Molecular Dynamics •This simple application is the principle on which the Molecular Dynamics algorithm is based!! •Given

9

18

Newton’s Second Law of motion:definition• Combining these two equations yields

where V is the potential energy of the system.

• Newton’s equation of motion can then relate thederivative of the potential energy to the changes inposition as a function of time.

19

Simple Application (con’t)

Consider the Newton’s equation:

Taking the simple case where the acceleration is constant:

we obtain an expression for the velocity after integration:

Page 10: Molecular Dynamics Basics I - Home - GCLab · 2009-03-21 · Molecular Dynamics •This simple application is the principle on which the Molecular Dynamics algorithm is based!! •Given

10

20

Simple application (con’t)

Since:

we can once again integrate to obtain:

• Combining this equation with the expression for thevelocity,we obtain the following relation which gives thevalue of x at time t as a function of the acceleration, a,the initial position, x0 , and the initial velocity, v0:

21

Simple application (con’t)

• The acceleration is given as the derivative of thepotential energy with respect to the position, r:

Page 11: Molecular Dynamics Basics I - Home - GCLab · 2009-03-21 · Molecular Dynamics •This simple application is the principle on which the Molecular Dynamics algorithm is based!! •Given

11

22

Molecular Dynamics

• This simple application is the principle on which theMolecular Dynamics algorithm is based!!

• Given the initial positions of the atoms, an initialdistribution of velocities and the acceleration, which isdetermined by the gradient of the potential energyfunction, we can calculate a trajectory

• The equations of motion are deterministic:o the positions and the velocities at time zero determine the

positions and velocities at all other times, t.• The initial positions can be obtained from experimental

structures:o the x-ray crystal structure of the proteino the solution structure determined by NMR spectroscopy

23

Newton’s Second Law of motion:revision is a vector and so is the force, then:

Potential energy:

Partial derivate:

Pair potential:

Page 12: Molecular Dynamics Basics I - Home - GCLab · 2009-03-21 · Molecular Dynamics •This simple application is the principle on which the Molecular Dynamics algorithm is based!! •Given

12

24

Normalization: definition

• Introduction of a dimensionless representation of theNewton’s equation for atoms interacting with theLennard-Jones potential

• Why do we normalize?

25

Normalization: motivations

• Ability to work with numerical values that are not toodistant from unity, instead of extremely small valuesnormally associated with the atomic scale

• The equations of motion are simplified because some, ifnot all, of the parameters defining the model areabsorbed into the units

• A simple model can describe a whole class of problems,and once the properties have been measured indimensionless units they can easily be scaled to theappropriate physical units for each problem of interest

• Remove any risk of enouncing values lying outside therange that is repeatable by the computer hardware

Page 13: Molecular Dynamics Basics I - Home - GCLab · 2009-03-21 · Molecular Dynamics •This simple application is the principle on which the Molecular Dynamics algorithm is based!! •Given

13

26

Molecular dynamics: algorithm

Given initial atomic positions and velocities:

Obtain those at later times:

By integrating the ordinary differential equation:

where:For the Lennard-Jonespotential in a dimensional unit

27

Molecular dynamics: code

Force calculation algorithm:

Page 14: Molecular Dynamics Basics I - Home - GCLab · 2009-03-21 · Molecular Dynamics •This simple application is the principle on which the Molecular Dynamics algorithm is based!! •Given

14

28

Discretization• Rather than a continuous time, we consider a sequence of

states• Snapshots with the time interval D: double DeltaT

Question: How do we predict , from thecurrent time ?Answer: Taylor expansion

29

Integration algorithms (I)

• The potential energy is a function of the atomic positions(3N) of all the atoms in the system.

• Due to the complicated nature of this function, there is noanalytical solution to the equations of motion; they mustbe solved numerically.

• Numerous numerical algorithms have been developedfor integrating the equations of motion:

o Verlet algorithmo Velocity Verleto Leap-frog algorithmo Beeman’s algorithm

Page 15: Molecular Dynamics Basics I - Home - GCLab · 2009-03-21 · Molecular Dynamics •This simple application is the principle on which the Molecular Dynamics algorithm is based!! •Given

15

30

Integration algorithms (II)

Important:In choosing which algorithm to use, consider the followingcriteria:• The algorithm should conserve energy and momentum• The algorithm should be computationally efficient• The algorithm should permit a long time step for

integration

31

Taylor expansion

• All the integration algorithms assume the positions,velocities and accelerations can be approximated by aTaylor series expansion:

Page 16: Molecular Dynamics Basics I - Home - GCLab · 2009-03-21 · Molecular Dynamics •This simple application is the principle on which the Molecular Dynamics algorithm is based!! •Given

16

32

Verlet algorithm: definition

To derive the Verlet algorithm one can write:

Summing these two equations, one obtains:

33

Verlet algorithm: analysis

• The Verlet algorithm uses positions and accelerations attime t and the positions from time t-dt to calculate newpositions at time t+dt.

• The Verlet algorithm uses no explicit velocities.• The advantages of the Verlet algorithm are:

o it is straightforwardo the storage requirements are modest .

• The disadvantage is that the algorithm is of moderateprecision

Page 17: Molecular Dynamics Basics I - Home - GCLab · 2009-03-21 · Molecular Dynamics •This simple application is the principle on which the Molecular Dynamics algorithm is based!! •Given

17

34

Verlet algorithm: pseudo-code

Verlet discretization:

Verlet pseudo-code:

Verlet discretization

35

Velocity Verlet: definition

• This algorithm yields positions, velocities andaccelerations at time t.

• There is no compromise on precision.

Page 18: Molecular Dynamics Basics I - Home - GCLab · 2009-03-21 · Molecular Dynamics •This simple application is the principle on which the Molecular Dynamics algorithm is based!! •Given

18

36

Velocity Verlet: pseudo-code

StepLimit steps are executedstepCount+1 calls to function computeAccel()

37

More about Velocity Verlet

!

x(t + "t) = x(t) + v(t)•"t +1

2• a(t)• ("t)

2

!

v(t +"t

2) = v(t) +

a(t)•"t

2

Calculate:

Definition:

Calculate:

Derivate from the interaction potential

!

a(t + "t)

Calculate:

!

v(t + "t) = v(t +"t

2) +

a(t + "t)•"t

2

Page 19: Molecular Dynamics Basics I - Home - GCLab · 2009-03-21 · Molecular Dynamics •This simple application is the principle on which the Molecular Dynamics algorithm is based!! •Given

19

38

Leap-frog algorithm: definition andanalysis• The velocities are first calculated at time t+1/2dt; these are used to

calculate the positions, r, at time t+dt.• In this way, the velocities leap over the positions, then the positions

leap over the velocities.

• The advantage of this algorithm is that the velocities are explicitlycalculated

• The disadvantage is that they are not calculated at the same time asthe positions.

39

Beeman’s algorithm: definition

• This algorithm is closely related to the Verlet algorithm

• The advantage of this algorithm is that it provides a more accurateexpression for the velocities and better energy conservation

• The disadvantage is that the more complex expressions make thecalculation more expensive

Page 20: Molecular Dynamics Basics I - Home - GCLab · 2009-03-21 · Molecular Dynamics •This simple application is the principle on which the Molecular Dynamics algorithm is based!! •Given

20

40

Velocity Verlet Algorithm• Theorem: The following algebraic equation gives the same

sequence of states, , as that obtained by the Verletdiscretization.

Velocity Verlet algorithm:

41

Velocity Verlet Algorithm for StepLimit Steps

stepCount+1 calls to function computeAccel()

Page 21: Molecular Dynamics Basics I - Home - GCLab · 2009-03-21 · Molecular Dynamics •This simple application is the principle on which the Molecular Dynamics algorithm is based!! •Given

21

42

Next …

• Now we have learned the skeleton of md.c program.• Next we will deal with some details of the program:

o Periodic boundary conditionso Shifted potentialo Energy conservation and temperatureo Initialization: fcc lattice, random velocity

WS2004/2005

Molecular Dynamics Basics II

Page 22: Molecular Dynamics Basics I - Home - GCLab · 2009-03-21 · Molecular Dynamics •This simple application is the principle on which the Molecular Dynamics algorithm is based!! •Given

22

44

Boundaries in our model

• Our model has boundaries and therefore does not yieldresults that resemble the behavior of infinite systems

• Unless the goal is to study the behavior near the realwalls, wall are better eliminated

• A system that is bounded but free of physical walls canbe constructed by using periodic boundaries conditions

45

Periodic boundary conditions

• Replicate the simulationbox to form an infinitelattice

• Enable a simulation to beperformed using a relativelysmall number of particles:

o particles experience forcesas though they were in abulk solution

• Forces on the primaryparticles are calculatedfrom particles within thesame box as well as in theimage box

Page 23: Molecular Dynamics Basics I - Home - GCLab · 2009-03-21 · Molecular Dynamics •This simple application is the principle on which the Molecular Dynamics algorithm is based!! •Given

23

46

Simulation region

double Region[3]: Three-element array containing the regionlengths, Lx, Ly, and Lz

2 dimension slide of the region

47

Consequences of periodicity (I)

• An atom that leaves the simulation box through aparticular bonding face immediately reenters the boxthrough the opposite face

Page 24: Molecular Dynamics Basics I - Home - GCLab · 2009-03-21 · Molecular Dynamics •This simple application is the principle on which the Molecular Dynamics algorithm is based!! •Given

24

48

Consequences of periodicity (II)

• Atoms lying within a distance rc of the boundary interactwith atoms in an adjacent copy of the box - wraparoundeffect

49

Wraparound effect on coding

• Wraparound effect of the periodic boundaries must beconsidered in:o The integration of the equations of motiono Interaction computations

Page 25: Molecular Dynamics Basics I - Home - GCLab · 2009-03-21 · Molecular Dynamics •This simple application is the principle on which the Molecular Dynamics algorithm is based!! •Given

25

50

Integration of the equations of motion• After the integration step the coordinates must be examined

• If an atom is found to have outside the simulation region, its coordinates must beadjusted to bring it back inside

Consider the region as a box ofsize Lx, Ly, and Lz

where:

51

Integration of the equations of motion

This means:

Page 26: Molecular Dynamics Basics I - Home - GCLab · 2009-03-21 · Molecular Dynamics •This simple application is the principle on which the Molecular Dynamics algorithm is based!! •Given

26

52

Interaction computations

• An atom interacts with all the images of another atom(and even with its own images except for itself).

• In practice, we make the simulation region larger enoughso that u(r > Lx/2) etc. can be neglected.

• Then an atom interacts with only the nearest image ofanother atom

53

Interaction computations (con’t)

• Define a region of size Lx × Ly × Lz centered at atom i• Atom i interacts only with other atoms in this imaginary

region

Page 27: Molecular Dynamics Basics I - Home - GCLab · 2009-03-21 · Molecular Dynamics •This simple application is the principle on which the Molecular Dynamics algorithm is based!! •Given

27

54

Interaction computations (con’t)

• This means:

55

Shifted potential in md.c

• If the region is not largeenough, the truncationcauses a significantdiscontinuity in the potentialfunction

o We cannot differentiate thepotential

• We modify the potential sothat both u( r) and du/dr arecontinuous at rc

Page 28: Molecular Dynamics Basics I - Home - GCLab · 2009-03-21 · Molecular Dynamics •This simple application is the principle on which the Molecular Dynamics algorithm is based!! •Given

28

56

Shifted potential in md.c

57

Set up a MD simulation

• Decide the energy model to describe the interactionswithin the systemo Empirical energy model

• Run simulationo Establish the initial configuration for the systemo Perform an equilibration phase to a stability state: the

system evolves from the initial configurationo Perform the production phase during which properties are

monitored and calculatedo Determine and analyze the system properties to

determine how the system changed and whether there areunusal behaviors

Page 29: Molecular Dynamics Basics I - Home - GCLab · 2009-03-21 · Molecular Dynamics •This simple application is the principle on which the Molecular Dynamics algorithm is based!! •Given

29

58

Initial state

• Initial state of the simulation:o coordinates of the atomso initial velocitieso accelerations

• The results of a simulation of adequate duration areinsensitive to the initial state ® equilibration phase

• The speed of equilibrium to a state in which there is nomemory of the arbitrary selected initial configuration isnormally quite rapid

59

Initial state: standard lattice structure

• Use a standard lattice structure

• Atoms are located at the sites of a regular lattice spacedto give the desired density

• Initial velocities are assigned random directions and afixed magnitude based on temperature

• Initial accelerations are set equal to zero

Face-centered cubic cell

Page 30: Molecular Dynamics Basics I - Home - GCLab · 2009-03-21 · Molecular Dynamics •This simple application is the principle on which the Molecular Dynamics algorithm is based!! •Given

30

60

Initial condition in HW1

• Unit {1,1,1}• How does Unit {3,3,3} looks like? How many total atoms

are part of the system?

{0.0, 0.5, 0.5} {0.0, 0.0, 0.0}

{0.5, 0.0, 0.5}

{0.5, 0.5, 0.0}

x

y

z

61

Initial state: other possibilities

• If experimentally determined arrangements are available:o X-ray crystal structureso NMR spectroscopy structureso Structures found in previous simulations

• These structures can be used as initial states

Page 31: Molecular Dynamics Basics I - Home - GCLab · 2009-03-21 · Molecular Dynamics •This simple application is the principle on which the Molecular Dynamics algorithm is based!! •Given

31

62

Conservation law: velocity

• Velocity, momentum, and energy are properties of the particles in asystem

• Velocity tells us how fast an object is moving (its speed) along withthe direction in which it is moving.

o For example, if you tell me that you are riding your bike at 10miles per hour, you have told me your speed. But if you tell meyou are riding North at 10mph, you have told me your velocity.

• Typical speeds of some moving objects:o person walking: 2 meters/secondo fast airplane: 1000 meters/secondo light (which moves faster than anything): 300,000,000

meters/second

63

Conservation law: momentum

• Momentum tells us how hard it is to change the way anobject is moving.

• Suppose a baby duck is crossing the sidewalk. You seean empty grocery cart rolling down the sidewalk at 3meters/second. Quickly, you shove the cart aside andsave the bird. But another cart comes rolling along at 3meters/second -- only this one is full of rocks. To deflectthe full cart from the duckling, do you have to push thesame, harder, less hard?

• An object's momentum is its mass multiplied by itsvelocity: Momentum = mass * velocity.

• Note: In our code we assume the atoms have unit mass

Page 32: Molecular Dynamics Basics I - Home - GCLab · 2009-03-21 · Molecular Dynamics •This simple application is the principle on which the Molecular Dynamics algorithm is based!! •Given

32

64

Conservation law: energy

• The energy of a particle tells us about its ability to dowork, to change the world around it. The different kindsof energy include:o The kinetic energy of a particle is related to how fast the

particle is moving; the faster a particle goes, the morekinetic energy it has.

o Kinetic Energy = (1/2)*mass*velocity2

o The potential energy of a particle (L-J potential)

65

Conservation law

• When particles collide, the total energy of the group ofparticles and their total momentum are the same before,during, and after the collision.

• We say that both the energy and momentum areconstant or conserved

Page 33: Molecular Dynamics Basics I - Home - GCLab · 2009-03-21 · Molecular Dynamics •This simple application is the principle on which the Molecular Dynamics algorithm is based!! •Given

33

66

Conservation of the momentum

• The momentum (or total velocity, since all atoms haveunit mass) of the system should remain exactly zeroo Search in the code where the momentum is initialized to

zero• This test serves as a simple -but only partial - check on

the correctness of the calculations

67

Conservation of the energy

• The total energy of the system is the sum of the potentialenergy and the kinetic energy

• The total energy E does not change in time, if Newton’sequation is exactly integrated

where:

Page 34: Molecular Dynamics Basics I - Home - GCLab · 2009-03-21 · Molecular Dynamics •This simple application is the principle on which the Molecular Dynamics algorithm is based!! •Given

34

68

Equilibrium

• Different quantities relax to their equilibrium averages atdifferent rates

• When is it the time ripe to begin making measurements?• Relaxation is generally quit rapid• Equilibrium can be accelerated by starting the simulation

at a higher temperature and later cooling ito It can be done by rescaling the velocityo High temperature leads to numerical instability

• Equilibrium can be measured

69

Equilibrium

• One simple measure of equilibrium is the rate at whichvelocity distribution converges to its expected final form: f(v) ~ vd-1 e -v^2 /2T (Maxell distribution in MD units)

• The velocity distribution can be measured in the programby construction a histogram of the velocities value

{hn | n = 1, …Nb}where hb is the number of atoms with velocity magnitudebetween (n-1) Dv and n Dv

Dv = vm / Nb

vm is a suitable upper limit of v• The normalized histogram represents a discrete

approximation to f(v)

Page 35: Molecular Dynamics Basics I - Home - GCLab · 2009-03-21 · Molecular Dynamics •This simple application is the principle on which the Molecular Dynamics algorithm is based!! •Given

35

70

Thermodynamic properties

• System properties, e.g.,o Energyo Heat capabilityo Pressureo Temperature

• Property A depends upon the positions and momentumof the N atoms:

!

A = f (pN(t),r

N(t)) =

= A(p1,x1, p1,y1, p1,z1, p2,x2,...,x1,y1,z1,x2,.....,t)

WS2004/2005

Molecular Dynamics Basics III

Page 36: Molecular Dynamics Basics I - Home - GCLab · 2009-03-21 · Molecular Dynamics •This simple application is the principle on which the Molecular Dynamics algorithm is based!! •Given

36

72

Complexity of computing interactions

• Most time-demanding part of MD/MC simulations is thecalculation of the non-bonded energies and forces

• We know that:o Lennard-Jones potential falls off very rapidly with the

distance - we can reduce the interactions by using a cutoffdistance

o Calculate all the N(N-1) distances takes almost as muchtime as calculating the energy itself

o In a simulations, an atom’s neighbors do not chancesignificantly over 10 or 20 MD time steps

73

Complexity of computing interactions

• Computational complexity ofComputeAccel() in md.c:

• Data locality (cut-off length, rc)reduces the complexity to O(N):

• O(N) algorithm uses:(1) spatially localized cells;(2) linked lists to keep track of

atoms cell membership

Page 37: Molecular Dynamics Basics I - Home - GCLab · 2009-03-21 · Molecular Dynamics •This simple application is the principle on which the Molecular Dynamics algorithm is based!! •Given

37

74

Cell Data Structure (I)

Algorithm:• Divide the simulation box into small cells of equal size• The edge length of a cell must be at least rc

• An atom in a cell interacts with ONLY the other atoms inthe same cell and its 26 neighbor cells

75

Cell Data Structure (II)

Page 38: Molecular Dynamics Basics I - Home - GCLab · 2009-03-21 · Molecular Dynamics •This simple application is the principle on which the Molecular Dynamics algorithm is based!! •Given

38

76

Non-bonded Neighbor List (I)

• Neighbors of atom i: all the atoms within the cutoff distance, together withall atoms that are slightly further away that the cutoff

17

12

abcdefast

Neighbors of

Atom 1

Neighbors of

Atom 2

Neighbors of

Atom 3

P

L

i: L[P[I]]…L[P[I+1]-1]

77

Non-bonded Neighbor List (II)

• The neighbor list is updated at regular intervalso Correct frequency for updates is importanto The list L can be very long

• Possible optimization ® Linked-list algorithmo Divide the system in cells with length longer than the non-

bonded cutoff distanceo Neighbors are either in the cell containing the atom or in a

surrounding cello M3 cells with average M3/N atomso To determine the atom neighbor, consider just 27*M3/N

rather than N

Page 39: Molecular Dynamics Basics I - Home - GCLab · 2009-03-21 · Molecular Dynamics •This simple application is the principle on which the Molecular Dynamics algorithm is based!! •Given

39

78

Linked Lists Algorithm (I)

79

Linked List Algorithm (II)

Page 40: Molecular Dynamics Basics I - Home - GCLab · 2009-03-21 · Molecular Dynamics •This simple application is the principle on which the Molecular Dynamics algorithm is based!! •Given

40

80

Linked List Algorithm (III)

Still we need mechanismsto update the two linked lists ….

WS2004/2005

Advanced Molecular Dynamics

Page 41: Molecular Dynamics Basics I - Home - GCLab · 2009-03-21 · Molecular Dynamics •This simple application is the principle on which the Molecular Dynamics algorithm is based!! •Given

41

82

Force field methods

• Force filed methods (or molecular mechanics methods)calculate the energy of a molecular system as a functionof the nuclear position

• Molecular systems contains a large number of atoms• Energetic penalties are associated with the deviation of

bonds and angles from their “reference” or “equilibriumvalues”

83

Force fields

• Force field functions = Potential energy functions• Define a force field function:

o Type and number of functional termso Parameters in the functional terms

Example of functional form for a force field:

!

V (rN) =

ki

2li " li,0( )

bonds

#2

+ki

2$i "$i,0( )

angles

#2

+ki

21+ cos(n% " &)( )

torsions

#

+ 4'ij( i, j

ri, j

)

* + +

,

- . .

12

"( i, j

ri, j

)

* + +

,

- . .

6/

0

1 1

2

3

4 4

+qiq j

45'0ri, j

)

*

+ +

,

-

.

. j= i+1

N

#i=1

N

#

Page 42: Molecular Dynamics Basics I - Home - GCLab · 2009-03-21 · Molecular Dynamics •This simple application is the principle on which the Molecular Dynamics algorithm is based!! •Given

42

84

Force fields (con’t)

• Two force fields may use an identical functional form andhave very different parameters

• Force fields with the same functional form but differentparameters and force fields with different functionalforms may give results of comparable accuracy

• Commonly used potential energy functions are theAMBER, CHARMM, GROMOS and OPLS/AMBER forcefields

85

Force fields (con’t)

• A force field is generally designed to predict certain propertiesof a molecular system and is parameterized accordantlyo Other quantities not included in the parameterization

process cannot necessarily be captured by a force field• Same set of parameters can be used to model a series of

moleculeso This is called transformability

• Force fields are empiricalo There is not a correct form for a force fieldo Functional forms are a compromise between accuracy and

computational efficiencyo As computer performance increases, it becomes possible

to incorporate more sophisticated molecules

Page 43: Molecular Dynamics Basics I - Home - GCLab · 2009-03-21 · Molecular Dynamics •This simple application is the principle on which the Molecular Dynamics algorithm is based!! •Given

43

86

Atom types in force fields

• Assign atom type to each atomo Same atom can have different types, e.g., not all the

carbon atoms are the same• We can identify general-use force fields and specific-

purpose force fileso Force fields modeling specific classes of molecules use

more specific atom types than force fields designed forgeneral purpose use

o Example: In AMBER, a carbon atom at the junctionbetween a six and five-membered ring is different than acarbon atom n an isolated five-membered ring

87

CHARMM force field function

• The value of the energy is calculated as a sum ofinternal, or bonded, terms Ebonded, which describe thebonds, angles, and bond rotations in a molecule, and asum of external or non-bonded terms, Enon-bonded

where:

L-J potential

Page 44: Molecular Dynamics Basics I - Home - GCLab · 2009-03-21 · Molecular Dynamics •This simple application is the principle on which the Molecular Dynamics algorithm is based!! •Given

44

88

Bonded interactions

• Bond-stretch• Bond-bend• Rotate-along-bond

!

V (rN) =

ki

2li " li,0( )

bonds

#2

+ki

2$i "$i,0( )

angles

#2

+ki

21+ cos(n% " &)( )

torsions

#

89

Bond-stretch

• Describes the interaction between atomic pairs whereatoms are separated by one covalent bond

Page 45: Molecular Dynamics Basics I - Home - GCLab · 2009-03-21 · Molecular Dynamics •This simple application is the principle on which the Molecular Dynamics algorithm is based!! •Given

45

90

Bond-bend

• Describes the deviation from an ideal geometry, i.e., thealteration of bond angles from ideal values

91

Rotate-along-bond

• Models the presence of steric barriers between atomsseparated by 3 covalent bonds

Page 46: Molecular Dynamics Basics I - Home - GCLab · 2009-03-21 · Molecular Dynamics •This simple application is the principle on which the Molecular Dynamics algorithm is based!! •Given

46

92

Non-bonded interactions

• Non-bonded interactions in the CHARMM potentialfunction has two major components:o Electrostatic interaction energy - charges reproduce the

electrostatic properties of the moleculeo Van der Waals interaction energy - a balance between

repulsive and attractive forces

!

V (rN) = 4"ij

# i, j

ri, j

$

% & &

'

( ) )

12

*# i, j

ri, j

$

% & &

'

( ) )

6+

,

- -

.

/

0 0 +

qiq j

41"0ri, j

$

%

& &

'

(

) )

j= i+1

N

2i=1

N

2

93

Non-bonded interactions (con’t)

Page 47: Molecular Dynamics Basics I - Home - GCLab · 2009-03-21 · Molecular Dynamics •This simple application is the principle on which the Molecular Dynamics algorithm is based!! •Given

47

94

Electrostatic

• Partial atomic charges: approach that restricts charges to thenuclear centers of the atoms

• How are partial charges obtained?o Partial atomic charges are not experimentally observable

quantities and cannot unambiguously calculated• Alternative approaches to the calculation of electrostatic interaction

are possible:o E.g., central multipole expansion based upon electric moments or

multipoles

!

V (rN) =

qiq j

4"#0ri, j

$

% & &

'

( ) )

j= i+1

N

*i=1

N

*

95

Electrostatic (con’t)

• The electrostatic interaction between a pair of atoms isrepresented by Coulomb potential

• D is the effective dielectric function for the medium and ris the distance between two atoms having charges qi andqk

Page 48: Molecular Dynamics Basics I - Home - GCLab · 2009-03-21 · Molecular Dynamics •This simple application is the principle on which the Molecular Dynamics algorithm is based!! •Given

48

96

Van der Waals

• Electrostatic interactions cannot account for all of thenon-bonded interactions in a molecular systemso Rare gas atoms have multiple moments equal to zeroo Rare gases have liquid and solid phases

• Interaction energy of two gas atoms varies with theseparationo Zero energy at infinite distance

97

Van der Walls (con’t)

Repulsion rapidlyincreases as thedistance tends to zero

Attraction passesthrough a minimum

Attraction is zero atinfinite distance

Page 49: Molecular Dynamics Basics I - Home - GCLab · 2009-03-21 · Molecular Dynamics •This simple application is the principle on which the Molecular Dynamics algorithm is based!! •Given

49

98

Van der Waals

Van der Waals interaction ismost often modeled usingthe Lennard-Jones 12 - 6

s collision diametere well-depth

The van der Waalsinteractions are one of themost important for thestability of the biologicalmacromolecules

Positioning of the atomsat the optimal distancesstabilizes the system:E*: minimum energyr*: optimal separation ofatoms

!

V (rN) = 4"ij

# i, j

ri, j

$

% & &

'

( ) )

12

*# i, j

ri, j

$

% & &

'

( ) )

6+

,

- -

.

/

0 0

$

%

& &

'

(

) )

j= i+1

N

1i=1

N

1

99

Treatment of the non-bonded energy

• The non-bonded energy terms between every pair ofatoms should be evaluatedo The number increases as the square of the number of

atoms for a pairwise model (N2)• To speed up the computation, the interactions between

two atoms separated by a distance greater than a pre-defined distance, the cutoff distance, are ignored

• Several different ways to terminate the interactionbetween two atoms have been developed over the yearso Some work better than others

Page 50: Molecular Dynamics Basics I - Home - GCLab · 2009-03-21 · Molecular Dynamics •This simple application is the principle on which the Molecular Dynamics algorithm is based!! •Given

50

100

Terminate interaction between 2 atoms

• Truncation: The interactions are simply set to zero for interatomicdistances greater than the cutoff distance. This method can lead tolarge fluctuations in the energy. This method is not often used.

• The SHIFT cutoff method: This method modifies the entire potentialenergy surface such that at the cutoff distance the interactionpotential is zero. The drawback of this method is that equilibriumdistances are slightly decreased.

• The SWITCH cutoff method: This method tapers the interactionpotential over a predefined range of distances. The potential takesits usual value up to the first cutoff and is then switched to zerobetween the first and last cutoff. This model suffers from strongforces in the switching region which can slightly perturb theequilibrium structure. The SWITCH function is not recommendedwhen using short cutoff regions.

101

Page 51: Molecular Dynamics Basics I - Home - GCLab · 2009-03-21 · Molecular Dynamics •This simple application is the principle on which the Molecular Dynamics algorithm is based!! •Given

51

102

Solvent representation

• Molecular phenomena do not happens in vacuum• Solvent affects electrostatic interactions

o The solvent reduce the amplitude of the electrostaticinteraction

• Possible representation of the solvent:o Implicit representation: mimic solvent effect without

including explicit solvent molecules, as a continuouso Explicit representation: include solvent molecules

103

Solvent representation (con’t)

• Simpler way to model the solvent: add a dielectric factorto the dielectric coefficient for vacuum

!

" = "0#"

r

Page 52: Molecular Dynamics Basics I - Home - GCLab · 2009-03-21 · Molecular Dynamics •This simple application is the principle on which the Molecular Dynamics algorithm is based!! •Given

52

104

Solvent representation

• Make the dielectric dependent upon the separtaion of thechanges species: e0 --> e(r)

105

Choosing the simulation region• Simulations regions may have

any shape:o Rectangular in two or three

dimensions (easy to handle)o Space-filling, convex region

• There exist numerous caseswhere one may not wish to useperiodic boundary conditions.

• In some cases, the use ofperiodic boundary conditionsrequires the use of aprohibitively large number ofwater molecules

o incorporate water moleculesin the simulation

Solvation shells

Active site solvation

Page 53: Molecular Dynamics Basics I - Home - GCLab · 2009-03-21 · Molecular Dynamics •This simple application is the principle on which the Molecular Dynamics algorithm is based!! •Given

53

106

Energy minimization

• Potential energy and energy are often synonymous• Energy surface ® the way in which energy varies with the

coordinate• For a system of N atoms, the energy is a function of 3N

Cartesian coordinates• It is impossible to visualize the entire energy surface

except for very simple systemso Energy is function of just 2 or 1 atoms

• In molecular modeling we are interested in minimumpoints of the of the energy surface

• These points correspond with stable stages of thesystem

107

Energy minimization (II)

• Movements away from a minimum gives a configurationof the system with a higher energy

• Systems have local and global minimums• We can use minimization algorithms to identify

geometries of the minimum pointso Several algorithm are availableo In charmm.inp: mini

Page 54: Molecular Dynamics Basics I - Home - GCLab · 2009-03-21 · Molecular Dynamics •This simple application is the principle on which the Molecular Dynamics algorithm is based!! •Given

54

108

Minimum and saddles

• Systems can change from one minimum energy structureto another

local

minimum global

minimum

saddle

point

• Local and global minimum points as well as saddlepoints are stationary points

109

Limits and strengths

Limits and solution• A fully quantification of the energy surfaces of a complex

system is not possibleo E.g., absorption of molecules onto surfaces

• Computer simulations (MD and MC simulations) allow usto study complex systems and predict their properties

Strengths and application• Energy minimizations are used to repair distorted

geometrieso Move atoms to release internal constraints

Page 55: Molecular Dynamics Basics I - Home - GCLab · 2009-03-21 · Molecular Dynamics •This simple application is the principle on which the Molecular Dynamics algorithm is based!! •Given

55

110

Where to find more ….

• Molecular Modeling - Principals and applications, AndrewR. Leach

• Understanding Molecular Simulation, Daan Frenkel andBerend Smit