The Verlet Algorithm for Molecular Dynamics Simulations

Similar documents
Numerical Analysis MTH603. dy dt = = (0) , y n+1. We obtain yn. Therefore. and. Copyright Virtual University of Pakistan 1

232 Calculus and Structures

Numerical Differentiation

Precalculus Test 2 Practice Questions Page 1. Note: You can expect other types of questions on the test than the ones presented here!

1 The concept of limits (p.217 p.229, p.242 p.249, p.255 p.256) 1.1 Limits Consider the function determined by the formula 3. x since at this point

The Derivative as a Function

f a h f a h h lim lim

158 Calculus and Structures

Order of Accuracy. ũ h u Ch p, (1)

Chapter 5 FINITE DIFFERENCE METHOD (FDM)

4. The slope of the line 2x 7y = 8 is (a) 2/7 (b) 7/2 (c) 2 (d) 2/7 (e) None of these.

Higher Derivatives. Differentiable Functions

The total error in numerical differentiation

lecture 26: Richardson extrapolation

Derivatives of Exponentials

Math 102 TEST CHAPTERS 3 & 4 Solutions & Comments Fall 2006

Math 1241 Calculus Test 1

5.1 We will begin this section with the definition of a rational expression. We

Section 2.7 Derivatives and Rates of Change Part II Section 2.8 The Derivative as a Function. at the point a, to be. = at time t = a is

2.8 The Derivative as a Function

LIMITATIONS OF EULER S METHOD FOR NUMERICAL INTEGRATION

Exam 1 Review Solutions

A = h w (1) Error Analysis Physics 141

1. Which one of the following expressions is not equal to all the others? 1 C. 1 D. 25x. 2. Simplify this expression as much as possible.

Function Composition and Chain Rules

(a) At what number x = a does f have a removable discontinuity? What value f(a) should be assigned to f at x = a in order to make f continuous at a?

How to Find the Derivative of a Function: Calculus 1

LECTURE 14 NUMERICAL INTEGRATION. Find

Calculus I Practice Exam 1A

Pre-Calculus Review Preemptive Strike

Consider a function f we ll specify which assumptions we need to make about it in a minute. Let us reformulate the integral. 1 f(x) dx.

LIMITS AND DERIVATIVES CONDITIONS FOR THE EXISTENCE OF A LIMIT

3.1 Extreme Values of a Function

Chapter 8. Numerical Solution of Ordinary Differential Equations. Module No. 2. Predictor-Corrector Methods

Math 34A Practice Final Solutions Fall 2007

Differential Calculus (The basics) Prepared by Mr. C. Hull

Investigating Euler s Method and Differential Equations to Approximate π. Lindsay Crowl August 2, 2001

Continuity. Example 1

MVT and Rolle s Theorem

(4.2) -Richardson Extrapolation

Chapters 19 & 20 Heat and the First Law of Thermodynamics

Lecture 21. Numerical differentiation. f ( x+h) f ( x) h h

Section 3.1: Derivatives of Polynomials and Exponential Functions

Solution. Solution. f (x) = (cos x)2 cos(2x) 2 sin(2x) 2 cos x ( sin x) (cos x) 4. f (π/4) = ( 2/2) ( 2/2) ( 2/2) ( 2/2) 4.

Continuity and Differentiability Worksheet

Lesson 6: The Derivative

NUMERICAL DIFFERENTIATION

Practice Problem Solutions: Exam 1

Teaching Differentiation: A Rare Case for the Problem of the Slope of the Tangent Line

Excerpt from "Calculus" 2013 AoPS Inc.

AN IMPROVED WEIGHTED TOTAL HARMONIC DISTORTION INDEX FOR INDUCTION MOTOR DRIVES

Chapter Seven The Quantum Mechanical Simple Harmonic Oscillator

Quantum Numbers and Rules

2.3 Product and Quotient Rules

Solutions to the Multivariable Calculus and Linear Algebra problems on the Comprehensive Examination of January 31, 2014

Introduction to Derivatives

AMS 147 Computational Methods and Applications Lecture 09 Copyright by Hongyun Wang, UCSC. Exact value. Effect of round-off error.

Mathematics 5 Worksheet 11 Geometry, Tangency, and the Derivative

1 1. Rationalize the denominator and fully simplify the radical expression 3 3. Solution: = 1 = 3 3 = 2

Definition of the Derivative

A.P. CALCULUS (AB) Outline Chapter 3 (Derivatives)

University Mathematics 2

THE IDEA OF DIFFERENTIABILITY FOR FUNCTIONS OF SEVERAL VARIABLES Math 225

SECTION 3.2: DERIVATIVE FUNCTIONS and DIFFERENTIABILITY

Lecture 15. Interpolation II. 2 Piecewise polynomial interpolation Hermite splines

Lab 6 Derivatives and Mutant Bacteria

Physically Based Modeling: Principles and Practice Implicit Methods for Differential Equations

NUMERICAL DIFFERENTIATION. James T. Smith San Francisco State University. In calculus classes, you compute derivatives algebraically: for example,

4.2 - Richardson Extrapolation

We name Functions f (x) or g(x) etc.

Combining functions: algebraic methods

Math 212-Lecture 9. For a single-variable function z = f(x), the derivative is f (x) = lim h 0

Work and Energy. Introduction. Work. PHY energy - J. Hedberg

Finding and Using Derivative The shortcuts

Polynomial Interpolation

3.4 Worksheet: Proof of the Chain Rule NAME

Some Review Problems for First Midterm Mathematics 1300, Calculus 1

Chapter 4 Derivatives [ ] = ( ) ( )= + ( ) + + = ()= + ()+ Exercise 4.1. Review of Prerequisite Skills. 1. f. 6. d. 4. b. lim. x x. = lim = c.

1. Consider the trigonometric function f(t) whose graph is shown below. Write down a possible formula for f(t).

Pre-lab Quiz/PHYS 224 Earth s Magnetic Field. Your name Lab section

Finite Difference Methods Assignments

A Reconsideration of Matter Waves

Copyright c 2008 Kevin Long

Gradient Descent etc.

Exercises for numerical differentiation. Øyvind Ryan

HOW TO DEAL WITH FFT SAMPLING INFLUENCES ON ADEV CALCULATIONS

5.74 Introductory Quantum Mechanics II

The derivative function

Section 2.1 The Definition of the Derivative. We are interested in finding the slope of the tangent line at a specific point.

1watt=1W=1kg m 2 /s 3

lecture 35: Linear Multistep Mehods: Truncation Error

SFU UBC UNBC Uvic Calculus Challenge Examination June 5, 2008, 12:00 15:00

Preface. Here are a couple of warnings to my students who may be here to get a copy of what happened on a day that you missed.

The Priestley-Chao Estimator

Symmetry Labeling of Molecular Energies

2.1 THE DEFINITION OF DERIVATIVE

Implicit-explicit variational integration of highly oscillatory problems

Runge-Kutta methods. With orders of Taylor methods yet without derivatives of f (t, y(t))

Logarithmic functions

Test 2 Review. 1. Find the determinant of the matrix below using (a) cofactor expansion and (b) row reduction. A = 3 2 =

Transcription:

Cemistry 380.37 Fall 2015 Dr. Jean M. Standard November 9, 2015 Te Verlet Algoritm for Molecular Dynamics Simulations Equations of motion For a many-body system consisting of N particles, Newton's classical equations of motion are! F i = m i! a i, i = 1,2,,N. (1)! In tis equation, F i denotes te force on te it particle, m i is te mass of te particle, and a! i is te acceleration. Te arrows over te force and acceleration denote te x, y, and z components of te vectors. In te rest of tis andout, te vector notation will be dropped for convenience. Taylor Series Approximation Te solution of Newton's equations using te Verlet algoritm is based on a Taylor series expansion. Expanding te position of te it particle r i at time t+ and t in Taylor series yields, r i (t + ) = r i (t) + r i ' (t) + 2 2! r i'' (t) + 2 3! r i''' (t) + O( 4 ) (2) r i (t ) = r i (t) r i ' (t) + 2 Adding tese two equations leads to te result 2! r i '' (t) 3 3! r i ''' (t) + O( 4 ). r i (t + ) + r i (t ) = 2 r i (t) + 2 r i '' (t) + O( 4 ). (3) Note tat r i ' (t) is equivalent to te velocity of te particle, v i (t), and r i '' (t) is te acceleration of te particle, a i (t). Making tese substitutions in Eq. (3), we ave r i (t + ) + r i (t ) = 2 r i (t) + 2 a i (t) + O( 4 ). (4) Solving for r i (t + ) and using Newton's equations for te acceleration ( a i = F i /m i ) leads to r i (t + ) = 2 r i (t) r i (t ) + 2 m i F i (t) + O( 4 ). (5) Discretization of Time Te time is a continuous variable, but to implement Eq. (5) on a computer requires te solution to be generated for discrete time steps suc tat t n +1 t n =, (6) were is te step size for te time variable.

2 Discretizing time in Eq. (5) leads to te Verlet algoritm (1967), r i (t n +1 ) = 2 r i (t n ) r i (t n 1 ) + 2 m i F i (t n ) + O( 4 ). (7) Note tat te Verlet Algoritm relies on two previous time steps, t n and t n 1, to advance te solution forward in time, and it is a fourt-order metod. Tere are sometimes problems associated wit te Verlet algoritm due to potential loss of accuracy wen Eq. (7) is implemented. Te final term in te equation tends to be small compared to te oters, and tis term may as a result get lost in te round-off error. Notice tat te velocity does not explicitly appear in te Verlet algoritm. Tis may be a problem if properties of te system tat depend on velocity, suc as kinetic energy, are desired. Also, te velocity at time t n cannot be calculated until te position at time t n +1 is obtained. As a result te velocity is usually calculated from te positions using an approximate formula based on te derivative of te position, v i (t n ) = r i (t n +1 ) r i (t n 1 ) 2. (8) Also notice tat te Verlet algoritm is not self-starting, since it requires te positions at two previous times ( t n and t n 1 ) to get te position at te next time, t n+1. Tis is usually overcome by first completing one step of a less accurate metod tat only requires information at one previous time step, suc as te Euler metod, and ten switcing to te Verlet metod for subsequent steps. Te Verlet Leapfrog Algoritm In an attempt to correct some of te problems associated wit te original Verlet algoritm, te Verlet Leapfrog algoritm was developed. Using an approximation for te derivative, te velocity at te midpoint between times t n and t n+1 can be defined as, v i (t n+1/ 2 ) = r i (t n+1 ) r i (t n ), (9) Eq. (8) can be solved for r i (t n +1 ) to yield r i (t n +1 ) = r i (t n ) + v i (t n +1/ 2 ). (10) Similarly, defining te velocity at te midpoint between times t n 1 and t n gives v i (t n 1/ 2 ) = r i (t n ) r i (t n 1 ). (11) Te acceleration at time t n can be defined using anoter approximate formula for te derivative, a i (t n ) = v i (t n+1/ 2 ) v i (t n 1/ 2 ). (12)

3 Using Newton's equations for te acceleration, a i (t n ) = F i (t n ) /m i, and equating te acceleration to Eq. (12) yields v i (t n+1/ 2 ) v i (t n 1/ 2 ) = F i (t n ) m i, (13) wic can be solved for v i (t n+1/ 2 ), v i (t n+1/ 2 ) = v i (t n 1/ 2 ) + m i F i (t n ). (14) Eqs. (10) and (14) constitute te equations of te Verlet Leapfrog algoritm. Te Leapfrog algoritm as some advantages over te original Verlet algoritm, Eq. (7). First, te loss of accuracy due to round-off error in te original Verlet algoritm because of vastly different magnitudes of terms in te equation is corrected. Second, te velocities are included explicitly in te metod, unlike te original Verlet algoritm. Tere are still a few problems associated wit te Leapfrog algoritm, owever. First, it is still not self-starting. Tis can be overcome as in te original Verlet metod by completing one step of te Euler metod first, and ten switcing to te Leapfrog algoritm for subsequent steps. Toug te Leapfrog algoritm produces bot positions and velocities, te velocities are obtained at 1/2-integer time steps ( t n +1/ 2, t n + 3/ 2, t n+ 5/ 2,...), wile te positions are obtained at integer time steps ( t n, t n +1, t n + 2,...). If te velocities at integer time steps are required, an auxiliary equation may be utilized wic simply averages te 1/2- integer velocities, v i (t n ) = 1 [ 2 v i (t n 1/ 2 ) + v i (t n+1/ 2 )]. (15) Example: Verlet Leapfrog Algoritm for Bond Stretcing Consider te simple one-dimensional armonic potential as a representation of te motion of te vibrations of a bond in a molecular system, V( x) = 1 2 k x 2. (16) Te coordinate x represents te bond displacement, x = r r eq. Te Verlet leapfrog algoritm for tis system is given by x( t n +1 ) = x( t n ) + v x ( t n +1/ 2 ) v x ( t n +1/ 2 ) = v x ( t n 1/ 2 ) + µ F x( t n ). (17) Te force F x is obtained from te force field, F x = dv dx F x = kx. (18)

4 Substituting, te Verlet Leapfrog equations become x( t n +1 ) = x( t n ) + v x ( t n +1/ 2 ) v x ( t n +1/ 2 ) = v x ( t n 1/ 2 ) k m x ( t n). (19) Example: Carbon-Carbon Bond Stretcing Using te Verlet Leapfrog Algoritm Modeling Carbon-Carbon Bonds To apply te Verlet Leapfrog algoritm (Eq. 19) to model te motion of a carbon-carbon bond, ten te mass m would be replaced by te reduced mass µ of te bond. For a bond A-B, te reduced mass µ is defined as µ = m A m B m A + m B. (20) were m A and m B are te masses of atoms A and B. So, for a carbon-carbon bond, te reduced mass is 6.0 g/mol (or about 10940 atomic units). Te force constants for carbon-carbon bonds from te on-line CRC (Table 9-75) are listed in Table 1 in units of kcal mol 1 Å 2, N/cm, N/m (or J/m 2 ), and atomic units (artree/bor 2 ). Table 1. Force constants for typical carbon-carbon bonds. C C C Bond Force Constant (kcal mol 1 Å 2 ) Force Constant (N/cm) Force Constant (N/m) Force Constant (a.u.) C (from C 2 H 6 ) 648 4.50 450 0.289 C (from CCl 2 CH 2 ) 1213 8.43 843 0.541 C (from C 2 ) 1750 12.16 1216 0.781 Results: Variation of Force Constants Calculations were performed using te tree force constants given in Table 1 (k=0.289, 0.541, and 0.781 a.u.), representing carbon-carbon single, double, and triple bonds, respectively. Te Verlet Leapfrog Algoritm was implemented using a value of 5 a.u. for and 500 total time steps wit an initial position of 0 a.u. and an initial velocity of 0.003 a.u. [Note tat an atomic unit of time is 2.419 10 17 s, or 0.024 fs. An atomic unit of distance (one bor) equals 0.5291771 Å. An atomic unit of velocity equals 2.188 10 5 m/s.] Te position and velocity values are plotted as functions of time to demonstrate te dynamics of a carbon-carbon bond modeled by eac of te force constants in Figures 1-3. Note tat in eac case te position oscillates symmetrically about x=0, a caracteristic of te armonic oscillator. In addition, we see tat te velocity is out of pase wit te position (and it also oscillates symmetrically about v=0). Te figures also sow tat as te force constant increases, te frequency of oscillation of te C-C bond increases, as would be expected as a result of te relationsip between te armonic frequency and force constant. Te period of oscillation terefore decreases as te force constant increases, from 0.030 ps to 0.022 ps to 0.018 ps for force constants of 0.289, 0.541, and 0.781 a.u., respectively.

5 (a) (b) Figure 1. (a) Bond displacement and (b) velocity as functions of time for a model carbon-carbon single bond wit k=0.289 a.u. (a) (b) Figure 2. (a) Bond displacement and (b) velocity as functions of time for a model carbon-carbon double bond wit k=0.541 a.u. (a) (b) Figure 3. (a) Bond displacement and (b) velocity as functions of time for a model carbon-carbon triple bond wit k=0.781 a.u.

6 Testing te Accuracy of te Verlet Algoritm Te exact solution for te position at eac time step for te armonic oscillator may be compared to te numerical solution from te Verlet Algoritm. Comparisons were made wit te following time steps and number of points: (a.u.): 10. 5. 2. # steps: 200 400 1000 Te initial conditions used for eac run were x 0 = 0.0 a.u. and v 0 = 0.003 a.u. Te absolute error between te Verlet and exact results for te bond displacement coordinate x were plotted as functions of time. Results for eac of te force constants are sown in Figures 4-6. Figure 4. Absolute error in position as a function of time for a model carbon-carbon double bond wit k=0.289 a.u. Figure 5. Absolute error in position as a function of time for a model carbon-carbon double bond wit k=0.541 a.u.

7 Figure 6. Absolute error in position as a function of time for a model carbon-carbon double bond wit k=0.789 a.u. Te maximum absolute error in te position sown in eac of Figures 4-6 clearly increases over time. It is also cyclic, since we can see tat te largest error occurs at te maximum or minimum extension of te bond. For eac time step, te maximum absolute error over one oscillation cycle can be compared. Results are given in Table 2. Table 2. Maximum absolute error for different time steps and force constants. Maximum Absolute Error (a.u.) (a.u.) k = 0.289 a.u. k = 0.541 a.u. k = 0.781 a.u. 10 3.148 10 4 4.310 10 4 5.176 10 4 5 7.869 10 5 1.077 10 4 1.294 10 4 2 1.259 10 5 1.723 10 5 2.070 10 5 Te results sow tat te absolute error decreases as te time step decreases. Similar trends are observed for eac of te tree force constants. Notice, owever, tat te decrease in te error is not linear. A grap sowing te maximum absolute error plotted against te time step is sown in Figure 7.

8 Figure 7. Maximum absolute error in position as a function of step size in time for model carboncarbon bonds. Te results sown in Figure 7 appear rougly quadratic in form. Looking at te data, we see tat wen te step size decreases from 10 to 5 a.u. (a factor of 2), te error decreases by a factor of 4. Similarly, wen te step size decreases from 10 to 2 a.u. (a factor of 5), te error decreases by a factor of 25. Te relationsip between step size and error can be explored furter. Assume tat te error as te following form, Error = C M, (21) were C is a constant and M is an integer. Taking te log of bot sides yields, log( Error) = logc + M log( ). (22) Tis equation indicates tat a plot of log(error) on te y-axis and log() on te x-axis sould be linear wit a slope of M. If te error scales quadratically wit te step size, ten te slope sould be equal to 2. Te log plot is sown in Figure 8.

9 Figure 8. Log-log plot of maximum error in bond displacement and step size for Verlet Leapfrog algoritm. As illustrated in Figure 8, te slope for all te k values does indeed equal 2. Tis verifies tat wen te step size is decreases by some factor S, ten te error decreases by S 2.