CE 530 Molecular Simulation

Similar documents
Classical Equations of Motion

Introduction to molecular dynamics

Introduction to Simulation - Lectures 17, 18. Molecular Dynamics. Nicolas Hadjiconstantinou

CE 530 Molecular Simulation

Curves in the configuration space Q or in the velocity phase space Ω satisfying the Euler-Lagrange (EL) equations,

HAMILTON S PRINCIPLE

Lecture IV: Time Discretization

CE 530 Molecular Simulation

From quantum to classical statistical mechanics. Polyatomic ideal gas.

Physics 5153 Classical Mechanics. Canonical Transformations-1

Physics 235 Chapter 7. Chapter 7 Hamilton's Principle - Lagrangian and Hamiltonian Dynamics

G : Statistical Mechanics

Lecture 5. Alexey Boyarsky. October 21, Legendre transformation and the Hamilton equations of motion

PHYS 705: Classical Mechanics. Hamiltonian Formulation & Canonical Transformation

Time-Dependent Statistical Mechanics 5. The classical atomic fluid, classical mechanics, and classical equilibrium statistical mechanics

2 Canonical quantization

Solution Set Two. 1 Problem #1: Projectile Motion Cartesian Coordinates Polar Coordinates... 3

Legendre Transforms, Calculus of Varations, and Mechanics Principles

Lecture V: The game-engine loop & Time Integration

15. Hamiltonian Mechanics

Under evolution for a small time δt the area A(t) = q p evolves into an area

[ ] ( ) L = L = r p. We can deal with this more conveniently by writing: so that L becomes: α α α. α α N N N N

Second quantization: where quantization and particles come from?

Chapter 1. Principles of Motion in Invariantive Mechanics

Hamilton s principle and Symmetries

Concepts in Theoretical Physics

4.1 Important Notes on Notation

NONLINEAR MECHANICAL SYSTEMS LAGRANGIAN AND HAMILTONIAN FORMULATIONS. Lagrangian formulation. Ek * (f,q) = 1 2 f t I(q) f

Physical Dynamics (SPA5304) Lecture Plan 2018

The Particle-Field Hamiltonian

Review for Final. elementary mechanics. Lagrangian and Hamiltonian Dynamics. oscillations

06. Lagrangian Mechanics II

Sketchy Notes on Lagrangian and Hamiltonian Mechanics

What is Classical Molecular Dynamics?

(Most of the material presented in this chapter is taken from Thornton and Marion, Chap. 7) p j . (5.1) !q j. " d dt = 0 (5.2) !p j . (5.

Lagrangian Dynamics: Derivations of Lagrange s Equations

Lecture 41: Highlights

Maxima/minima with constraints

CP1 REVISION LECTURE 3 INTRODUCTION TO CLASSICAL MECHANICS. Prof. N. Harnew University of Oxford TT 2017

G : Statistical Mechanics

Central Forces. c 2007 Corinne Manogue. March 1999, last revised February 2009

Physical Dynamics (PHY-304)

Forces of Constraint & Lagrange Multipliers

Thermodynamics of Three-phase Equilibrium in Lennard Jones System with a Simplified Equation of State

Electric and Magnetic Forces in Lagrangian and Hamiltonian Formalism

Lecture Note 12: Dynamics of Open Chains: Lagrangian Formulation

Physics 115/242 The leapfrog method and other symplectic algorithms for integrating Newton s laws of motion

Brief Review of Statistical Mechanics

Classical Mechanics and Electrodynamics

Marion and Thornton. Tyler Shendruk October 1, Hamilton s Principle - Lagrangian and Hamiltonian dynamics.

The first order formalism and the transition to the

MATHEMATICAL PHYSICS

Noether s Theorem. 4.1 Ignorable Coordinates

The Equipartition Theorem

CE 530 Molecular Simulation

Molecular Dynamics 9/6/16

The Geometry of Euler s equation. Introduction

CHAPTER 9 Statistical Physics

Homework 3. 1 Goldstein Part (a) Theoretical Dynamics September 24, The Hamiltonian is given by

Ideal Gas Behavior. NC State University

Lagrangian and Hamiltonian Mechanics (Symon Chapter Nine)

df(x) = h(x) dx Chemistry 4531 Mathematical Preliminaries Spring 2009 I. A Primer on Differential Equations Order of differential equation

Ab initio molecular dynamics and nuclear quantum effects

Geometric methods for orbit integration. PiTP 2009 Scott Tremaine

Boltzmann-Gibbs Preserving Langevin Integrators

Multibody simulation

We start with some important background material in classical and quantum mechanics.

Housekeeping. No announcement HW #7: 3.19

PLANAR KINETIC EQUATIONS OF MOTION (Section 17.2)

Classical Mechanics and Electrodynamics

Homework 4. Goldstein 9.7. Part (a) Theoretical Dynamics October 01, 2010 (1) P i = F 1. Q i. p i = F 1 (3) q i (5) P i (6)

REVIEW. Hamilton s principle. based on FW-18. Variational statement of mechanics: (for conservative forces) action Equivalent to Newton s laws!

d 3 r d 3 vf( r, v) = N (2) = CV C = n where n N/V is the total number of molecules per unit volume. Hence e βmv2 /2 d 3 rd 3 v (5)

Physics 6010, Fall Relevant Sections in Text: Introduction

Estimating Accuracy in Classical Molecular Simulation

CE 530 Molecular Simulation

Nonlinear Single-Particle Dynamics in High Energy Accelerators

Physics 342 Lecture 26. Angular Momentum. Lecture 26. Physics 342 Quantum Mechanics I

The Accelerator Hamiltonian in a Straight Coordinate System

Physics 115/242 The leapfrog method and other symplectic algorithms for integrating Newton s laws of motion

Energy and Equations of Motion

Introduction to Hamiltonian Monte Carlo Method

Langevin Methods. Burkhard Dünweg Max Planck Institute for Polymer Research Ackermannweg 10 D Mainz Germany

The Klein-Gordon equation

CE 530 Molecular Simulation

G : Statistical Mechanics

Motion under the Influence of a Central Force

Analytical Mechanics for Relativity and Quantum Mechanics

Hamiltonian Field Theory

Physics 106a, Caltech 13 November, Lecture 13: Action, Hamilton-Jacobi Theory. Action-Angle Variables

Turning up the heat: thermal expansion

Quantum Continuum Mechanics for Many-Body Systems

Chemistry 532 Practice Final Exam Fall 2012 Solutions

Statistical Thermodynamics and Monte-Carlo Evgenii B. Rudnyi and Jan G. Korvink IMTEK Albert Ludwig University Freiburg, Germany

Enabling constant pressure hybrid Monte Carlo simulations using the GROMACS molecular simulation package

Canonical transformations (Lecture 4)

Lecture Note 12: Dynamics of Open Chains: Lagrangian Formulation

The Principle of Least Action

THE LAGRANGIAN AND HAMILTONIAN MECHANICAL SYSTEMS

8. INTRODUCTION TO STATISTICAL THERMODYNAMICS

Transcription:

CE 530 Molecular Simulation Lecture Molecular Dynamics Simulation David A. Kofke Department of Chemical Engineering SUNY Buffalo kofke@eng.buffalo.edu

MD of hard disks intuitive Review and Preview collision detection and impulsive dynamics Monte Carlo convenient sampling of ensembles no dynamics biasing possible to improve performance Molecular dynamics equations of motion integration schemes evaluation of dynamical properties extensions to other ensembles focus on atomic systems for now

3 Classical Equations of Motion Several formulations are in use Newtonian Lagrangian Hamiltonian Advantages of non-newtonian formulations more general, no need for fictitious forces better suited for multiparticle systems better handling of constraints can be formulated from more basic postulates Assume conservative forces! F =! U Gradient of a scalar potential energy

4 Newtonian Formulation Cartesian spatial coordinates r i = (x i,y i,z i ) are primary variables for N atoms, system of N nd-order differential equations m d r i dt m!!r i = F i Sample application: D motion in central force field m!!x = F ê x = f (r)ˆr ê x = xf x + y m!!y = F ê y = f (r)ˆr ê y = yf x + y Polar coordinates are more natural and convenient r F = f (r)ˆr mr! θ = l constant angular momentum m!! r = f (r) + l mr 3 fictitious (centrifugal) force

5 Generalized Coordinates Any convenient coordinates for description of particular system use q i as symbol for general coordinate examples diatomic {q,,q 6 } = {x com, y com, z com, r, θ, φ} -D motion in central field {q, q } = {r, θ} Kinetic energy general quadratic form K = M 0 (q) + examples rotating diatomic -D central motion M j (q)!q j + usually vanish M jk (q)!q j!q k ( ) + 8 m!r + r! K = m!q +!q +!q 3 K = m (!r + r θ! ) θ r φ θ + (r sinθ)!φ

6 Lagrangian Formulation Independent of coordinate system Define the Lagrangian L(q,!q) K(q,!q) U (q) Equations of motion d dt L!q L = 0 j q j j = N N second-order differential equations Central-force example ( ) U (r) L = m!r + r θ! d dt L!r = L r m!! r = mr θ! f (r)! F r =! r U = f (r) d dt L θ! = L θ d dt ( mr θ! ) = 0

7 Hamiltonian Formulation. Motivation Appropriate for application to statistical mechanics and quantum mechanics Newtonian and Lagrangian viewpoints take the q i as the fundamental variables N-variable configuration space!q i appears only as a convenient shorthand for dq/dt working formulas are nd-order differential equations Hamiltonian formulation seeks to work with st-order differential equations N variables treat the coordinate and its time derivative as independent variables appropriate quantum-mechanically

Hamiltonian Formulation. Preparation 8 Mathematically, Lagrangian treats q and!q as distinct L(q j,!q j,t) identify the generalized momentum as p j = L!q j e.g. if L = K U = m!q U (q); p = L /!q = m!q Lagrangian equations of motion We would like a formulation in which p is an independent variable p i is the derivative of the Lagrangian with respect to!q i, and we re looking to replace!q i with p i we need? dp dt j L = q j

9 Hamiltonian Formulation 3. Defintion a Legendre transform! Define the Hamiltonian, H H(q,p) = L(q,!q) p j!q j = K(q,!q) +U (q) + = a j!q j +U (q) + = + a j!q j +U (q) = K +U K!q!q j j (a j!q j )!q j H equals the total energy (kinetic plus potential)

0 Hamiltonian Formulation 4. Dynamics Hamilton s equations of motion From Lagrangian equations, written in terms of momentum Differential change in L dl = L L dq + q!q d!q =!pdq + pd!q Legendre transform H = (L p!q) dh = (!pdq!qdp) dh =!pdq +!qdp!q = + H p!p = H q dp dt =!p = L q p = L!q Lagrange s equation of motion Definition of momentum Hamilton s equations of motion Conservation of energy dh dt =!p dq dt +!q dp dt =!p!q +!q!p = 0

Hamiltonian Formulation 5. Example Particle motion in central force field H = K + U r pθ p = + + Ur () m mr r dr p () r dθ p () θ!q = + H = = dt m dt p mr dp (3) r pθ dp = f() r (4) θ!p = H Lagrange s equations = 0 dt 3 q mr dt m!! r = mr θ! f (r)! F r =! r U = f (r) Equations no simpler, but theoretical basis is better d dt ( mr θ! ) = 0

Phase Space (again) Return to the complete picture of phase space full specification of microstate of the system is given by the values of all positions and all momenta of all atoms Γ = (p N,r N ) view positions and momenta as completely independent coordinates connection between them comes only through equation of motion Motion through phase space helpful to think of dynamics as simple movement through the highdimensional phase space facilitate connection to quantum mechanics basis for theoretical treatments of dynamics understanding of integrators Γ

3 Integration Algorithms Equations of motion in cartesian coordinates dr j dt dp dt j = p j m = F j r = ( r, r ) p = ( p, p ) i= i j F Desirable features of an integrator minimal need to compute forces (a very expensive calculation) good stability for large time steps good accuracy conserves energy and momentum time-reversible area-preserving (symplectic) x x N y y -dimensional space (for example) Fj = Fij pairwise additive forces More on these later

Verlet Algorithm. Equations 4 Very simple, very good, very popular algorithm Consider expansion of coordinate forward and backward in time r(t + δt) = r(t) + m p(t)δt + m F(t)δt + 3!!!! r(t)δt3 + O(δt 4 ) r(t δt) = r(t) m p(t)δt + m F(t)δt 3!!!! r(t)δt3 + O(δt 4 ) Add these together Rearrange 4 r( t+ δt) + r( t δt) = r( t) + F( t) δt + O( δt ) update without ever consulting velocities! m m 4 r( t+ δt) = r( t) r( t δt) + F( t) δt + O( δt )

Verlet Algorithm. Flow diagram 5 One force evaluation per time step One MD Cycle Configuration r(t) Previous configuration r(t-dt) Compute forces F(t) on all atoms using r(t) Advance all positions according to r(t+δt) = r(t)-r(t-δt)+f(t)/m dt Add to block sum Entire Simulation Initialization Reset block sums New configuration move per cycle Add to block sum cycles per block Compute block average blocks per simulation Compute final results No End of block? Yes Block averages

6 Verlet Algorithm. Flow Diagram r v F t-δt t t+δt Given current position and position at end of previous time step Schematic from Allen & Tildesley, Computer Simulation of Liquids

7 Verlet Algorithm. Flow Diagram r v F t-δt t t+δt Compute the force at the current position Schematic from Allen & Tildesley, Computer Simulation of Liquids

8 Verlet Algorithm. Flow Diagram r v F t-δt t t+δt Compute new position from present and previous positions, and present force Schematic from Allen & Tildesley, Computer Simulation of Liquids

9 Verlet Algorithm. Flow Diagram r v F t-δt t-δt t t+δt Advance to next time step, repeat Schematic from Allen & Tildesley, Computer Simulation of Liquids

Forces. Formalism 3 Force is the gradient of the potential F Force on, due to = ur ( ) ur ( ) ur ( ) = e x e x y du( r) r r = x dr e + e x y f( r) = x x + y y r e e y y 4 y x r r x x y y = ( ) + ( ) Energy Force / F = F 0 -.0.5.0 Separation, r/σ.5

Forces. LJ Model 4 Force is the gradient of the potential f( r ) F e ey = x x y r + e.g., Lennard-Jones model σ σ ur () = 4ε r r du f() r = dr 6 48ε σ σ =+ σ r r 3 7 4 8 48ε σ σ F = x x y σ r + r e e 4 0 y - y x r r x x y y = ( ) + ( ) Energy Force /.0.5.0 Separation, r/σ.5

7 Verlet Algorithm. 4. Loose Ends Initialization how to get position at previous time step when starting out? simple approximation r( t δt) = r( t ) v( t ) δt 0 0 0 Obtaining the velocities not evaluated during normal course of algorithm needed to compute some properties, e.g. temperature diffusion constant finite difference v() t = [ r( t+ δt) r( t δt) ] + O( δt ) δ t

Verlet Algorithm 5. Performance Issues 8 Time reversible forward time step replace δt with -δt r( t δt) = r( t) r( t + δt) + F() t δt m same algorithm, with same positions and forces, moves system backward in time Numerical imprecision of adding large/small numbers m r( t+ δt) = r( t) r( t δt) + F( t) δt r( t+ ( δt) ) = r( t) r( t ( δt) ) + F( t) ( δ t) O(δt ) O(δt ) m r( t+ δt) r( t) = r( t) r( t δt) + F( t) δt m O(δt 0 ) O(δt 0 ) O(δt )

Initial Velocities (from Lecture 3) Random direction randomize each component independently randomize direction by choosing point on spherical surface Magnitude consistent with desired temperature. Choices: Maxwell-Boltzmann: Uniform over (-/,+/), then scale so that Constant at vx =± kt/ m Same for y, z components ( x ) prob( v ) exp mv / kt Be sure to shift so center-of-mass momentum is zero P x N p i, x p p P ix, ix, x x N v ix, = / kt m 9

30 Leapfrog Algorithm Eliminates addition of small numbers O(δt ) to differences in large ones O(δt 0 ) Algorithm δ m r( t+ t) = r( t) + v( t+ δt) δt v( t+ δt) = v( t δt) + F( t) δt

3 Leapfrog Algorithm Eliminates addition of small numbers O(δt ) to differences in large ones O(δt 0 ) Algorithm δ m r( t+ t) = r( t) + v( t+ δt) δt v( t+ δt) = v( t δt) + F( t) δt Mathematically equivalent to Verlet algorithm r( t+ δt) = r( t) + ( t t) v δ + F( t) δt δt m

3 Leapfrog Algorithm Eliminates addition of small numbers O(δt ) to differences in large ones O(δt 0 ) Algorithm δ m r( t+ t) = r( t) + v( t+ δt) δt v( t+ δt) = v( t δt) + F( t) δt Mathematically equivalent to Verlet algorithm r( t+ δt) = r( t) + ( t t) v δ + F( t) δt δt m r(t) as evaluated from previous time step r() t = r( t δt) + v( t δt) δt

33 Leapfrog Algorithm Eliminates addition of small numbers O(δt ) to differences in large ones O(δt 0 ) Algorithm δ m r( t+ t) = r( t) + v( t+ δt) δt v( t+ δt) = v( t δt) + F( t) δt Mathematically equivalent to Verlet algorithm r( t+ δt) = r( t) + ( t t) v δ + F( t) δt δt m r(t) as evaluated from previous time step r() t = r( t δt) + v( t δt) δt ( ) r( t+ δt) = r( t) + r( t) r( t δt) + F( t) δt m

34 Leapfrog Algorithm Eliminates addition of small numbers O(δt ) to differences in large ones O(δt 0 ) Algorithm δ m r( t+ t) = r( t) + v( t+ δt) δt v( t+ δt) = v( t δt) + F( t) δt Mathematically equivalent to Verlet algorithm r( t+ δt) = r( t) + ( t t) v δ + F( t) δt δt m r(t) as evaluated from previous time step r() t = r( t δt) + v( t δt) δt ( ) r( t+ δt) = r( t) + r( t) r( t δt) + F( t) δt m r( t+ δt) = r( t) r( t δt) + F( t) δt original algorithm m

35 Leapfrog Algorithm. Flow Diagram r v F t-δt t t+δt Given current position, and velocity at last half-step Schematic from Allen & Tildesley, Computer Simulation of Liquids

36 Leapfrog Algorithm. Flow Diagram r v F t-δt t t+δt Compute current force Schematic from Allen & Tildesley, Computer Simulation of Liquids

37 Leapfrog Algorithm. Flow Diagram r v F t-δt t t+δt Compute velocity at next half-step Schematic from Allen & Tildesley, Computer Simulation of Liquids

38 Leapfrog Algorithm. Flow Diagram r v F t-δt t t+δt Compute next position Schematic from Allen & Tildesley, Computer Simulation of Liquids

39 Leapfrog Algorithm. Flow Diagram r v F t-δt t-δt t t+δt Advance to next time step, repeat Schematic from Allen & Tildesley, Computer Simulation of Liquids

40 Leapfrog Algorithm. 3. Loose Ends Initialization how to get velocity at previous time step when starting out? simple approximation 0 δ = 0 m 0 v( t t) v( t ) F( t ) δt Obtaining the velocities interpolate v() t = ( t δt) ( t δt) v + + v

4 Velocity Verlet Algorithm Roundoff advantage of leapfrog, but better treatment of velocities Algorithm v( + ) = v( ) + [ F( ) + F( + ) m ] Implemented in stages given current force compute r at new time add current-force term to velocity (gives v at half-time step) compute new force add new-force term to velocity Also mathematically equivalent to Verlet algorithm (in giving values of r) m r( t + δt) = r( t) + v( t) δt + F( t) δt t δt t t t δt δt

4 Velocity Verlet Algorithm. Flow Diagram t-δt t t+δt r v Given current position, velocity, and force F Schematic from Allen & Tildesley, Computer Simulation of Liquids

43 Velocity Verlet Algorithm. Flow Diagram t-δt t t+δt r v Compute new position F Schematic from Allen & Tildesley, Computer Simulation of Liquids

44 Velocity Verlet Algorithm. Flow Diagram t-δt t t+δt r v Compute velocity at half step F Schematic from Allen & Tildesley, Computer Simulation of Liquids

45 Velocity Verlet Algorithm. Flow Diagram t-δt t t+δt r v Compute force at new position F Schematic from Allen & Tildesley, Computer Simulation of Liquids

46 Velocity Verlet Algorithm. Flow Diagram t-δt t t+δt r v Compute velocity at full step F Schematic from Allen & Tildesley, Computer Simulation of Liquids

47 Velocity Verlet Algorithm. Flow Diagram t-δt t-δt t t+δt r v Advance to next time step, repeat F Schematic from Allen & Tildesley, Computer Simulation of Liquids

48 Other Algorithms Predictor-Corrector not time reversible easier to apply in some instances constraints rigid rotations Beeman better treatment of velocities Velocity-corrected Verlet

49 Summary Several formulations of mechanics Hamiltonian preferred independence of choice of coordinates emphasis on phase space Integration algorithms Calculation of forces Simple Verlet algorithms Verlet Leapfrog Velocity Verlet Next up: Calculation of dynamical properties