Lecture 3: Integration Algorithms Professor A. Martini Purdue - - PowerPoint PPT Presentation

lecture 3 integration algorithms
SMART_READER_LITE
LIVE PREVIEW

Lecture 3: Integration Algorithms Professor A. Martini Purdue - - PowerPoint PPT Presentation

Short Course on Molecular Dynamics Simulation Lecture 3: Integration Algorithms Professor A. Martini Purdue University High Level Course Outline MD Basics 1. Potential Energy Functions 2. Integration Algorithms 3. Temperature Control


slide-1
SLIDE 1

Professor A. Martini Purdue University

Lecture 3: Integration Algorithms

Short Course on Molecular Dynamics Simulation

slide-2
SLIDE 2
  • A. Martini

Molecular Dynamics Simulation Last Updated 8/2009

High Level Course Outline

1.

MD Basics

2.

Potential Energy Functions

3.

Integration Algorithms

4.

Temperature Control

5.

Boundary Conditions

6.

Neighbor Lists

7.

Initialization and Equilibrium

8.

Extracting Static Properties

9.

Extracting Dynamic Properties

  • 10. Non-Equilibrium MD
slide-3
SLIDE 3
  • A. Martini

Molecular Dynamics Simulation Last Updated 8/2009

Integration Algorithms

Potential energy (force) is a function of 3N

atomic positions

There is no analytical solution to the

equations of motion which must be solved numerically

i i i

a m F v v =

dt v d a

i i

v v =

dt r d v

i i

v v =

slide-4
SLIDE 4
  • A. Martini

Molecular Dynamics Simulation Last Updated 8/2009

Integration Algorithms

General Rules:

– Conservation of energy – Reversible – Computational efficient – Enable a “long” integration time step – Only one force evaluation per time step

Commonly used integrators:

– Verlet – Velocity Verlet – Predictor-Corrector – Gear Predictor-Corrector

slide-5
SLIDE 5
  • A. Martini

Molecular Dynamics Simulation Last Updated 8/2009

Integration Algorithms

Error:

– Round off error vs. truncation – Local vs. global

Integration Time Step Total Global Error Round-Off Error Dominant Truncation Error Dominant

slide-6
SLIDE 6
  • A. Martini

Molecular Dynamics Simulation Last Updated 8/2009

Integration Algorithms

Verlet Algorithm:

– Derived from two Taylor expansions

) ( ) ( ! 3 1 ) ( 2 1 ) ( ) ( ) ( ) ( ) ( ! 3 1 ) ( 2 1 ) ( ) ( ) (

4 3 3 3 2 2 2 4 3 3 3 2 2 2

t O t dt t r d t dt t r d t dt t dr t r t t r t O t dt t r d t dt t r d t dt t dr t r t t r δ δ δ δ δ δ δ δ δ δ + − + − = − + + + + = +

– Add together and simplify

) ( ) ( ) ( ) ( 2 ) (

4 2 2 2

t O t dt t r d t t r t r t t r δ δ δ δ + + − − = +

slide-7
SLIDE 7
  • A. Martini

Molecular Dynamics Simulation Last Updated 8/2009

Integration Algorithms

Notes on Verlet:

– Velocities not explicitly solved, calculated typically from first order central difference – Position vector at t+δt requires positions previous two time steps; a two-step method; not self starting – Advantages: simplicity and good stability – Global error O(δt 2)

t t t r t t r t v δ δ δ 2 ) ( ) ( ) ( − − + =

slide-8
SLIDE 8
  • A. Martini

Molecular Dynamics Simulation Last Updated 8/2009

Integration Algorithms

Velocity Verlet Algorithm:

– Improved accuracy compared to standard Verlet – Start with position and velocity expansions ... ) ( ) ( [ 2 1 ) ( ) ( ... ) ( 2 1 ) ( ) ( ) (

2

+ + + + = + + + + = + t t a t a t t v t t v t t a t t v t r t t r δ δ δ δ δ δ

slide-9
SLIDE 9
  • A. Martini

Molecular Dynamics Simulation Last Updated 8/2009

Integration Algorithms

  • Velocity Verlet Algorithm:

– Each integration cycle

  • 1. Calculate velocities at mid-

step

  • 2. Calculate positions at the

next step

  • 3. Calculate accelerations at

next step from the potential

  • 4. Update the velocities

t t a t v t t v δ δ ) ( 2 1 ) ( ) 2 ( + = +

t t t v t r t t r δ δ δ ⎟ ⎠ ⎞ ⎜ ⎝ ⎛ + + = + 2 ) ( ) ( t t t a t t v t t v δ δ δ δ ) ( 2 1 2 ) ( + + ⎟ ⎠ ⎞ ⎜ ⎝ ⎛ + = +

slide-10
SLIDE 10
  • A. Martini

Molecular Dynamics Simulation Last Updated 8/2009

Integration Algorithms

  • Predictor-Corrector Algorithms:
  • 1. Predict positions and velocities at the end of the

next timestep

  • 2. Evaluate forces at the next time step using the

predicted positions

  • 3. Correct the predicted positions and velocities
slide-11
SLIDE 11
  • A. Martini

Molecular Dynamics Simulation Last Updated 8/2009

Integration Algorithms

  • Predictor-Corrector Algorithms:
  • 1. Predict the system configuration at the end of

the next timestep using Taylor expansion

... ) ( ) ( ... ) ( ) ( ... ) ( ) ( ... ) ( ) ( + = + + = + + = + + = + t b t t b t a t t a t v t t v t r t t r δ δ δ δ

slide-12
SLIDE 12
  • A. Martini

Molecular Dynamics Simulation Last Updated 8/2009

Integration Algorithms

  • Predictor-Corrector Algorithms:
  • 2. Evaluate forces at the next time step using the

predicted system state; difference between the predicted and newly calculated acceleration is the error

) ( ) ( ) ( t t a t t a t t a

p c

δ δ δ + − + = + Δ

slide-13
SLIDE 13
  • A. Martini

Molecular Dynamics Simulation Last Updated 8/2009

Integration Algorithms

  • Predictor-Corrector Algorithms:
  • 3. Use the error calculated in the previous step to

correct all next step values

) ( ) ( ) ( ) ( ) ( ) ( ) ( ) ( ) ( ) ( ) ( ) (

3 2 1

t t a c t t b t t b t t a c t t a t t a t t a c t t v t t v t t a c t t r t t r

p c p c p c p c

δ δ δ δ δ δ δ δ δ δ δ δ + Δ + + = + + Δ + + = + + Δ + + = + + Δ + + = +

– Coefficients maximize stability and are dependant on the specific algorithm chosen

slide-14
SLIDE 14
  • A. Martini

Molecular Dynamics Simulation Last Updated 8/2009

Integration Algorithms

  • Gear Predictor-Corrector Algorithms:

– Predict using 5th order Taylor series – So need five derivatives of position at each timestep – Coefficients are tabulated for q-order predictors:

  • For example, with q=3

– C0=1/6 – C1=5/6 – C2=1 – C3=1/3

– Error is O(δt q+1)

slide-15
SLIDE 15
  • A. Martini

Molecular Dynamics Simulation Last Updated 8/2009

Integration Algorithms

  • Choosing a time step

– Too small trajectory covers only a limited part of the phase space – Too large numerical instability – Timestep should be ~ 1 order of magnitude smaller than the shortest motion time scale – In general:

10-15 or 5x10-16 Translation, Rotation, Torsion and Vibration Flexible molecules, flexible bonds 2x10-15 Translation, Rotation and Torsion Flexible molecules, rigid bonds 5x10-15 Translation and Rotation Rigid molecules 10-14 Translation Atoms Time Step (s) Types of Motion System