Scientific Computing II

Similar documents
Lecture IV: Time Discretization

Lecture V: The game-engine loop & Time Integration

Ordinary Differential Equations II

Ordinary Differential Equations II

Runga-Kutta Schemes. Exact evolution over a small time step: Expand both sides in a small time increment: d(δt) F (x(t + δt),t+ δt) Ft + FF x ( t)

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

Ordinary differential equations. Phys 420/580 Lecture 8

1 Ordinary differential equations

QUESTIONS FOR THE TESTS-ECI 146

PowerPoints organized by Dr. Michael R. Gustafson II, Duke University

Applied Math for Engineers

Solving Ordinary Differential Equations

PowerPoints organized by Dr. Michael R. Gustafson II, Duke University

What is Classical Molecular Dynamics?

Ordinary Differential Equations (ODEs)

Euler s Method applied to the control of switched systems

Draft TAYLOR SERIES METHOD FOR SYSTEM OF PARTICLES INTERACTING VIA LENNARD-JONES POTENTIAL. Nikolai Shegunov, Ivan Hristov

Chap. 20: Initial-Value Problems

Algorithms of Scientific Computing II

A Brief Introduction to Numerical Methods for Differential Equations

Numerical Methods - Initial Value Problems for ODEs

Numerical Methods for the Solution of Differential Equations

Differential Equations

Ordinary differential equations - Initial value problems

Finite Difference and Finite Element Methods

Module 4: Numerical Methods for ODE. Michael Bader. Winter 2007/2008

Scientific Computing II

Ordinary Differential Equations

Numerical Methods for ODEs. Lectures for PSU Summer Programs Xiantao Li

AM 205 Final Project The N-Body Problem

Solving Ordinary Differential equations

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

Bioengineering 215. An Introduction to Molecular Dynamics for Biomolecules

ECE 422/522 Power System Operations & Planning/Power Systems Analysis II : 7 - Transient Stability

NUMERICAL SOLUTION OF ODE IVPs. Overview

MTH 452/552 Homework 3

Name of the Student: Unit I (Solution of Equations and Eigenvalue Problems)

Numerical solution of ODEs

Review Higher Order methods Multistep methods Summary HIGHER ORDER METHODS. P.V. Johnson. School of Mathematics. Semester

MODELING OF CONCRETE MATERIALS AND STRUCTURES. Kaspar Willam. Class Meeting #5: Integration of Constitutive Equations

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

Time stepping methods

Fourth Order RK-Method

Ordinary Differential Equations

Identification Methods for Structural Systems. Prof. Dr. Eleni Chatzi Lecture March, 2016

Ph 22.1 Return of the ODEs: higher-order methods

Chapter 5 Exercises. (a) Determine the best possible Lipschitz constant for this function over 2 u <. u (t) = log(u(t)), u(0) = 2.

ME Computational Fluid Mechanics Lecture 5

ECE257 Numerical Methods and Scientific Computing. Ordinary Differential Equations

COSC 3361 Numerical Analysis I Ordinary Differential Equations (II) - Multistep methods

Multistep Methods for IVPs. t 0 < t < T

Ordinary Differential Equations

Molecular Dynamics. What to choose in an integrator The Verlet algorithm Boundary Conditions in Space and time Reading Assignment: F&S Chapter 4

PowerPoints organized by Dr. Michael R. Gustafson II, Duke University

Parallel-in-time integrators for Hamiltonian systems

Chaotic motion. Phys 750 Lecture 9

Gear methods I + 1/18

Entropy and irreversibility in gas dynamics. Joint work with T. Bodineau, I. Gallagher and S. Simonella

Dynamics and Time Integration. Computer Graphics CMU /15-662, Fall 2016

ENGI9496 Lecture Notes State-Space Equation Generation

ON THE INTEGRATION OF EQUATIONS OF MOTION: FEM AND MOLECULAR DYNAMICS PROBLEMS

Linear Multistep Methods I: Adams and BDF Methods

CHAPTER 1 INTRODUCTION TO NUMERICAL METHOD

Solving PDEs with PGI CUDA Fortran Part 4: Initial value problems for ordinary differential equations

CHAPTER 5: Linear Multistep Methods

Numerical Methods. Scientists. Engineers

8.1 Introduction. Consider the initial value problem (IVP):

Lecture Notes to Accompany. Scientific Computing An Introductory Survey. by Michael T. Heath. Chapter 9

Particle-based Fluids

COMBINED EXPLICIT-IMPLICIT TAYLOR SERIES METHODS

Chapter 6 - Ordinary Differential Equations

AM205: Assignment 3 (due 5 PM, October 20)

Computational Techniques Prof. Dr. Niket Kaisare Department of Chemical Engineering Indian Institute of Technology, Madras

Classical Equations of Motion

Numerical Differential Equations: IVP

2.29 Numerical Fluid Mechanics Fall 2011 Lecture 20

Worksheet 8 Sample Solutions

Optimising the Computational Simulation of Mechanical Models: Designing a Real-Time Mass-Aggregate Physics Engine

Chaotic motion. Phys 420/580 Lecture 10

NUMERICAL METHODS FOR ENGINEERING APPLICATION

X i t react. ~min i max i. R ij smallest. X j. Physical processes by characteristic timescale. largest. t diff ~ L2 D. t sound. ~ L a. t flow.


Backward error analysis

Module 6: Implicit Runge-Kutta Methods Lecture 17: Derivation of Implicit Runge-Kutta Methods(Contd.) The Lecture Contains:

Integration of Ordinary Differential Equations

Virtual Reality & Physically-Based Simulation

Scientific Computing II

Ab initio molecular dynamics and nuclear quantum effects

The Finite Element Method for the Analysis of Non-Linear and Dynamic Systems. Prof. Dr. Eleni Chatzi Lecture 6-5 November, 2015

Mathematics for chemical engineers. Numerical solution of ordinary differential equations

Lecture 17: Ordinary Differential Equation II. First Order (continued)

High performance computing and numerical modeling

Scientific Computing: An Introductory Survey

Consistency and Convergence

KINGS COLLEGE OF ENGINEERING DEPARTMENT OF MATHEMATICS ACADEMIC YEAR / EVEN SEMESTER QUESTION BANK

Numerical methods for the Navier- Stokes equations

Unit I (Testing of Hypothesis)

Systems of Ordinary Differential Equations

Chapter 2 Finite-Difference Discretization of the Advection-Diffusion Equation

CS520: numerical ODEs (Ch.2)

Transcription:

Scientific Computing II Molecular Dynamics Numerics Michael Bader SCCS Technical University of Munich Summer 018

Recall: Molecular Dynamics System of ODEs resulting force acting on a molecule: F i = j i acceleration of a molecule (Newton s nd law): F r i = i j i F ij = m i m i or, with acceleration a i := 1 m i Fi : r i = a i, = F ij U( r i, r j ) j i r ij m i where F i and a i depend on all positions r i transfer to dn coupled ordinary differential equations of 1st order: m i r i = p i or r i = v i p i = F i vi = F i /m i = a i Michael Bader SCCS Scientific Computing II Molecular Dynamics Numerics Summer 018

Euler Time Stepping for MD Explicit Euler Method: Taylor series expansion of the positions in time: (ṙ, r, r (i) : derivatives) r(t + t) = r(t) + t r(t) + 1 t r(t) + t i i! r (i) (t) +... (1) neglecting terms of higher order of t, and analogous formulation of v(t) := r(t) with a(t) := v(t) = r(t) = F (t) m leads to the explicit Euler method: v(t + t). = v(t) + t a(t) r(t + t). = r(t) + t v(t) Michael Bader SCCS Scientific Computing II Molecular Dynamics Numerics Summer 018 3

Euler Time Stepping for MD (cont.) explicit Euler method: v(t + t). = v(t) + t a(t) r(t + t). = r(t) + t v(t) (a) (b) similar for implicit Euler method derivatives at the time step end: v(t + t). = v(t) + t a(t + t) r(t + t). = r(t) + t v(t + t) (3a) (3b) disadvantage for both schemes: do not conserve critical properties; lead to wrong long-term solutions (compare tutorial on circular motion); plus: low accuracy Michael Bader SCCS Scientific Computing II Molecular Dynamics Numerics Summer 018 4

Classical Störmer Verlet Method the Taylor series expansion in (1) can also be performed for t: r(t t) = r(t) t r(t) + 1 t r(t) + ( t)i r (i) (t) +... (4) i! from (1) and (4) the classical Verlet algorithm can be derived: r(t + t) = r(t) r(t t) + t r(t) + O( t 4 ) r(t) r(t t) + t a(t) (5) note: direct calculation of r(t + t) from r(t) and F(t) velocity can be estimated via v(t) = r(t). = r(t + t) r(t t) t disadvantage: needs to store two previous time steps (6) Michael Bader SCCS Scientific Computing II Molecular Dynamics Numerics Summer 018 5

Crank Nicolson Method explicit approximation (7a) for half step [t, t + t ] inserted into implicit approximation (7b) for half step [t + t, t + t] v(t + t t ) = v(t) + a(t) (7a) v(t + t) = v(t + t ) + t a(t + t) (7b) leads to Crank-Nicolson scheme for v: v(t + t) = v(t) + t ( a(t) + a(t + t) ) (8) key disadvantage: implicit scheme, as a(t + t) depends on r(t + t); needs to solve non-linear system of equations Michael Bader SCCS Scientific Computing II Molecular Dynamics Numerics Summer 018 6

Velocity Störmer Verlet Method The Velocity Störmer Verlet method is a composition of a Taylor series expansion of nd order for the positions, as in Eq. (1) and a Crank Nicolson method for the velocities, as in Eq. (8) r(t + t) = r(t) + t v(t) + t a(t) (9a) ( v(t + t) = v(t) + t a(t) + a(t + t) ) (9b) Forward Euler r Force calculation Crank-Nicolson v r v F t- t t t+ t t- t t t+ t t- t t t+ t t- t t t+ t Memory requirement: (3 + 1) 3N (3+1 vector fields) update of v(t + t) requires v(t), r(t + t) and F (t + t), but also F (t) Michael Bader SCCS Scientific Computing II Molecular Dynamics Numerics Summer 018 7

Velocity Störmer Verlet Implementation reformulate equation for positions r: r(t + t) = r(t) + t v(t) + t a(t) ( = r(t) + t v(t) + t ) a(t) contains half an Euler time step for v similar for the velocities v: v(t + t) = v(t) + t ( a(t) + a(t + t) ) ( = v(t) + t ) a(t) + t a(t + t) reuses the result of the half Euler time step for v Michael Bader SCCS Scientific Computing II Molecular Dynamics Numerics Summer 018 8

Velocity Störmer Verlet Implementation () 1. compute half an Euler time step for v v(t + t ) = v(t) t + a(t). update positions r: r(t + t) = r(t) + t v(t + t ) 3. calculate forces a(t + t) from positions r(t + t) 4. update the velocities v: v(t + t) = v(t + t ) + t a(t + t) Note: memory requirements: 3 3N (3 vector fields) vectors v and r, as well as forces/accelerations a may be updated in-place in each time step Michael Bader SCCS Scientific Computing II Molecular Dynamics Numerics Summer 018 9

Leapfrog Method combine steps 4 (from previous time step) and 1 to a single step velocity calculation thus shifted by a half time step: v(t + t ) = v(t t ) + t a(t) (10a) r(t + t) = r(t) + t v(t + t ) (10b) r v F t- t/ t+ t/ t- t/ t+ t/ t- t/ t+ t/ t- t/ t+ t/ t- t t t+ t t- t t t+ t t- t t t+ t t- t t t+ t exact arithmetic: Störmer Verlet, Velocity Störmer Verlet and Leapfrog Scheme are equivalent the latter two are more robust w.r.t. roundoff errors Michael Bader SCCS Scientific Computing II Molecular Dynamics Numerics Summer 018 10

Dimensionless Velocity Störmer Verlet remember dimensionless formulation: ( r := σ r, v := σ v t, t := σ m ɛ t, r = 1 m F := 1 ɛ m σ F ) insert into Velocity Störmer Verlet Method to get:. r (t + t) = r (t) + v (t) + v (t + t) = v (t) + t t F (t) + F (t) t F (t + t) (11a) (11b) Forward Euler r ½ Forward Euler v Force calculation ½ Backward Euler v r v F t- t t t+ t t- t t t+ t t- t t t+ t t- t t t+ t t- t t t+ t Michael Bader SCCS Scientific Computing II Molecular Dynamics Numerics Summer 018 11

Dimensionless Velocity Störmer Verlet () Forward Euler r ½ Forward Euler v Force calculation ½ Backward Euler v r v F t- t t t+ t t- t t t+ t t- t t t+ t t- t t t+ t t- t t t+ t Procedure: 1. calculate new positions (11a), partial velocity update: + t F (t) in (11b). calculate new forces, accelerations (computationally intensive!) 3. calculate new velocities: + t F (t + t) in (11b) memory requirements: 3 3N Michael Bader SCCS Scientific Computing II Molecular Dynamics Numerics Summer 018 1

Outlook: Leapfrog Method with Thermostat Leapfrog method: v(t + t ) = v(t t ) + t a(t) r(t + t) = r(t) + t v(t + t ) r v F Thermostat t- t t+ t t+ t t- t t+ t t- t t t+ t t- t t t+ t t- t t t+ t t- t t t+ t t- t t t+ t intermediate ( step may be introduced for the thermostat v(t) := 1 v(t + t ) + v(t t )) to synchronize velocity: v act (t) = v(t t ) + t a(t) (13a) v(t + t ) = (β 1) v act(t) + t a(t) (13b) Michael Bader SCCS Scientific Computing II Molecular Dynamics Numerics Summer 018 13

Evaluation of Time Integration Methods Evaluation criteria: accuracy (often not of great importance for exact particle positions) stability conservation of phase space density (symplectic) of energy of momentum (especially with PBC Periodic Boundary Conditions) reversibility of time use of resources: computational effort (number of force evaluations) maximum time step size memory usage Michael Bader SCCS Scientific Computing II Molecular Dynamics Numerics Summer 018 14

Reversibility of Time time reversal for a closed system means a turnaround of the velocities and also momentums; positions at the inversion point stay constant traverse of a trajectory back in the direction of the origin demand for symmetry for time integration methods + satisfied by Verlet method, e.g. not satisfied by, e.g., Euler method, Predictor Corrector methods (also not by standard Runge-Kutta methods) contradiction with the H-theorem (increase of entropy, irreversible processes)? (Loschmidt s paradox) the second theorem of thermodynamics? reversibility in theory only for a very short time Lyapunov instability Kolmogorov entropy Michael Bader SCCS Scientific Computing II Molecular Dynamics Numerics Summer 018 15

Lyapunov Instability Basic question: how does a model behave with slightly disturbed initial condition? Example of a simple system: stable case: jumping ball on a plane with slightly disturbed initial horizontal velocity linear increase of the disturbance instable case: jumping ball on a sphere with slightly disturbed initial horizontal velocity exponential increase of the disturbance (Lyapunov exponent) for the instable case, small disturbances result in large changes: chaotic behaviour (butterfly leading to a hurricane?) non-linear differential equations are often dynamically instable Michael Bader SCCS Scientific Computing II Molecular Dynamics Numerics Summer 018 16

Lyapunov Instability: A Numerical Experiment setup of 4000 fcc atoms for a second setup, the position of a single atom was displaced by 0.001 this atom is traced in both setups tracing a Molecule (with initial displacement) Molecule 5, run1 Molecule 5, run 4.1 4 3.9 3.8 3.7 3.6 3.5 colours indicate velocity.5 3 3.5 4 4.5 5 7.7 7.6 7.5 7.4 7.3 7. 5.5 7.1 Michael Bader SCCS Scientific Computing II Molecular Dynamics Numerics Summer 018 17

Lyapunov Instability: A Numerical Experiment Calculation of the trajectories badly conditioned problem: a small change of the initial position of a molecule may result in a distance to the comparable original position, after some time, in the magnitude of the whole domain! Thus: do not target at simulation of individual trajectories numerical simulation of the behaviour of the system is wanted! tracing a Molecule (with initial displacement) Molecule 5, run1 Molecule 5, run 0.5 0.45 Molecule deviation (with initial displacement) 0.4 4.1 0.35 4 3.9 0.3 3.8 3.7 0.5 3.6 3.5 0..5 3 3.5 4 4.5 5 7.7 7.6 7.5 7.4 7.3 7. 5.5 7.1 0.15 0.1 0.05 0.5 3 3.5 4 4.5 5 5.5 Michael Bader SCCS Scientific Computing II Molecular Dynamics Numerics Summer 018 18