ECE257 Numerical Methods and Scientific Computing. Ordinary Differential Equations

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

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

Fourth Order RK-Method

Applied Math for Engineers

Ordinary Differential Equations II

Ordinary Differential Equations II

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

Differential Equations

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

Numerical Methods - Initial Value Problems for ODEs

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

Ordinary Differential Equations I

NUMERICAL SOLUTION OF ODE IVPs. Overview

Numerical Differential Equations: IVP

Numerical Methods for the Solution of Differential Equations

Initial value problems for ordinary differential equations

2.29 Numerical Fluid Mechanics Fall 2011 Lecture 20

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

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

Ordinary Differential Equations I

Chap. 20: Initial-Value Problems

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

MTH 452/552 Homework 3

9.6 Predictor-Corrector Methods

Solving Ordinary Differential Equations

Jim Lambers MAT 772 Fall Semester Lecture 21 Notes

Scientific Computing: An Introductory Survey

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

Ordinary Differential Equations I

Mathematics for chemical engineers. Numerical solution of ordinary differential equations

Solving Ordinary Differential equations

Scientific Computing. Roots of Equations

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

Ordinary Differential Equations

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

Lecture IV: Time Discretization

Lecture V: The game-engine loop & Time Integration

Consistency and Convergence

Integration of Ordinary Differential Equations

Linear Multistep Methods I: Adams and BDF Methods

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

Ordinary Differential Equations

Initial value problems for ordinary differential equations

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

Unit I (Testing of Hypothesis)

Lecture 4: Numerical solution of ordinary differential equations

Multistep Methods for IVPs. t 0 < t < T

Ordinary differential equations - Initial value problems

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

Ordinary differential equation II

Numerical Methods for Differential Equations

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

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

CS520: numerical ODEs (Ch.2)

Part IB Numerical Analysis

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

CHAPTER 5: Linear Multistep Methods

Euler s Method, cont d

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

Ordinary Differential Equations

Differential Equations

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

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

A Brief Introduction to Numerical Methods for Differential Equations

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.

Applied Numerical Analysis

Modeling & Simulation 2018 Lecture 12. Simulations

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

Lecture 5: Single Step Methods

Numerical Analysis. A Comprehensive Introduction. H. R. Schwarz University of Zürich Switzerland. with a contribution by

A Modified Predictor-Corrector Formula For Solving Ordinary Differential Equation Of First Order And First Degree

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

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

Numerical solution of ODEs


Math 411 Preliminaries

Chapter 4. MAC Scheme. The MAC scheme is a numerical method used to solve the incompressible Navier-Stokes. u = 0

Numerical Methods for Differential Equations

Chapter 11 ORDINARY DIFFERENTIAL EQUATIONS

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

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

Numerical Methods. Scientists. Engineers

1 Error Analysis for Solving IVP

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

Research Computing with Python, Lecture 7, Numerical Integration and Solving Ordinary Differential Equations

Virtual University of Pakistan

Numerical Solution of ODE IVPs

Math 128A Spring 2003 Week 12 Solutions

EAD 115. Numerical Solution of Engineering and Scientific Problems. David M. Rocke Department of Applied Science

1 Ordinary Differential Equations

Notation Nodes are data points at which functional values are available or at which you wish to compute functional values At the nodes fx i

SOLUTION OF EQUATION AND EIGENVALUE PROBLEMS PART A( 2 MARKS)

Astrodynamics (AERO0024)

NUMERICAL ANALYSIS SYLLABUS MATHEMATICS PAPER IV (A)

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

Bindel, Spring 2012 Intro to Scientific Computing (CS 3220) Week 12: Monday, Apr 16. f(x) dx,

5.6 Multistep Methods

Introduction to the Numerical Solution of IVP for ODE

What we ll do: Lecture 21. Ordinary Differential Equations (ODEs) Differential Equations. Ordinary Differential Equations

Lecture Notes on Numerical Differential Equations: IVP

Transcription:

ECE257 Numerical Methods and Scientific Computing Ordinary Differential Equations

Today s s class: Stiffness Multistep Methods

Stiff Equations Stiffness occurs in a problem where two or more independent variables change at very different scales Example: dy dt Analytical Solution: = 1000y + 3000 2000e t y = 3 0.998e 1000t 2.002e t y(0) = 0

Stiff Equations y = 3 0.998e 1000t 2.002e t As t moves away from zero, the solution settles to y = 3 2.002e t You still need to account for the e -1000 even after you move away from zero If you don t t do so, the system will be unstable Adaptive methods will not work term 1000t term

Stiff Equations dy dt = ay + dy i dt h ay i h ( 1 ah) For the system to be stable 1-ah must be less than 1, or h<2/a dy dt = 1000y + 3000 2000e t => h < 2 1000

Stability A numerical method is stable if errors occurring at one stage of the process do not tend to be magnified at later stages. A numerical method is unstable if errors occurring at one stage of the process tend to be magnified at later stages. Numerical methods which may be unstable should be carefully dealt with or avoided. In general, the stability of a numerical scheme depends on the step size. Usually, large step sizes lead to unstable solutions. Implicit methods are in general more stable than explicit methods.

Stiff Equations From Numerical Methods for Engineers, Chapra and Canale, Copyright The McGraw-Hill Companies, Inc.

Stiff Equations y(0.01) y(0.1) h=0.01-289.402 4.346x10 24 h=0.001 1.017863 1.188514

Stiffness Stiffness can also cause problems even when the system is stable Example: d 2 y dx =100y 2 dy 1 dx = y 2 dy 2 dx =100y 1 y(0) =1, y'(0) = 10 Analytical Solution y 1 = e 10x,y 2 = 10e 10x y(0.5) = 0.00674

Stiffness y(0.5) h=0.5 13.7083 h=0.05 0.006765 h=0.005 0.006738 h=0.00005 0.006738

Stiffness y(0.5) y(5) h=0.5 13.7083 2.34 x 10 11 h=0.05 0.006765-158272 h=0.005 0.006738 154838 h=0.00005 0.006738 516826

Stiffness Roundoff or truncation error can cause inaccuracies in initial values and lead us to follow an inaccurate solution d 2 y dx 2 =100y y = Ae 10x + Be 10x y(0) =1, y'(0) = 10 As x gets large, the e 10x dominates and because of accumulated errors as we integrate from the initial values, we will introduce large errors

Stiffness Implicit (backward) differencing (Euler s) + d dt a h = y i 1+ ah ( ) This method is unconditionally stable True for linear ODEs h

Stiffness From Numerical Methods for Engineers, Chapra and Canale, Copyright The McGraw-Hill Companies, Inc.

Stiffness From Numerical Methods for Engineers, Chapra and Canale, Copyright The McGraw-Hill Companies, Inc.

Multi-step Methods R- K methods use only one previous approximation (y i ), known as one-step method. Multi-step methods use several previous points (y i, y i-1, ) - explicit (b 0 = 0) & implicit methods. y = a y + a y +.. + h [ b f ( x, y ) + i+ 1 b 1 1 f i ( x i, y 2 i ) i 1 + b 2 f ( x i 1, y 0 i 1 i+ 1 ) +... ] i+ 1 Open & closed formula, non-self start Huen method Adams-Bashforth Methods (explicit methods b 0 = 0) Adams-Moulton Methods (implicit methods) Predictor-Corrector Methods

Multi-step methods From Numerical Methods for Engineers, Chapra and Canale, Copyright The McGraw-Hill Companies, Inc.

Non-Self-Starting Heun Method Heun Method 0 + f ( x i,y i )h + h f (x i,y i ) + f (x i+1, y 0 i+1 ) 2 Instead of using a O(h 2 ) forward Euler method as the predictor, use an O(h 3 ) predictor 0 1 + f ( x i,y i )2h + h f (x i,y i ) + f (x i+1, 0 ) 2

Non-Self-Starting Heun Method Multiple iterations 0 1 + f ( x i, y i )2h j + h f (x i, y i ) + f (x i+1,y j 1 i+1 ) 2 ε a = y j i+1 j 1 j

Non-Self-Starting Heun Method Derivation dy dx = f x, y ( ) x dy = i+1 f ( x, y)dx y i 1 x i 1 1 + x i+1 x i 1 f ( x,y)dx 1 + f ( x i,y i )2h

Non-Self-Starting Heun Method Predictor Error ( ) E p = 4 5 y m 0 i y i Refine value using predictor modifier 0 0 Corrector Error E c = y 0 m i+1 5 Refine value using corrector modifier y m i+1 y m i+1 + 0 ( ) + 4 5 y m 0 i y i m 5

Non-Self-Starting Heun Method Integrate y = 4e 0.8x - 0.5y and y(0)= )=2, y(-1-1)=-0.393 Analytical solution: y = 4 1.3 e0.8x e 0.5x Heun s s Method (step size of 1): y 0 1 = y 1 + f ( x 0, y 0 )2h = 0.393 + ( 3)2 = 5.607 y 1 1 = y 0 + h f x 0, y 0 y 1 2 = y 0 + h f x 0, y 0 ( ) + f x 1,y 1 0 2 ( ) + f x 1,y 1 1 2 ( ) ( ) ( ) + 2e 0.5x ε t =10.54% = 2 +1 3 + 6.099 = 6.549 2 3+ 5.627 = 2 +1 = 6.314 2 ε t = 5.73% ε t = 1.92%

Non-Self-Starting Heun Method y 1 1 y 1 1 y 1 0 1 y 1 5 y 2 1 y 2 1 y 2 0 1 y 1 5 6.549 5.607 = 6.549 = 6.361 5 ε t = 2.68% 6.314 5.607 = 6.314 = 6.173 5 ε t = 0.356%

Predictor-Corrector Methods Instead of using midpoint method and trapezoidal method, use higher order integration methods as the predictor and corrector Newton-Cotes Adams

Predictor-Corrector Methods

Predictor-Corrector Methods Newton Cotes based Integrate by fitting an nth degree polynomial to n+1 points dy dx = f ( x, y ) x dy = i+1 f ( x, y)dx y i n x i n n + x i+1 x i n f ( x, y)dx

Predictor-Corrector Methods Open Formulas x i+1 n=1 1 + f ( x, y)dx x i 1 1 + 2hf i x n=2 i+1 yi+1 2 + f ( x,y)dx x i 2 2 + 3h 2 ( f i + f i 1 ) n=3 3 + x i+1 x i 3 f ( x,y)dx 3 + 4h ( 3 2 f i f i 1 + 2 f i 2 )

Predictor-Corrector Methods Closed Formulas x n=1 + i+1 f ( x, y)dx x i 1 + h ( 2 f i + f i+1 ) x n=2 i+1 1 + f ( x,y)dx x i 1 1 + h ( 3 f i 1 + 4 f i + f i+1 )

Adams-Bashforth Methods Open Formulas Taylor series expansion + f i h + f i ' h 2 2! + f i" h 3 3! +L + h f i + f i ' h 2! + f " h 2 i 3! +L Backward difference substitution for f + h f i + f i f i 1 h ( ) + f i " h 2! + O h 2 + h 3 2 f 1 i 2 f i 1 + 5h 3 12 f "+O h 4 i ( ) h 2! + f " h 2 i 3! +L

Adams-Bashforth Formulas 2nd order n-th order + h 3 2 f 1 i 2 f i 1 + 5h 3 12 f "+O h 4 i n 1 + h β k f i k + O h n +1 k= 0 ( ) ( )

Adams-Moulton Methods Closed Formulas Taylor series expansion h 2 y i = f i+1 h + f ' i+1 2! f " i+1 3! +L h + h f i+1 f ' i+1 2! + f " h 2 i+1 3! +L Backward difference substitution for f + h f i+1 f f i+1 i h h 3 ( ) + f " i+1 h 2! + O h 2 + h 1 2 f + 1 i+1 2 f i h 3 12 f " O h 4 i ( ) h 2! + f " h 2 i 3! +L

Adams-Moulton Formulas 2nd order + h 1 2 f + 1 i+1 2 f i h 3 12 f " O h 4 i n-th order n 1 + h β k f i+1 k + O h n +1 k= 0 ( ) ( )

Milne s s Method Predictor-Corrector Predictor: 3-point Newton-Cotes open 3 + 4h ( 3 2 f f + 2 f i i 1 i 2) Corrector: 3-point Newton-Cotes closed j ( ) E p = 28 29 y m 0 i y i ( ) 1 + h 3 f j 1 i 1 + 4 f i + f i+1 ( ) E c = 1 29 y m 0 i+1

Milne s s Method Integrate y = 4e 0.8x - 0.5y and y(0)= )=2 Use an RK method to compute previous points y(-3-3)=-4.547, y(-2-2)=-2.306, y(-1-1)=-0.393, y 0 1 = y 3 + 4h ( 3 2 f f + 2 f 0 1 2) = 4.547 + 4 ( 1 ) ( ) 1.994 + 2( 1.961) 3 2 3 = 6.023 ε t = 2.8% y 1 1 = y 1 + h 3 f 0 ( 1 + 4 f 0 + 2 f 1 ) ( ) = 0.393 + 1 ( 3 1.994 + 4 ( 3 ) + 5.891) = 6.235 ε t = 0.66%

Fourth-Order Adams Use fourth-order Adams-Bashforth as predictor + h 55 24 f i 59 24 f i 1 + 37 24 f i 2 9 24 f i 3 Use fourth-order Adams-Moulton as corrector j ( ) E c = 251 270 y m 0 i y i + h 9 24 f j 1 i+1 + 19 24 f i 5 24 f i 1 + 1 24 f i 2 ( ) E c = 19 270 y m 0 i+1

Fourth-Order Adams Integrate y = 4e 0.8x - 0.5y and y(0)= )=2 Use an RK method to compute previous points y(-3-3)=-4.547, y(-2-2)=-2.306, y(-1-1)=-0.393, y 0 1 = y 0 + h 55 24 f 0 59 24 f 1 + 37 24 f 2 9 24 f 3 = 2 +1 55 ( 24 3 ) 59 ( 24 1.994 ) + 37 ( 24 1.961 ) 9 ( 24 2.637 ) = 6.008 ε t = 3.1% y 1 1 = y 0 + h 55 24 f 0 59 24 f 1 + 37 24 f 2 9 24 f 3 = 2 +1 9 ( 24 5.898 ) + 19 ( 24 3 ) 5 ( 24 1.994 ) + 1 24 1.961 ( ) = 6.253 ε t = 0.96%

Multistep Methods Because of the smaller error coefficients, Milne s s Method is slightly more accurate than Fourth-Order Adams methods However, Milne s s can often be unstable Example: y =-y, y(0)= )=1, h=0.5

Multistep Methods

Next Lecture Ordinary Differential Equations Boundary-Value Problems Eigenvalue Problems Read Chapter 27 HW6 due 11/16 Exam 2 11/9