+ All Categories
Home > Documents > Molecular Dynamics - Rensselaer Polytechnic...

Molecular Dynamics - Rensselaer Polytechnic...

Date post: 24-May-2020
Category:
Upload: others
View: 6 times
Download: 0 times
Share this document with a friend
14
Introduction to molecular dynamics simulations page - 1 Molecular Dynamics Numerical solution of classical equation of motion that in the Cartesian coordinate system are simply given by: m i d 2 r dt 2 = f i Forces are calculated from the potential energy, V (x 1 , x 2 , …x n ) f i = −∇ r i V The MD method provides full information about the dynamics of the system. It allows studying equilibrium and nonequilibrium processes
Transcript
Page 1: Molecular Dynamics - Rensselaer Polytechnic Institutehomepages.rpi.edu/~keblip/THERMO/lecture_notes/Lect5.Th.MDv.pdf · Introduction to molecular dynamics simulations page - 10 Statistical

Introduction to molecular dynamics simulations page - 1

Molecular Dynamics • Numerical solution of classical equation of motion that in the Cartesian coordinate system are

simply given by:

mid 2rdt2

= fi • Forces are calculated from the potential energy, V (x1, x2, …xn)

fi = −∇riV

• The MD method provides full information about the dynamics of the system. • It allows studying equilibrium and nonequilibrium processes

Page 2: Molecular Dynamics - Rensselaer Polytechnic Institutehomepages.rpi.edu/~keblip/THERMO/lecture_notes/Lect5.Th.MDv.pdf · Introduction to molecular dynamics simulations page - 10 Statistical

Introduction to molecular dynamics simulations page - 2

Potential Energy

• The potential energy may be divided into terms depending on coordinates of individual atoms, pairs, triplets etc:

V = v1(rii=1

N∑ ) + v1(

j>i

N∑

i=1

N∑ ri ,rj ) + v1(ri ,rj ,rk )

k> j>i

N∑

j>i

N∑

i=1

N∑ + ...

where the notation in the sums indicated summation over all distinct pairs and triplets without counting them twice Often the pair term is sufficient

vLJ (r) = 4ε σr

⎛ ⎝ ⎜ ⎞ ⎠ ⎟ 12

−σr

⎛ ⎝ ⎜ ⎞ ⎠ ⎟ 6⎡

⎣ ⎢

⎦ ⎥

-1

-0.5

0

0.5

1

1.5

2

2.5

3

0 0.5 1 1.5 2 2.5 3

V LJ(r)

r/σ

Page 3: Molecular Dynamics - Rensselaer Polytechnic Institutehomepages.rpi.edu/~keblip/THERMO/lecture_notes/Lect5.Th.MDv.pdf · Introduction to molecular dynamics simulations page - 10 Statistical

Introduction to molecular dynamics simulations page - 3

Periodic Boundary Conditions • The system size is very small at the

macroscopic scale, e.g., 10000 atoms correspond only to a 10nm cluster).

• If we want to study properties of

macroscopic materials surfaces has to be eliminated

• Some finite-size effects may be present

but typically ~ 100 atoms is enough to recover many bulk properties well

Page 4: Molecular Dynamics - Rensselaer Polytechnic Institutehomepages.rpi.edu/~keblip/THERMO/lecture_notes/Lect5.Th.MDv.pdf · Introduction to molecular dynamics simulations page - 10 Statistical

Introduction to molecular dynamics simulations page - 4

Potential cutoffs

• When the system size increases number of

atomic pairs increases as N2 which makes computations prohibitively expensive

• Calculate energy and forces only with atoms

within the cutoff distance. With few more trick, as we will see later, computational load ~ N rather than N2.

Page 5: Molecular Dynamics - Rensselaer Polytechnic Institutehomepages.rpi.edu/~keblip/THERMO/lecture_notes/Lect5.Th.MDv.pdf · Introduction to molecular dynamics simulations page - 10 Statistical

Introduction to molecular dynamics simulations page - 5

Force Calculation - 1

For pair potential recall that V = v(j>i

N∑

i=1

N∑ | ri − rj |) = v(

j>i

N∑

i=1

N∑ rij )

where rij = ri-rj is the vector connecting atoms i and j and rij given by

rij = (xi − x j)2(yi −y j)

2 + (z i − z j)2

is the vector length, i.e. the distance between atoms i and j. The force acting on atom i due to atom j is given by (x-component)

fij

x = −∂v(rij )∂xi

= −∂v(rij )∂rij

∂rij∂xi

by noticing that

∂rij∂xi

=(xi − xj )rij

=xijrij

fij

x = −∂v(rij )∂xi

= −dv(rij )drij

xijrij

and finally in the vector notation

fij= −

dv(rij )drij

rijrij

Page 6: Molecular Dynamics - Rensselaer Polytechnic Institutehomepages.rpi.edu/~keblip/THERMO/lecture_notes/Lect5.Th.MDv.pdf · Introduction to molecular dynamics simulations page - 10 Statistical

Introduction to molecular dynamics simulations page - 6

Force Calculation - 2

The total force on atom i is given by the sum over all other atoms

fi= −

dv(rij )drij

rijrijj≠i

N∑

With the potential cutoff only atoms j that are within the cutoff distance from atom i contribute to the above sum.

Example: LJ potential vLJ (r) = 4ε σr

⎛ ⎝ ⎜ ⎞ ⎠ ⎟ 12

−σr

⎛ ⎝ ⎜ ⎞ ⎠ ⎟ 6⎡

⎣ ⎢

⎦ ⎥

Lennard-Jones potential and force

- 4

- 2

0

2

4

6

8

1 0

1 2

0 0.5 1 1.5 2 2.5 3

F LJ(r)

r/σ- 1

-0.5

0

0.5

1

1.5

2

2.5

3

0 0.5 1 1.5 2 2.5 3

V LJ(r)

r/σ

−dvLJ (rij)drij

=4εσ12 σ

r⎛ ⎝ ⎜

⎞ ⎠ ⎟ 13

− 6 σr

⎛ ⎝ ⎜

⎞ ⎠ ⎟ 7⎡

⎣ ⎢

⎦ ⎥

Page 7: Molecular Dynamics - Rensselaer Polytechnic Institutehomepages.rpi.edu/~keblip/THERMO/lecture_notes/Lect5.Th.MDv.pdf · Introduction to molecular dynamics simulations page - 10 Statistical

Introduction to molecular dynamics simulations page - 7

Shifted Potential and Shifted Force

With the truncation of the potential the potential is usually not zero at the cutoff distance and when a particle enters or leaves the cutoff sphere the energy jumps discontinuously.

• Remedy: Shifted potential

vS(rij ) =v(rij ) − v(Rcut ) rij ≤ Rcut

0 rij > Rcut

⎧ ⎨ ⎪

⎩ ⎪

With the potential cutoff only atoms j that are within the cutoff distance from atom i contribute to the above sum. • However forces are still discontinuous • Remedy: Shifted Force potential

vSF (rij ) =v(rij ) − v(Rcut ) − (rij −Rcut )

dv(rij )drij

⎝ ⎜ ⎜

⎠ ⎟ ⎟ rij=R cut

rij ≤ Rcut

0 rij > Rcut

⎨ ⎪ ⎪

⎩ ⎪ ⎪

Now both energy and forces are continuous at Rcut

Page 8: Molecular Dynamics - Rensselaer Polytechnic Institutehomepages.rpi.edu/~keblip/THERMO/lecture_notes/Lect5.Th.MDv.pdf · Introduction to molecular dynamics simulations page - 10 Statistical

Introduction to molecular dynamics simulations page - 8

Integration of Equation of Motion - Verlet Algorithm

We need to solve numerically for the time evolution of the system. The simplest possible way to predict atomic positions at time t+ δt, from the knowledge of atomic positions at time t−δt and time t, where δt is so called molecular dynamics time step. r( t+δt) = 2r(t) - r( t-δt)+ δt2a(t) velocities do not appear at all – can be eliminated by addition of Taylor expansions r( t+δt) = r(t) + δtv(t) + 1/2δt2a(t) r( t-δt) = r(t) - δtv(t) + 1/2δt2a(t)

but they may be obtained from the formula v(t) = r(t +δt) − r(t −δt)2δt

Standard algorithm is a bit awkward since velocities do not appear. Also two big numbers r(t) and r( t-δt) are subtracted. A most popular modification is so called 'leap-frog' scheme. r( t+δt) = r(t) + δtv(t+1/2δt) and v(t+1/2δt) = v(t-1/2δt)) + δta(t)

In the code the velocity equation is implemented first and velocities leap over the coordinates. In the next step the coordinates leap over velocities. The 'leap-frog' scheme is used by the MD code that we will use in our computer laboratories.

Page 9: Molecular Dynamics - Rensselaer Polytechnic Institutehomepages.rpi.edu/~keblip/THERMO/lecture_notes/Lect5.Th.MDv.pdf · Introduction to molecular dynamics simulations page - 10 Statistical

Introduction to molecular dynamics simulations page - 9

Basic Structure of MD Simulations

Read initial structure Read or initialize velocities

Master input defines important parameters of simulations such as temperature, pressure, structure file name etc.

Main Program • Calculate forces • Update positions using one

of the integration scheme • Repeat for given number of

MD steps • For constant temperature

rescale velocities • For constant pressure

change the volume of the simulation box

Output 1 - Main system characteristics: Total Energy, kinetic energy, potential energy, temperature, simulation box size pressure.

Final and intermediate atomic structures. May include also velocities and higher derivatives to "restart" exactly the same simulations

Page 10: Molecular Dynamics - Rensselaer Polytechnic Institutehomepages.rpi.edu/~keblip/THERMO/lecture_notes/Lect5.Th.MDv.pdf · Introduction to molecular dynamics simulations page - 10 Statistical

Introduction to molecular dynamics simulations page - 10

Statistical Mechanics

• Atomistic simulations provide "overwhelming" amount of information. For example positions, velocities and forces are known at all time steps. These data may be of interest, but what is really important is to connect atomistic simulations with "real" i.e. macroscopic world.

• For example, we want to know how to evaluate thermodynamics properties. Some, such as volume, strain or composition are easy. Some are more involved, including

• Temperature • Pressure • Stress tensor

• Connection between atomistic description and macroscopic description is provided by statistical mechanics.

Important point: Simulations involves small systems (from macroscopic point of view) thus any quantity (i.e. pressure, temperature) will fluctuate and has to be averaged over long time.

Aobs =< A > time=1tobs t obs→∞

lim A(r(t),p(t))dt0

tobs

Since in the simulations time is discrete and finite

Aobs =< A > time=1tobs

A(r(τ),p(τ))τ=0

t obs∑

Page 11: Molecular Dynamics - Rensselaer Polytechnic Institutehomepages.rpi.edu/~keblip/THERMO/lecture_notes/Lect5.Th.MDv.pdf · Introduction to molecular dynamics simulations page - 10 Statistical

Introduction to molecular dynamics simulations page - 11

Statistical Ensembles

• In MD the most popular are microcanonical and canonical ensembles. • In the microcanonical ensemble the system is closed and follows equation of motion such that N -

number of particles, V - volume and E - energy are constant (NVE ensemble). • In the canonical ensemble the system is coupled with thermostat such that T - temperature rather

than energy is constant NVT -ensemble. • Also one can make P - pressure constant rather than volume - the isothermal-isobaric constant

NPT ensemble.

NVE NVT T

Page 12: Molecular Dynamics - Rensselaer Polytechnic Institutehomepages.rpi.edu/~keblip/THERMO/lecture_notes/Lect5.Th.MDv.pdf · Introduction to molecular dynamics simulations page - 10 Statistical

Introduction to molecular dynamics simulations page - 12

Equipartition of Energy

From canonical ensemble is can be shown that

< pk∂H / ∂pk >= kBT and < rk∂H / ∂rk >= kBT

where kB is the Boltzmann constant, and H is the total energy (kinetic + potential) also know as Hamiltonian. Since ∂H / ∂pk = pk /mi , from above by summing over all atoms, i, and all coordinates (k=x,y,z) one gets

< pi ,k

2 / mii=1,N,k=x,y,z

i=N∑ >= 2 < K >= 3NkBT

This allow us to define "instantaneous" temperature, T, at the microscopic level

T = 2 < K >3NkB

=1

3NkBpi ,k

2 / mii=1,N,k= x,y,z

i=N∑ (10)

N refers here to independent degrees of freedom. If there are some internal constrains such as fixed bond lengths in molecules and their total number is NC the instantaneous temperature is given by

T = 2 < K >3NkB

=1

(3N −NC )kBpi ,k

2 / mii=1,N ,k=x,y,z

i=N∑ (11)

NC also includes global constrains such as fixed center of mass.

Page 13: Molecular Dynamics - Rensselaer Polytechnic Institutehomepages.rpi.edu/~keblip/THERMO/lecture_notes/Lect5.Th.MDv.pdf · Introduction to molecular dynamics simulations page - 10 Statistical

Introduction to molecular dynamics simulations page - 13

Pressure

From

< xi∂H/∂xi+yi∂H/∂yi+ zi∂H/∂zi >= 3kBT

and

∂H/∂xi = ∂V/∂xi = −fi,x

by summing over all atoms one obtains

< rifii=1

N

∑ >= - 3NkBT

The force on atom i can be represented as sum of internal and external forces

fi = fi

ext + fi

int

The pressure is associated with the external force

< rifiext

i=1

N

∑ >= -3PV so finally

PV = NkBT +13

< rifiint

i=1

N

∑ >

The quantity

13

rifiint

i=1

N

∑ is called the “internal virial” W

With this definition the “instantaneous” pressure can be defined as P=NV

kBT+W/V

Page 14: Molecular Dynamics - Rensselaer Polytechnic Institutehomepages.rpi.edu/~keblip/THERMO/lecture_notes/Lect5.Th.MDv.pdf · Introduction to molecular dynamics simulations page - 10 Statistical

Introduction to molecular dynamics simulations page - 14

Pressure for pair potential

rifiint

i=1

N

∑ = rifijj≠ i∑

i=1

N

∑ =12

rifij[j≠ i∑

i=1

N

∑ + r jf ji]

where fij is the force on atom i from j and the last equality follows from the fact that indices i and j are equivalent. Newton’s third law

fij = − f ji can be then used to get

ri fiint

i=1

N

∑ = 12

rifij[j≠ i∑

i=1

N

∑ +r jf ji] =12

rijfijj≠ i∑

i=1

N

∑ = rijfijj> i∑

i=1

N

so the internal virial in given by

W = 13

rijfijj> i∑

i=1

N

∑ = −13

rij∇rijj> i∑

i=1

N

∑ v(rij ) = −13

w(rij )j> i∑

i=1

N

∑ with w(r) defined as w(r) = r dv(r )dr

Recall that

P=NV

kBT+W/V

Pressure due to thermal motion (ideal gas) is always positive Pressure due to internal forces can be positive or negative. For high density systems atoms are close to each other and rdv/dr < 0 and W>0 (compressive pressure). For low density rdv/dr > 0 and and W<0 (negative pressure).


Recommended