Simulating Matter with Molecular Dynamics (Straightforward, Obvious, - - PowerPoint PPT Presentation

simulating matter with molecular dynamics
SMART_READER_LITE
LIVE PREVIEW

Simulating Matter with Molecular Dynamics (Straightforward, Obvious, - - PowerPoint PPT Presentation

Theory Potential Break Thermo PBC Verlet Implement Trajectories Simulating Matter with Molecular Dynamics (Straightforward, Obvious, Ridiculously Effective) Rubin H Landau Sally Haerer, Producer-Director Based on A Survey of Computational


slide-1
SLIDE 1

Theory Potential Break Thermo PBC Verlet Implement Trajectories

Simulating Matter with Molecular Dynamics

(Straightforward, Obvious, Ridiculously Effective) Rubin H Landau

Sally Haerer, Producer-Director

Based on A Survey of Computational Physics by Landau, Páez, & Bordeianu with Support from the National Science Foundation

Course: Computational Physics II

1 / 14

slide-2
SLIDE 2

Theory Potential Break Thermo PBC Verlet Implement Trajectories

What Can You Do with Molecular Dynamic?

Problem Will a collection of argon molecules form a liquid and then an ordered solid as the temperature is lowered? Recall introductory chemistry, “ideal” gas Derived PV = nRT via billiard ball collisions off only walls Now nonideal: molecule-molecule interactions Argon: inert gas (closed e shell) ≃ hard spheres

2 / 14

slide-3
SLIDE 3

Theory Potential Break Thermo PBC Verlet Implement Trajectories

Molecular Dynamics (MD) Theory

MD Overview MD: simulate phys & chem properties: solids, liquids, amorphous, bio MD: F = ma for bulk properties QM = correct description, but ... Bulk: not small-r behaviors QM (DFT): derive Veff(r) “HS physics problem from hell” Can’t run 1023–1025 particles Can ∼106: proteins; ∼108: materials

3 / 14

slide-4
SLIDE 4

Theory Potential Break Thermo PBC Verlet Implement Trajectories

Relation MD to Monte Carlo (MC) Thermodynamics

waterpermeation.mpg 2 Powerful Simulation Techniques Both: large N particles Both: initial arbitrary, equilibrate MD: microcanonical ensemble: E, V, N fixed MC: canonical ensemble: heat bath, fixed T, N MD: has dynamics (F = ma); MC: not, random MD: xi, vi change continuously, calc thermo variables

4 / 14

slide-5
SLIDE 5

Theory Potential Break Thermo PBC Verlet Implement Trajectories

Applying Newton’s Laws (E Determines Visiblitity)

Atom-Atom Interactions

+ +

1st Prin: 18 e - 18 e, Z + Vc ∼ 1000 e-e, e-Z Ignore internal Conservative (Eo), central V(r) rij = |ri − rj| = rji

m d2ri dt2 =F i(r0, . . . , rN−1) (1) F i = − ∇ri U(r0, r1, . . .) (2) U =

  • i<j

u(rij) (3) m d2ri dt2 = −

N−1

  • i<j=0

du drij (4)

5 / 14

slide-6
SLIDE 6

Theory Potential Break Thermo PBC Verlet Implement Trajectories

Phenomenological Lennard-Jones Potential

Short-Range Repulsion + Long Attraction

repulsive attraction

u(r) r Lennard-Jones

ǫ ↔ strength σ ↔ length scale Repulsive r −12 e-e small r overlap

u(r) =4ǫ σ r 12 − σ r 6 f(r) = − du dr =48ǫ r r 2 σ r 12 − 1 2 σ r 6

Attractive r −6 Large r van der Waals Weak induced dipole–dipole ⇐, ⇐, ⇐⇐

6 / 14

slide-7
SLIDE 7

Theory Potential Break Thermo PBC Verlet Implement Trajectories

Time for A Break

4 5 3 2 1 4 5 3 2 1 4 5 3 2 1 4 5 3 2 1 4 5 3 2 1 4 5 3 2 1 4 5 3 2 1 4 5 3 2 1 4 5 3 2 1 7 / 14

slide-8
SLIDE 8

Theory Potential Break Thermo PBC Verlet Implement Trajectories

Calculation of Thermodynamic Variables from MD

Large N, Use Statistical Mechanics Equipartition, equilibrium @ T, E = 1

2kBT /oF

Simulation: just translational KE (no rotate, vibrate)

KE = m 2 N−1

  • i=0

v 2

i

  • (1)
  • Time average KE (3o freedom)

KE = N 3 2kBT ⇒ T = 2KEMD 3kBN (2)

  • Pressure via Virial theorem, w = <force>

P = ρ 3N (2KE + w) , ρ = N V (3)

8 / 14

slide-9
SLIDE 9

Theory Potential Break Thermo PBC Verlet Implement Trajectories

Setting Initial Velocities for Molecules

1D 2D Initial Conditions Should Not Matter Start: velocity distribution characteristic some T ∝ KE = true T since not equilibrium (KE ↔ PE) Randomness: just to speed up calc Random Gaussian =

1 12

12

i=1 ri

9 / 14

slide-10
SLIDE 10

Theory Potential Break Thermo PBC Verlet Implement Trajectories

Periodic Boundary Conditions (PBC)

4 5 3 2 1 4 5 3 2 1 4 5 3 2 1 4 5 3 2 1 4 5 3 2 1 4 5 3 2 1 4 5 3 2 1 4 5 3 2 1 4 5 3 2 1

N = 103–106 = bulk? Must have box! Walls: surface effects ↓ N ⇒ ↑ surface/volume EG: 1000 particles 10 × 10 × 10 cube ⇒ 103–83 = 488 surface 106 particles → 6% PBC: min surface effects Replicate box to infinity Continuous at edges Each ∆t, outside box? Bring image in opposite side:

x ⇒    x + Lx, if x ≤ 0, x − Lx, if x > Lx

10 / 14

slide-11
SLIDE 11

Theory Potential Break Thermo PBC Verlet Implement Trajectories

Potential Cutoff

4 5 3 2 1 4 5 3 2 1 4 5 3 2 1 4 5 3 2 1 4 5 3 2 1 4 5 3 2 1 4 5 3 2 1 4 5 3 2 1 4 5 3 2 1

repulsive attraction

u(r) r Lennard-Jones

Computers & Boxes are Finite mi interacts with all mj ⇒ ∞ interactions Yet V(r >> σ) ≃ 0 V(r = 3σ) ≃ V(1.13σ)/200 Cut off: u(r > 2.5σ) ≡ 0 ⇒ only nearest image interaction Problem: f = −du(rcut)

dr

= −∞ Small effect since V(r) small

11 / 14

slide-12
SLIDE 12

Theory Potential Break Thermo PBC Verlet Implement Trajectories

Verlet & Velocity-Verlet Algorithms: Integrate Eq of Mtn

Realistic MD: 3-D Eq of M, 1010 t’s, 103–106 particles

rk4 ODE solver good; need quicker, simpler, built-in

Verlet: central-difference f”

f i[r(t), t] =m(= 1)d2ri dt2 ≃ ri(t + h) + ri(t − h) − 2ri(t) h2 (1) ⇒ ri(t + h) ≃2ri(t) − ri(t − h) + h2f i(t) + O(h4) (2)

Efficient: no solve for v’s; Determine v at end Velocity-Verlet (> stable); FD r & v together:

ri(t + h) ≃ ri(t) + hvi(t) + h2 2 f i(t) + O(h3) (3) vi(t + h) ≃ vi(t) + h a(t) + O(h2) (4)

12 / 14

slide-13
SLIDE 13

Theory Potential Break Thermo PBC Verlet Implement Trajectories

1-D Implementation: PE, KE, E vs Time

T Energía (J)

2E–13 4E–13 6E–13 8E–13 1E–12 1.2E–12 1.4E–12

Energy (J)

8.00E–19 6.00E–19 4.00E–19 2.00E–19 0.00E+00 –2.00E–19 –4.00E–19 –6.00E–19 –8.00E–19 –1.00E–18 –1.20E–18 –1.40E–18

Energy vs Time for 300 particles 2D box, initialy at 150 k Time (sec) (568 steps)

MD.py

V, T ⇒ liquid, solid

1

Start FCC lattice site: VLJ equilibrium

2

FCC particles/cell: 4N3 = 32, 108, . . .

3

Start Maxwellian velocity distribution

4

Highlight: ODE, PBC, image, cut off

5

∼ 104–105 steps equilibrate (10−9 s)

6

Choose largest h that’s stable

7

Compare to Figures

8

Evaluate < E >t, final T

9

Relation final and initial T’s?

13 / 14

slide-14
SLIDE 14

Theory Potential Break Thermo PBC Verlet Implement Trajectories

Trajectory Analysis (Time To Get To Work)

100 200 300

Final Temperature (K)

200 E-19 100 E-19

Initial KE (j) P

1 2 0 0 0.1 0.2 0.3

T

Output Several Particles’ x & v for Every 100 Steps

1

Start with 1-D, T = 0 @ equilibrium, then 2-D

2

PV = NRT for ideal (V = 0) gas

3

Increase T, note motion, interactions

4

Create an animation

5

Plot displacements Rrms vs T

6

Test for time-reversal invariance

14 / 14