history, development and basics of molecular dynamics ... · history, development and basics of...

51
History, Development and Basics of Molecular Dynamics Simulation Technique A way to do experiments in computers (Odourless) Creating virtual matter and then studying them in computers S. Yashonath Solid State and Structural Chemistry Unit Indian Institute of Science Bangalore 560 012 National Workshop on Atomistic Simulation Techniques, IIT, Guahati

Upload: others

Post on 27-Mar-2020

5 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: History, Development and Basics of Molecular Dynamics ... · History, Development and Basics of Molecular Dynamics Simulation Technique A way to do experiments in computers (Odourless)

History, Development and Basics of Molecular Dynamics Simulation

Technique

A way to do experiments in computers

(Odourless)

Creating virtual matter and then studying them in computers

S. Yashonath

Solid State and Structural Chemistry Unit

Indian Institute of Science

Bangalore 560 012

National Workshop on Atomistic Simulation Techniques, IIT, Guahati

Page 2: History, Development and Basics of Molecular Dynamics ... · History, Development and Basics of Molecular Dynamics Simulation Technique A way to do experiments in computers (Odourless)

Dedication• Prof. Aneesur Rahman, a gentle scientist, from

Hyderabad, India

Page 3: History, Development and Basics of Molecular Dynamics ... · History, Development and Basics of Molecular Dynamics Simulation Technique A way to do experiments in computers (Odourless)

AcknowledgementsAll my students : P. Santikary(ebay, USA), Sanjoy Bandyopadhyay (IIT, Kgp), P. K. Padmanabhan (IIT, Guwahati), R. Chitra(Bangalore), A.V. Anil Kumar(NISER, Bhubhaneswar), S.Y. Bhide(Dow Chemicals, Mumbai), C.R. Kamala(GE, USA), P. K. Ghorai(IISER, Kolkata), Manju Singh (Bangalore), B.J. Borah (private univ., Baroda), V. Srinivas Rao (U. Queens, Australia)

Page 4: History, Development and Basics of Molecular Dynamics ... · History, Development and Basics of Molecular Dynamics Simulation Technique A way to do experiments in computers (Odourless)

Plan of the talk :

Introduction Classical mechanics : basicsStatistical mechanics : basicsIntermolecular potentialsNumerical integrationAlgorithmsComputational TricksTrajectoryEquilibrium and time dependent propertiesMicrocanonical ensembleOther ensembles

Page 5: History, Development and Basics of Molecular Dynamics ... · History, Development and Basics of Molecular Dynamics Simulation Technique A way to do experiments in computers (Odourless)

What is molecular dynamics ?

A way of solving equations of motion numerically (hence you need a computer).

Equations of motion are coupled differential equations and hence can not be solved analytically.

You can get all properties about the system being simulated (from statistical mechanical relationships)

Page 6: History, Development and Basics of Molecular Dynamics ... · History, Development and Basics of Molecular Dynamics Simulation Technique A way to do experiments in computers (Odourless)

Subjects involved in MD

• Classical mechanics

• Statistical mechanics

• Intermolecular potential

Page 7: History, Development and Basics of Molecular Dynamics ... · History, Development and Basics of Molecular Dynamics Simulation Technique A way to do experiments in computers (Odourless)

History and evolution of MD

• 1953: Metropolis Monte Carlo (MC) by Metropolis,

Rosenbluth, Rosenbluth, Teller & Teller

–simulation of a dense liquid of 2D spheres

• 1955: Fermi, Pasta, and Ulam

–simulation of anharmonic 1D crystal

• 1956: Alder and Wainwright

–molecular dynamics (MD) simulation of hard spheres (1958: First X‐ray structure of a protein)

• 1960: Vineyard group

– Simulation of damaged Cu crystal

Page 8: History, Development and Basics of Molecular Dynamics ... · History, Development and Basics of Molecular Dynamics Simulation Technique A way to do experiments in computers (Odourless)

• 1964: Rahman

–MD simulation of liquid Ar

• 1969: Barker and Watts

–Monte Carlo simulation of water

• 1971: Rahman and Stillinger

–MD simulation of water

* 1972: I.R. McDonald

- NPT simulation using Monte Carlo

Page 9: History, Development and Basics of Molecular Dynamics ... · History, Development and Basics of Molecular Dynamics Simulation Technique A way to do experiments in computers (Odourless)
Page 10: History, Development and Basics of Molecular Dynamics ... · History, Development and Basics of Molecular Dynamics Simulation Technique A way to do experiments in computers (Odourless)
Page 11: History, Development and Basics of Molecular Dynamics ... · History, Development and Basics of Molecular Dynamics Simulation Technique A way to do experiments in computers (Odourless)

Aneesur Rahman in hisyounger days

Page 12: History, Development and Basics of Molecular Dynamics ... · History, Development and Basics of Molecular Dynamics Simulation Technique A way to do experiments in computers (Odourless)

Post 1980 developments : the extended

Hamiltonian methods

• 1980 : H. C. Andersen

- MD method for NPH, NVT, NPT ensembles

• 1980 : M. Parrinello and A. Rahman

- Parrinello-Rahman method for study of crystal structure transformation with corrections from S. Yashonath

• 1986 : R. Car and M. Parrinello

Ab initio MD (includes electronic degrees of freedom)

Page 13: History, Development and Basics of Molecular Dynamics ... · History, Development and Basics of Molecular Dynamics Simulation Technique A way to do experiments in computers (Odourless)

Alder & WainrightHard sphere 1956

Metropolis et alMonte Carlo 1953

Fermi, Pasta, Ulam1D crystal 1955

Simulation of damaged Cu crystal Vineyard 1960

RahmanMD of argon 1964

Barker and WattsMC of water 1969

Rahman and Stillinger

MD simulation of water, 1971

NPT of argonMcDonald 1972

A chart of development of simulation methods

Page 14: History, Development and Basics of Molecular Dynamics ... · History, Development and Basics of Molecular Dynamics Simulation Technique A way to do experiments in computers (Odourless)

Feynman vs. Einstein

• “…everything that is living can be understood in terms of jiggling and wiggling of atoms.” R. Feynman.

• Everything Should Be Made as Simple as Possible, But Not Simpler : A. Einstein

Page 15: History, Development and Basics of Molecular Dynamics ... · History, Development and Basics of Molecular Dynamics Simulation Technique A way to do experiments in computers (Odourless)

MD jargon : Terms often used

• Monatomic : single atom or molecule with single atom

• Polyatomic : molecule with multiple atoms

• Euler angles and quaternions

• Images

• Simulation cell, parallelopiped

• Cut-off radius, long-range and short-range interactions

Page 16: History, Development and Basics of Molecular Dynamics ... · History, Development and Basics of Molecular Dynamics Simulation Technique A way to do experiments in computers (Odourless)

Simple microcanonical ensemble MD

• ai = ��/mi

How does one get force Fi ? From the intermolecular potential :

��= grad of potential

We need : ��

or potential φi.

Page 17: History, Development and Basics of Molecular Dynamics ... · History, Development and Basics of Molecular Dynamics Simulation Technique A way to do experiments in computers (Odourless)

A knowledge of intermolecular interaction potential is therefore centralto molecular dynamics. Without it, you can not perform a MD simulation.

Before we go into the various potential functions, we need to understand theorigin of the intermolecular interaction. What are these and how they originate ?

Move to MD

Page 18: History, Development and Basics of Molecular Dynamics ... · History, Development and Basics of Molecular Dynamics Simulation Technique A way to do experiments in computers (Odourless)

Molecular Dynamics : the nitty gritty details !

through the slides of Prof. P. K. Padmanabhan

Page 19: History, Development and Basics of Molecular Dynamics ... · History, Development and Basics of Molecular Dynamics Simulation Technique A way to do experiments in computers (Odourless)

Two Excellent Books

Page 20: History, Development and Basics of Molecular Dynamics ... · History, Development and Basics of Molecular Dynamics Simulation Technique A way to do experiments in computers (Odourless)

∑≠

=ij

iji FF

iii mFa /=

••

•2

3

F12

F23

F13

F1 = F12 + F13

F3 = F31 + F32

F2 = F21 + F23

Newton’s IInd Law:

Three Atoms

1

ijijUF −∇=

Page 21: History, Development and Basics of Molecular Dynamics ... · History, Development and Basics of Molecular Dynamics Simulation Technique A way to do experiments in computers (Odourless)

••

•1

2

3

Progress in time…

x(t) → x(t+Δt)

y(t) → y(t+Δt)

z(t) → z(t+Δt)• •

3

1

2

Taylor Expansion: too crude to use it as such!!

Δt ~ 1-5 fs (10-15sec)

Advance positions & velocities of each atom:

Page 22: History, Development and Basics of Molecular Dynamics ... · History, Development and Basics of Molecular Dynamics Simulation Technique A way to do experiments in computers (Odourless)

A good Integrator…for example!

Verlet Scheme:

Newton’s equations are time reversible,

Summing the two equations,

Now we have advanced our atoms to time t+Δt ! !

Velocity of the atoms:

Page 23: History, Development and Basics of Molecular Dynamics ... · History, Development and Basics of Molecular Dynamics Simulation Technique A way to do experiments in computers (Odourless)

• ••

3

1

2

• •

3

1

2

F12

F23

F13

…Atoms move forward in time!

t+Δtt+2Δt

Continue this procedure for several lakhs of Steps. Or as much as you can afford!

2nd MD Step

1. Calculate 2. Update3. Update

3rd MD Step

The main O/P of MD is the trajectory.

Δt ~ 1-5 fs (10-15sec)

Page 24: History, Development and Basics of Molecular Dynamics ... · History, Development and Basics of Molecular Dynamics Simulation Technique A way to do experiments in computers (Odourless)

The missing ingredient… Forces?

Gravitational Potential: r

mGmU 21

−=

too weak,Neglect it!!

Force is the gradient of potential:

The predominant inter-atomic forces are Coulombic in origin!

r

qqU 21

04

1

πε=

However, this pure monopole interaction need not be present!

Page 25: History, Development and Basics of Molecular Dynamics ... · History, Development and Basics of Molecular Dynamics Simulation Technique A way to do experiments in computers (Odourless)

2. Born-Mayer (Tosi-Fumi) Potential:

Interatomic forces for simple systems

1. Lennard-Jones Potential:

Gives an accurate description of inert gases

(Ar, Xe, Kr etc.)

Faithful in describing pure ionic solids (NaCl, KCl, NaBr etc.)

(non-bonded interactions)

Instantaneous dipoles

Page 26: History, Development and Basics of Molecular Dynamics ... · History, Development and Basics of Molecular Dynamics Simulation Technique A way to do experiments in computers (Odourless)

The Lennard-Jones Potential

for Ar :

(kB)

Pauli’s repulsion

“dispersion” interaction

r(nm)

))(612

(48

6

14

12

ji

xij

xxrr

F −−=σσ

ε

ijijUF −∇=

iii

xij x

r

r

U

x

UF

∂−=

∂−=

Å

Should be known apriori.

Page 27: History, Development and Basics of Molecular Dynamics ... · History, Development and Basics of Molecular Dynamics Simulation Technique A way to do experiments in computers (Odourless)

Length and Times of MD simulation

Typical experiment sample contains ~ 1023 atoms!

Typical MD simulations (on a single CPU)

a) Can include 1000 – 10,000 atoms (~20-40 Å in size)!

b) run length ~ 1 –10 ns (10-9 seconds)!

Consequence of system size:

Larger fraction of atoms are on the surface, r

dr

mr

mdrr

N

Ns3

/3

4

/4

3

2

==

ρπ

ρπ

7

810~

10

)3(3~.)( −

Α

ΑExpt

N

Ns45.0~

20

)3(3~)(

Α

ΑMD

N

Ns

Surface atoms have different environment than bulk atoms!

Page 28: History, Development and Basics of Molecular Dynamics ... · History, Development and Basics of Molecular Dynamics Simulation Technique A way to do experiments in computers (Odourless)

L

The Simulation Cell

Insert the atoms in a perfectly porous box – simulation super-cell.

The length of the box is determined as, L3 = M/Dexp = N*m/Dexp

Dexp = Expt. density; m = At. mass; N= No. of atoms;

If crystal structure/unit cell parameters are unknown (eg., liquids)

Assign positions and velocities(=0) for each atom.

Page 29: History, Development and Basics of Molecular Dynamics ... · History, Development and Basics of Molecular Dynamics Simulation Technique A way to do experiments in computers (Odourless)

~20 A

Periodic Boundary Condition

In 3-D the simulation simulation-

super-cell is surrounded by 26++

image cells!

X

L~20 A

Y

n1, n2, n3 ∈∈∈∈ -1,0, 1,

x’ = x + n1 L

y’ = y + n2 L

z’ = z + n3 L

Image coordinates:

Now, there are no surface atoms!

Construct Periodic Images:

Page 30: History, Development and Basics of Molecular Dynamics ... · History, Development and Basics of Molecular Dynamics Simulation Technique A way to do experiments in computers (Odourless)

~20 A

Minimum Image Convention

~20 A

Rc

A large enough system (ie, bigger sim.-cell) is chosen such that Rc ≤≤≤≤ L/2.

Thus particle i interact either with particle j or one of its images, but not both!

Interactions between atoms separated by a chosen cut-off distance (Rc) or larger (ie, rij > Rc) are neglected.

Rc is chosen such that U(Rc) ~ 0

Page 31: History, Development and Basics of Molecular Dynamics ... · History, Development and Basics of Molecular Dynamics Simulation Technique A way to do experiments in computers (Odourless)

•••• •

•••••

••

••

••

t = 0

t = 10 pico-sec

As Time Progress…

How to find the image of j that is nearest to i ?

i

j

))(612

(48

6

14

12

jiijij

xij

xxrr

F −−=σσ

εForce between i & j :

ii

j

•j’

L

L

Page 32: History, Development and Basics of Molecular Dynamics ... · History, Development and Basics of Molecular Dynamics Simulation Technique A way to do experiments in computers (Odourless)

folding

If you have coordinates which are anywhere between (-infinity,infinity), and if you want to bring the coordinates between (0,L) then this procedure is called folding. Assuming L is 10, we see that :

(234,-546) � (4,-6) � (4,4). If we have L = 10, we get the same answer. However, if L = 12, 12 x 19 = 228 and 12 x 45 = 540. Therefore, you get (234-228, -546+540) � (6,-6) � (6,6).

Page 33: History, Development and Basics of Molecular Dynamics ... · History, Development and Basics of Molecular Dynamics Simulation Technique A way to do experiments in computers (Odourless)

Unfolding

• If you have coordinates between (0,L) at many time steps then can you unfold it ? That is, can you map it to the range (-infinity, infinity) ?

• Timestep 1 : (4,3), 2: (3.5,3.4), 3: (3.3,3.6), 4:(3.09,3.9), 5:(2.2,4.2), 6: (1.4,4.3), 7: (0.3, 5.0), 8: (9.4, 6.6)

• Noting that coordinates between step 7 and 8 have large difference (of the order of L), then we can guess that they have been folded. Then we can see that the unfolded coordinates at step 8 are (-0.6,6.6)

Page 34: History, Development and Basics of Molecular Dynamics ... · History, Development and Basics of Molecular Dynamics Simulation Technique A way to do experiments in computers (Odourless)

The three lines of code…

dx = x(j) – x(i)

dy = y(j) – y(i)

dz = z(j) – z(i)

dx = dx – L*ANINT(dx/L)

dy = dy – L*ANINT(dy/L)

dz = dz – L*ANINT(dz/L)

Define,

ANINT(1.51) = 2

ANINT(3.49) = 3

ANINT(-3.51) = -4

ANINT(-11.39) = -11.0

rij_2 = (dx**2 + dy**2 + dz**2)

))(612

(48

6

14

12

jiijij

xij

xxrr

F −−=σσ

ε

rij_8 = rij_2**4 rij_14 = rij_2**7

Page 35: History, Development and Basics of Molecular Dynamics ... · History, Development and Basics of Molecular Dynamics Simulation Technique A way to do experiments in computers (Odourless)

…demonstration

j

i

•j’

L=10 A

L=10 A

(2,8)

(0,0)

(-1,6)

(19,-4)

dx = dx – L*AINT(dx/L)

dy = dy – L*AINT(dy/L)

xi-xj=(2-19)-10*ANINT{(2-19)/10}= -17 - (-10*2)=3

•j”

yi-yj=(8+4)-10*ANINT{12/10}= 12 - (10*1)=2

(9,6)

Page 36: History, Development and Basics of Molecular Dynamics ... · History, Development and Basics of Molecular Dynamics Simulation Technique A way to do experiments in computers (Odourless)

The Lennard-Jones Potential

for Ar :

(kB)

Pauli’s repulsion

“dispersion” interaction

r(nm)

))(612

(48

6

14

12

ji

xij

xxrr

F −−=σσ

ε

ijijUF −∇=

iii

xij x

r

r

U

x

UF

∂−=

∂−=

Å

Should be known apriori.

Page 37: History, Development and Basics of Molecular Dynamics ... · History, Development and Basics of Molecular Dynamics Simulation Technique A way to do experiments in computers (Odourless)

The structure of a simple MD code

Page 38: History, Development and Basics of Molecular Dynamics ... · History, Development and Basics of Molecular Dynamics Simulation Technique A way to do experiments in computers (Odourless)

Remarks on Statistical Ensemble

There is no energy coming in Or going out of our system of atoms: micro-canonical (NVT) ensemble.

Thus the total energy (E) and total linear momentum of the system should be conserved – through out our simulation!

∑=

=N

ii

vi

mK

1

2

2

1

∑=

=N

ii

UU12

1

UKE += remain const.

(fluctuates)

(fluctuates)

Transient phase Equilibrated state

Page 39: History, Development and Basics of Molecular Dynamics ... · History, Development and Basics of Molecular Dynamics Simulation Technique A way to do experiments in computers (Odourless)

Calculating Temperature

Equipartition theorem:

Average temperature : 1

1( )

M

m

mT T tM =

∑< >=

M – no. of MD steps performed

• ••

1

2

3

Even if we start with vi =0, the system picks up non-zero v (hence some T) as time progress!

This some T(!) need not be what we want!

So how do we control T?

∑=N

iii

vmtTNk2

2

1)(

2

3

Instantaneous temperature: ∑=N

iii

vmNk

tT2

3

1)(

Page 40: History, Development and Basics of Molecular Dynamics ... · History, Development and Basics of Molecular Dynamics Simulation Technique A way to do experiments in computers (Odourless)

Controlling the Temperature ?

Velocity rescaling:

∑=N

iii

vmNk

T2

3

1Actual temp. at some instant.

1

2Trv v

r T

=

This instantly bring the T = Tr !

TTTTTrr

∆+><∆−If T is out side the fluctuation window around Tr:

Then scale all velocities:

This phase of the simulation should not be used for averaging!

However to sustain the temp. around Tr we will need

to do this procedure several times at intervals.

Page 41: History, Development and Basics of Molecular Dynamics ... · History, Development and Basics of Molecular Dynamics Simulation Technique A way to do experiments in computers (Odourless)

Calculating thermodynamic quantities

Average Pressure,

Heat Capacity, Cv:

Average Energy, ∑=

>=<M

i

iUM

U1

1

Page 42: History, Development and Basics of Molecular Dynamics ... · History, Development and Basics of Molecular Dynamics Simulation Technique A way to do experiments in computers (Odourless)

Remarks on Energy Conservation

• Start from the expt. crystal structure if available.

• Else? Start from good guess! (like, in bio-systems, polymers, liquids)

• And, perform an energy minimization!

(Routines available in standard packages.

Or, do an MD with constant velocity scaling.)

• Reaching a well equilibrated structure can be very very costly!

-good check on your code!

-time integrator!

-on time step (Δt) used!

6~ 1 0 /

Ep s

E

∆ −• Energy conservation,

• Fluctuation of U(t) about a mean helps to identify equilibrated system.

Page 43: History, Development and Basics of Molecular Dynamics ... · History, Development and Basics of Molecular Dynamics Simulation Technique A way to do experiments in computers (Odourless)

Remarks on Interatomic Forces

• Development of good force fields (FF) can be a tough task!

• FF assume that electronic clouds around the nucleus of atoms is intact irrespective of the environment around the atom!

This can be a poor assumption for highly polarizable atoms/ions!

Solution?

Develop a shell model of atoms/ions!

Or DFT-based ab-initio (Car-Parrinello) MD calculations !

FF’s are developed by empirical methods or ab-initio calculations.

Page 44: History, Development and Basics of Molecular Dynamics ... · History, Development and Basics of Molecular Dynamics Simulation Technique A way to do experiments in computers (Odourless)

Comments on Classical MD

Extensively employed to understand Physical processes at atomic

resolution

Phase Transitions,

Diffusion and transport properties,

Local structural and short-time relaxation of

� crystalline and amorphous solids

� liquids

�solid-fluid interfaces

�nano-clusters

Very powerful in studying a variety of physical phenomena and under several external conditions (T & P).

And, serves a very useful bridge between experiment and theory!

Not useful in the study of electronic properties!

Not powerful enough to describe chemical reactions!

Page 45: History, Development and Basics of Molecular Dynamics ... · History, Development and Basics of Molecular Dynamics Simulation Technique A way to do experiments in computers (Odourless)

Structural Characterization

Radial Distribution Function (rdf)

Rdf of fcc-solid

Running Coordination Numbers:

Page 46: History, Development and Basics of Molecular Dynamics ... · History, Development and Basics of Molecular Dynamics Simulation Technique A way to do experiments in computers (Odourless)

Dynamical Properties: Diffusion Coefficient

Fick’s Law:

Continuity Eq.:

Diffusion Eq.:

Einstein’s relation: Nr. MSD

TfkDNq B/2=σNernst-Einstein’s relation:

Page 47: History, Development and Basics of Molecular Dynamics ... · History, Development and Basics of Molecular Dynamics Simulation Technique A way to do experiments in computers (Odourless)

CaF2

MS

D

time

…Diffusion Coefficient: CaF2

F-

Ca2+

TfkDNq B/2=σ

PRB, 43, 3180,1991.

Page 48: History, Development and Basics of Molecular Dynamics ... · History, Development and Basics of Molecular Dynamics Simulation Technique A way to do experiments in computers (Odourless)

…Dynamical Properties: Vibrational Spectrum

Velocity Autocorrelation Spectrum, Water @300 K

Power Spectrum,

Helps interpreting IR spectrum.

Page 49: History, Development and Basics of Molecular Dynamics ... · History, Development and Basics of Molecular Dynamics Simulation Technique A way to do experiments in computers (Odourless)

…Structural Properties: Site Occupancies

PRL 97, 166401 (2006)

Page 50: History, Development and Basics of Molecular Dynamics ... · History, Development and Basics of Molecular Dynamics Simulation Technique A way to do experiments in computers (Odourless)

Ion Channel’s In NASICON’s

Supriya Roy and P.P. Kumar, PCCP (2014).

Na3Zr2Si2PO12

Page 51: History, Development and Basics of Molecular Dynamics ... · History, Development and Basics of Molecular Dynamics Simulation Technique A way to do experiments in computers (Odourless)

Simulation of Live-Virus!!

Indian Institute of Technology Guwahati

Charge distribution around the virus