Ordinary differential equations. Phys 420/580 Lecture 8

Similar documents
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)

Ordinary differential equations. Phys 750 Lecture 7

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

Ordinary Differential Equations II

Review: control, feedback, etc. Today s topic: state-space models of systems; linearization

Lecture IV: Time Discretization

Scientific Computing II

Ordinary Differential Equations II

Ordinary Differential Equations

Checking the Radioactive Decay Euler Algorithm

Introduction to the Numerical Solution of IVP for ODE

Chap. 20: Initial-Value Problems

Lecture 4: Numerical solution of ordinary differential equations

Review. Numerical Methods Lecture 22. Prof. Jinbo Bi CSE, UConn

Particle Systems. University of Texas at Austin CS384G - Computer Graphics

Cyber-Physical Systems Modeling and Simulation of Continuous Systems

Chapter 6 - Ordinary Differential Equations

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

Ordinary Differential Equations

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

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

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

Chapter 9b: Numerical Methods for Calculus and Differential Equations. Initial-Value Problems Euler Method Time-Step Independence MATLAB ODE Solvers

Lecture V: The game-engine loop & Time Integration

Consistency and Convergence

Ordinary Differential Equations

(f(x) P 3 (x)) dx. (a) The Lagrange formula for the error is given by

Introduction to standard and non-standard Numerical Methods

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

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

Multistage Methods I: Runge-Kutta Methods

Differential Equations

ECE257 Numerical Methods and Scientific Computing. Ordinary Differential Equations

Exponential Integrators

EN Applied Optimal Control Lecture 8: Dynamic Programming October 10, 2018

The Finite Element Method for the Analysis of Non-Linear and Dynamic Systems: Non-Linear Dynamics Part I

ACM/CMS 107 Linear Analysis & Applications Fall 2016 Assignment 4: Linear ODEs and Control Theory Due: 5th December 2016

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

δ Substituting into the differential equation gives: x i+1 x i δ f(t i,x i ) (3)

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

Mathematics Qualifying Exam Study Material

Applied Math for Engineers

Math 660 Lecture 4: FDM for evolutionary equations: ODE solvers

Numerical methods for the Navier- Stokes equations

CS205B / CME306 Homework 3. R n+1 = R n + tω R n. (b) Show that the updated rotation matrix computed from this update is not orthogonal.

Lecture 7. Please note. Additional tutorial. Please note that there is no lecture on Tuesday, 15 November 2011.

Solving Ordinary Differential equations

Numerical Methods - Initial Value Problems for ODEs

Do not turn over until you are told to do so by the Invigilator.

CHAPTER 2 THE MAXIMUM PRINCIPLE: CONTINUOUS TIME. Chapter2 p. 1/67

x n+1 = x n f(x n) f (x n ), n 0.

TABLE OF CONTENTS INTRODUCTION, APPROXIMATION & ERRORS 1. Chapter Introduction to numerical methods 1 Multiple-choice test 7 Problem set 9

Lecture 4: Numerical Solution of SDEs, Itô Taylor Series, Gaussian Process Approximations

Numerical Methods. King Saud University

Integration of Ordinary Differential Equations

Section 7.4 Runge-Kutta Methods

Euler s Method, cont d

Path integrals for classical Markov processes

Ph 22.1 Return of the ODEs: higher-order methods

Numerical Solutions to Partial Differential Equations

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

Finite Difference and Finite Element Methods

Worksheet 1: Integrators

Fourth Order RK-Method

Solution via Laplace transform and matrix exponential

Linear and Nonlinear Oscillators (Lecture 2)

Optimal Control. Quadratic Functions. Single variable quadratic function: Multi-variable quadratic function:

Cache Oblivious Stencil Computations

Physically Based Modeling: Principles and Practice Differential Equation Basics

Chapter 8. Numerical Solution of Ordinary Differential Equations. Module No. 1. Runge-Kutta Methods

Physically Based Modeling Differential Equation Basics

Introduction to First Order Equations Sections

Plot of temperature u versus x and t for the heat conduction problem of. ln(80/π) = 820 sec. τ = 2500 π 2. + xu t. = 0 3. u xx. + u xt 4.

Euler s Method, Taylor Series Method, Runge Kutta Methods, Multi-Step Methods and Stability.

Advanced Quantum Mechanics

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

Fundamentals Physics

Linear Ordinary Differential Equations

NUMERICAL SOLUTION OF ODE IVPs. Overview

Introduction to multiscale modeling and simulation. Explicit methods for ODEs : forward Euler. y n+1 = y n + tf(y n ) dy dt = f(y), y(0) = y 0

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

Math Numerical Analysis Homework #4 Due End of term. y = 2y t 3y2 t 3, 1 t 2, y(1) = 1. n=(b-a)/h+1; % the number of steps we need to take

Do not turn over until you are told to do so by the Invigilator.

Department of Applied Mathematics Preliminary Examination in Numerical Analysis August, 2013

Solving scalar IVP s : Runge-Kutta Methods

Numerical Algorithms for ODEs/DAEs (Transient Analysis)

10 Numerical Solutions of PDEs

MB4018 Differential equations

Virtual Reality & Physically-Based Simulation

x x2 2 + x3 3 x4 3. Use the divided-difference method to find a polynomial of least degree that fits the values shown: (b)

Ordinary Differential Equations

ENO and WENO schemes. Further topics and time Integration

CHAPTER 12 Numerical Solution of Differential Equations

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

Logistic Map, Euler & Runge-Kutta Method and Lotka-Volterra Equations

Physics 299: Computational Physics II Project II

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

CIS 4930/6930: Principles of Cyber-Physical Systems

Runge-Kutta and Collocation Methods Florian Landis

AIMS Exercise Set # 1

Transcription:

Ordinary differential equations Phys 420/580 Lecture 8

Most physical laws are expressed as differential equations These come in three flavours: initial-value problems boundary-value problems eigenvalue problems

Most physical laws are expressed as differential equations These come in three flavours: initial-value problems boundary-value problems eigenvalue problems first order x (t) =F (x(t),t) x(0) = x 0 second order x (t) =F (x(t),x (t),t) x(0) = x 0 x (0) = v 0

Most physical laws are expressed as differential equations These come in three flavours: x R : u (x) =F (u(x),u (x); x) initial-value problems boundary-value problems eigenvalue problems x R : u(x) =α(x) or u (x) =β(x)

Most physical laws are expressed as differential equations These come in three flavours: x R : u (x) =F (u(x),u (x); x; λ) initial-value problems boundary-value problems eigenvalue problems x R : u(x) =α(x) or u (x) =β(x) solutions only at specific eigenvalues

In principle, the initial value problem ODE can be forward integrated from its specified starting point dx dt = F (x(t),t) x(0) = x 0 x(t) =x 0 + t 0 dt F (x(t ),t ) Need to generate a numerical estimate of the integral on the rhs of the formal solution

As usual, we chop the real time variable into discrete time steps t = t i+1 t i x(t + t) =x(t)+ x(t i+1 )=x(t i )+ t+ t t ti+1 dt F (x(t ),t ) t i dt F (x(t ),t ) If t is sufficiently small, then the integral is wellapproximated by a low-order estimate of the area

missing weight Various first-order approximations: x i+1 = x i + F i t x i+1 = x i + 1 2 Fi + F i+1 t where in the future x i = x(t i ),F i = F (x(t i ),t i ) F(x(t),t) box rule t i t i+1 F(x(t),t) t The choices of box and trapezoid integration correspond to the socalled Euler and Picard methods t i t i+1 trapezoid rule t

Algorithm for the Euler method is very simple Accuracy of the method is low, and large errors accumulate over time Not necessarily energyconserving Set x 0 to its initial value Step through each t i (i 0): compute F i = F (x i,t i ) x i+1 = x i + F i t t i+1 = t i + t

Set x 0 to its initial value Picard method requires a selfconsistent solution Accurate but slow May not converge for too large a choice of time step Step through each t i (i 0): compute F i = F (x i,t i ) t i+1 = t i + t compute x (1) i+1 via Euler Loop over k =1, 2, 3,... compute F (k) i+1 = F (x(k) x (k+1) i+1 = x i + 1 2 i+1,t i+1) Fi + F (k) i+1 t Exit loop if x (k+1) i+1 x (k) i+1 < x i+1 = x (k max) i+1

Systematic expansion: replace dummy variable by and Taylor expand the integrand t = t + δt F (x(t + δt),t+ δt) =F (x(t),t)+ F x x (t)δt + F t Integration over 0 < δt < t x i+1 = x i + F i t + 1 F F i 2 x yields + F i t δt + O(δt)2 not necessarily available to us ( t) 2 + i Truncation at first order corresponds to the Euler method

According to the mean value theorem, an exact truncation is of the form x i+1 = x i + F (x(τ), τ) t, τ [t i,t i+1 ] F is evaluated at some intermediate point Ideal value of τ absorbs all curvature corrections Possibility of systematic improvements

Euler x i+1 E.g., second-order Runge-Kutta x i x i+1 = x i + F (x,t ) t t x = x i + 1 2 F (x i,t i ) t t i t i+1 t = t i + 1 2 t Runge-Kutta x* x i+1 local errors at O( t) 2 x i t i t* t i+1 t

Runge-Kutta Schemes Exact evolution over a small time step: x(t + t) =x(t)+ t 0 d(δt) F (x(t + δt),t+ δt) Expand both sides in a small time increment: x(t + t) =x(t)+x (t) t + 1 2 x (t)( t) 2 + 1 6 x (t)+ = x(t)+f t + 1 Ft + FF x ( t) 2 2 + 1 Ftt +2FF tx + F 6 2 F xx + FFx 2 + F t F x ( t) 3 + partial derivatives

Runge-Kutta Schemes Runge-Kutta ansatz at order m: x(t + t) =x(t)+α 1 c 1 + α 2 c 2 + + α m c m Function evaluation at many points in the interval c 1 =( t)f (x, t) c 2 =( t)f (x + ν 21 c 1,t+ ν 21 t) c 3 =( t)f (x + ν 31 c 1 + ν 32 c 2,t+(ν 31 + ν 32 ) t) c 4 =( t)f (x + ν 41 c 1 + ν 42 c 2 + ν 43 c 3,t+(ν 41 + ν 42 + ν 43 ) t). m equations and m + m(m 1)/2 unknowns {α i, ν ij }

Second-order ODEs We have discussed the Euler, Picard, and Runge-Kutta schemes for integrating the first-order initial value problem: x (t) =F (x(t),t) x(0) = x 0 Similar considerations can be applied to the second-order problem: x (t) =F (x(t),x (t),t) x(0) = x 0 x (0) = v 0

Second-order ODEs Convenient to reinterpret the second-order system as two coupled first-order equations x (t) =F (x(t),x (t),t) x(0) = x 0 x (0) = v 0 v (t) =A(x(t),v(t),t) x (t) =v(t) x(0) = x 0 v(0) = v 0 Obvious connection to classical mechanics: velocity v and acceleration model A

Second-order ODEs Naive generalization of Euler method to the pair of first order equations Some ambiguity in the labelling of time steps Set x 0 and v 0 to their initial values Step through each t i (i 0): compute a i = A(x i,v i,t i ) v i+1 = v i + a i t x i+1 = x i + v i t t i+1 = t i + t Could equally read v i+1 and still be correct to O( t) (Euler-Cromer)

Second-order ODEs Can achieve higher order algorithms systematically at the cost of having more time steps involved in each update x i+1 = x i + v i t + 1 2 a i( t) 2 + O( t) 3 x i 1 = x i v i t + 1 2 a i( t) 2 + O( t) 3 Adding and subtracting the forward and reverse forms x i+1 =2x i x i 1 + a i ( t) 2 v i = x i+1 x i 1 (Verlet method) t

Second-order ODEs Verlet method is more numerically stable than Euler It is not self-starting: it needs both and (x 0,v 0 ) (x 1,v 1 ) Accuracy can be arbitrarily improved in this way at the cost of more starting points: (x 2,v 2 ), etc. Fortunately, there is an update rule mathematically equivalent to Verlet that is self-starting: depends on x i+1 only x i+1 = x i + v i t + 1 2 a i( t) 2 v i+1 = v i + 1 2 (a i+1 + a i ) t (self-starting Verlet)

Second-order ODEs Runge-Kutta has the advantage of begin self-starting 4th order Runge-Kutta for Newton s equations of motion: k 1v = A(x i,v i,t i ) t k 1x = v i t k 2v = A(x i + 1 2 k 1x,v i + 1 2 k 1v,t i + 1 2 t) k 3v = A(x i + 1 2 k 2x,v i + 1 2 k 2v,t i + 1 2 t) k 3x = v i + 1 2 k 2v t k 4v = A(x i + k 3x,v i + k 3v,t i + t) k 4x = v i + k 3x t v i+1 = v i + 1 6 k1v +2k 2v +2k 3v + k 4v x i+1 = x i + 1 6 k1x +2k 2x +2k 3x + k 4x