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

Similar documents
Fourth Order RK-Method

ECE257 Numerical Methods and Scientific Computing. Ordinary Differential Equations

Applied Math for Engineers

Numerical Methods - Initial Value Problems for ODEs

Jim Lambers MAT 772 Fall Semester Lecture 21 Notes

AN OVERVIEW. Numerical Methods for ODE Initial Value Problems. 1. One-step methods (Taylor series, Runge-Kutta)

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

Initial-Value Problems for ODEs. Introduction to Linear Multistep Methods

MTH 452/552 Homework 3

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

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

Ordinary differential equations - Initial value problems

HIGHER ORDER METHODS. There are two principal means to derive higher order methods. b j f(x n j,y n j )

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

Lecture 10: Linear Multistep Methods (LMMs)

Multistep Methods for IVPs. t 0 < t < T

9.6 Predictor-Corrector Methods

Section 7.4 Runge-Kutta Methods

Consistency and Convergence

Initial value problems for ordinary differential equations

Ordinary Differential Equations

Computational Methods CMSC/AMSC/MAPL 460. Ordinary differential equations

multistep methods Last modified: November 28, 2017 Recall that we are interested in the numerical solution of the initial value problem (IVP):

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

ODE Runge-Kutta methods

Ordinary Differential Equations (ODEs)

You may not use your books, notes; calculators are highly recommended.

Ordinary Differential Equations II

Chapter 11 ORDINARY DIFFERENTIAL EQUATIONS

Differential Equations

Numerical Methods for Differential Equations

Lecture V: The game-engine loop & Time Integration

Bindel, Fall 2011 Intro to Scientific Computing (CS 3220) Week 12: Monday, Apr 18. HW 7 is posted, and will be due in class on 4/25.

Computational Methods CMSC/AMSC/MAPL 460. Ordinary differential equations

Lecture IV: Time Discretization

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

Solving Ordinary Differential Equations

5.6 Multistep Methods

Differential Equations

Numerical Methods for the Solution of Differential Equations

Ordinary Differential Equations II

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

1 Error Analysis for Solving IVP

Modeling & Simulation 2018 Lecture 12. Simulations

16.7 Multistep, Multivalue, and Predictor-Corrector Methods

Multistage Methods I: Runge-Kutta Methods

Chap. 20: Initial-Value Problems

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

Numerical Methods for Differential Equations

NUMERICAL SOLUTION OF ODE IVPs. Overview

Numerical Methods for Engineers. and Scientists. Applications using MATLAB. An Introduction with. Vish- Subramaniam. Third Edition. Amos Gilat.

CS520: numerical ODEs (Ch.2)

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

Numerical Differential Equations: IVP

Mathematics for chemical engineers. Numerical solution of ordinary differential equations

Solving Ordinary Differential equations

Introduction to the Numerical Solution of IVP for ODE

Numerical solution of ODEs

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

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

Euler s Method, cont d

Integration of Ordinary Differential Equations

Computational Methods CMSC/AMSC/MAPL 460. Ordinary differential equations

Part IB Numerical Analysis

Computation Fluid Dynamics

2.29 Numerical Fluid Mechanics Fall 2011 Lecture 20

CS 450 Numerical Analysis. Chapter 9: Initial Value Problems for Ordinary Differential Equations

Maths III - Numerical Methods

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

Differential Equations

CHAPTER 5: Linear Multistep Methods

Linear Multistep Methods

Initial value problems for ordinary differential equations

Scientific Computing: An Introductory Survey

Astrodynamics (AERO0024)

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

4 Stability analysis of finite-difference methods for ODEs

Initial Value Problems for. Ordinary Differential Equations

Scientific Computing with Case Studies SIAM Press, Lecture Notes for Unit V Solution of

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

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

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

16.7 Multistep, Multivalue, and Predictor-Corrector Methods

A New Block Method and Their Application to Numerical Solution of Ordinary Differential Equations

Applied Numerical Analysis

2 Numerical Methods for Initial Value Problems

Dynamic Systems. Simulation of. with MATLAB and Simulink. Harold Klee. Randal Allen SECOND EDITION. CRC Press. Taylor & Francis Group

16.1 Runge-Kutta Method

Physically Based Modeling Differential Equation Basics

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

Introduction to standard and non-standard Numerical Methods

Ordinary Differential Equations

Research Article Diagonally Implicit Block Backward Differentiation Formulas for Solving Ordinary Differential Equations

Math 128A Spring 2003 Week 12 Solutions

On interval predictor-corrector methods

Ph 22.1 Return of the ODEs: higher-order methods

The family of Runge Kutta methods with two intermediate evaluations is defined by

A Survey of Numerical Methods in Fractional Calculus

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

A Brief Introduction to Numerical Methods for Differential Equations

Transcription:

HIGHER ORDER METHODS School of Mathematics Semester 1 2008

OUTLINE 1 REVIEW 2 HIGHER ORDER METHODS 3 MULTISTEP METHODS 4 SUMMARY

OUTLINE 1 REVIEW 2 HIGHER ORDER METHODS 3 MULTISTEP METHODS 4 SUMMARY

OUTLINE 1 REVIEW 2 HIGHER ORDER METHODS 3 MULTISTEP METHODS 4 SUMMARY

OUTLINE 1 REVIEW 2 HIGHER ORDER METHODS 3 MULTISTEP METHODS 4 SUMMARY

EULER S METHOD Initial value problems for ODEs Euler s Method: w 0 = α w i+1 = w i + hf(x i, w i ), for each i = 0, 1,...,n 1 Local truncation error for Euler s method: τ i+1 (h) h 2 M.

OUTLINE Review 1 REVIEW 2 HIGHER ORDER METHODS 3 MULTISTEP METHODS 4 SUMMARY

ELIMINATING TRUNCATION ERRORS A second order method should approximate the equation: y i+1 = y i + hf(x i, y i ) + h2 2 f (x i, y i ) with local truncation error O(h 2 ). Then use a scheme of the form such that y i+1 = y i + a 1 f(x i + α 1, y i + β 1 ) a 1 f(x i + α 1, y i + β 1 ) = hf(x i, y i ) + h2 2 f (x i, y i )

ELIMINATING TRUNCATION ERRORS A second order method should approximate the equation: y i+1 = y i + hf(x i, y i ) + h2 2 f (x i, y i ) with local truncation error O(h 2 ). Then use a scheme of the form such that y i+1 = y i + a 1 f(x i + α 1, y i + β 1 ) a 1 f(x i + α 1, y i + β 1 ) = hf(x i, y i ) + h2 2 f (x i, y i )

MIDPOINT METHOD Review Then using a Taylor expansion we may choose the constants a 1, α 1 and β 1 to satisfy our second order equation One such choice is a 1 = h, α 1 = h/2 and β 1 = (h/2)f(x, y) gives the midpoint method w 0 = α w i+1 = w i + hf (x i + h/2, w i + (h/2)f(x i, w i )), We take evaluate the function f half way through the step to get a better approximation This is a Runge-Kutta method of order 2

MIDPOINT METHOD Review Then using a Taylor expansion we may choose the constants a 1, α 1 and β 1 to satisfy our second order equation One such choice is a 1 = h, α 1 = h/2 and β 1 = (h/2)f(x, y) gives the midpoint method w 0 = α w i+1 = w i + hf (x i + h/2, w i + (h/2)f(x i, w i )), We take evaluate the function f half way through the step to get a better approximation This is a Runge-Kutta method of order 2

MODIFIED EULER METHOD Now try a scheme of the form y i+1 = y i + a 1 f(x, y) + a 2 f (x i + α 1, y i + δ 1 f(x, y)) Again using the Taylor expansion we can choose the constants a 1 = h/2, a 2 = h/2, α 1 = h and δ 1 = h This gives the modified Euler method w 0 = α, w i+1 = w i + h 2 [f(x i, w i ) + f (x i+1, w i + hf(x i, w i ))]. This is a Runge-Kutta method of order 2

MODIFIED EULER METHOD Now try a scheme of the form y i+1 = y i + a 1 f(x, y) + a 2 f (x i + α 1, y i + δ 1 f(x, y)) Again using the Taylor expansion we can choose the constants a 1 = h/2, a 2 = h/2, α 1 = h and δ 1 = h This gives the modified Euler method w 0 = α, w i+1 = w i + h 2 [f(x i, w i ) + f (x i+1, w i + hf(x i, w i ))]. This is a Runge-Kutta method of order 2

OUTLINE Review 1 REVIEW 2 HIGHER ORDER METHODS 3 MULTISTEP METHODS 4 SUMMARY

RUNGE-KUTTA ORDER FOUR One of the most popular methods to solve an ODE is the Runge-Kutta method: w 0 = α, k 1 = hf(x i, y i ), ( k 2 = hf x i + h 2, w i + 1 ) 2 k 1 ( k 3 = hf x i + h 2, w i + 1 ) 2 k 2 k 4 = hf (x i+1, w i + k 3 ) w i+1 =w i + 1 6 (k 1 + 2k 2 + 2k 3 + k 4 ).

ALGEBRA Review The algebra required to arrive at the Runge-Kutta order four (RK4) method is tedious The idea is the same as with the midpoint and modified Euler methods... Match up and cancel out error terms. The local truncation error for the RK4 is unsurprisingly O(h 4 )

ALGEBRA Review The algebra required to arrive at the Runge-Kutta order four (RK4) method is tedious The idea is the same as with the midpoint and modified Euler methods... Match up and cancel out error terms. The local truncation error for the RK4 is unsurprisingly O(h 4 )

OUTLINE Review 1 REVIEW 2 HIGHER ORDER METHODS 3 MULTISTEP METHODS 4 SUMMARY

SOLVING A SYSTEM OF FIRST ORDER EQUATIONS We can solve a system of equations just as easily as a single equation Simply rewrite algorithms in vector form, for example so the jth equation is w 0 = α w i+1 = w i + hf(x i, w i ), w i+1,j = w i,j + hf j ( xi, w i,1,...,w i,m ),

SOLVING A SYSTEM OF FIRST ORDER EQUATIONS We can solve a system of equations just as easily as a single equation Simply rewrite algorithms in vector form, for example so the jth equation is w 0 = α w i+1 = w i + hf(x i, w i ), w i+1,j = w i,j + hf j ( xi, w i,1,...,w i,m ),

MODULAR PROGRAMMING We can use modular programming to allow functions to return arrays This allows for simple coding of the algorithms given above Example code: USE some_function_module REAL, DIMENSION(10) :: y x = a DO i = 1,n y = y + h*f(x,y) x = x+h ENDDO

ONE STEP METHODS Review All methods up to now have been one-step methods... using only w i to calculate w i+1 Methods that use more than one previous step are called multistep methods There are two types of multistep methods: Explicit; Implicit.

ONE STEP METHODS Review All methods up to now have been one-step methods... using only w i to calculate w i+1 Methods that use more than one previous step are called multistep methods There are two types of multistep methods: Explicit; Implicit.

OUTLINE Review 1 REVIEW 2 HIGHER ORDER METHODS 3 MULTISTEP METHODS 4 SUMMARY

MODIFIED EULER METHOD - REVISITED In the modified Euler method we can see that the last term is an approximation to the value of the function at x i+1 : f (x i+1, w i + hf(x i, w i )) f(x i+1, w i+1 ) This suggests we may use the implicit scheme

MODIFIED EULER METHOD - REVISITED In the modified Euler method we can see that the last term is an approximation to the value of the function at x i+1 : f (x i+1, w i + hf(x i, w i )) f(x i+1, w i+1 ) This suggests we may use the implicit scheme w 0 = α, w i+1 = w i + h 2 [f(x i, w i ) + f(x i+1, w i+1 )].

MODIFIED EULER METHOD - REVISITED In the modified Euler method we can see that the last term is an approximation to the value of the function at x i+1 : f (x i+1, w i + hf(x i, w i )) f(x i+1, w i+1 ) This suggests we may use the implicit scheme w 0 = α, w i+1 = w i + h 2 [f(x i, w i ) + f(x i+1, w i+1 )]. The value we must calculate now appears on both sides

OUTLINE Review 1 REVIEW 2 HIGHER ORDER METHODS 3 MULTISTEP METHODS 4 SUMMARY

THE GENERAL M-STEP METHOD The general m-step method can be written as: w i+1 =a m 1 w i + a m 2 w i 1 + + a 0 w i+1 m [ + h b m f(x i+1, w i+1 ) + b m 1 f(x i, w i ) ] + + b 0 f(x i+1 m, w i+1 m )

THE GENERAL M-STEP METHOD The general m-step method can be written as: w i+1 =a m 1 w i + a m 2 w i 1 + + a 0 w i+1 m [ + h b m f(x i+1, w i+1 ) + b m 1 f(x i, w i ) ] + + b 0 f(x i+1 m, w i+1 m ) If the scheme has b m = 0 then the scheme is explicit If the scheme has b m 0 the scheme is now implicit

EXAMPLE ADAMS-BASHFORTH FOUR-STEP METHOD This is an explicit method: w 0 = α 0, w 1 = α 1, w 2 = α 2 and w 3 = α 3 are calculated using a one-step method(rk4), then for i = 3, 4,...,n 1 we use w i+1 = w i + h [ 55f(x i, w i ) 59f(x i 1, w i 1 ) 24 ] + 37f(x i 2, w i 2 ) 9f(x i 3, w i 3 )

USING MULTISTEP METHODS don t involve as many function calls as their one-step equivalents Implicit methods are more stable and have smaller errors than their explicit counterparts However, they do require iteration This means that we may use them together, in a predictor-corrector method (1) Use the explicit method to guess solution - predict (2) Input guess into implicit method - correct (3) Results in small errors with small expense

USING MULTISTEP METHODS don t involve as many function calls as their one-step equivalents Implicit methods are more stable and have smaller errors than their explicit counterparts However, they do require iteration This means that we may use them together, in a predictor-corrector method (1) Use the explicit method to guess solution - predict (2) Input guess into implicit method - correct (3) Results in small errors with small expense

SUMMARY To make higher order methods, we must eliminate truncation errors There are often different methods with the same order We can use modular programming to implement the algorithms on a system of equations are less expensive Implicit schemes have smaller errors, but can be more expensive than explicit versions

SUMMARY To make higher order methods, we must eliminate truncation errors There are often different methods with the same order We can use modular programming to implement the algorithms on a system of equations are less expensive Implicit schemes have smaller errors, but can be more expensive than explicit versions