NUMERICAL SOLUTION OF ODE IVPs. Overview

Similar documents
Numerical Solution of ODE IVPs

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

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

Scientific Computing: An Introductory Survey

Numerical Differential Equations: IVP

ECE257 Numerical Methods and Scientific Computing. Ordinary Differential Equations

Linear Multistep Methods I: Adams and BDF Methods

Numerical Methods - Initial Value Problems for ODEs

Initial value problems for ordinary differential equations

Ordinary Differential Equations

Section 7.4 Runge-Kutta Methods

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

MTH 452/552 Homework 3

Ordinary Differential Equations

Consistency and Convergence

Applied Math for Engineers

Initial value problems for ordinary differential equations

Mathematics for chemical engineers. Numerical solution of ordinary differential equations

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

Lecture 4: Numerical solution of ordinary differential equations

1 Error Analysis for Solving IVP

Section 7.2 Euler s Method

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)

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

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

Solving Ordinary Differential equations

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

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.

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

Lecture Notes on Numerical Differential Equations: IVP

Fourth Order RK-Method

Chap. 20: Initial-Value Problems

Euler s Method, cont d

Ordinary Differential Equations

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

CHAPTER 5: Linear Multistep Methods

Chapter 6 - Ordinary Differential Equations

Ordinary Differential Equations II

Ordinary differential equations - Initial value problems

Ordinary Differential Equations (ODEs)

Differential Equations

Numerical Methods for Differential Equations

Ordinary differential equation II

Ordinary Differential Equations II

Index. higher order methods, 52 nonlinear, 36 with variable coefficients, 34 Burgers equation, 234 BVP, see boundary value problems

2.29 Numerical Fluid Mechanics Fall 2011 Lecture 20

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

Ordinary Differential Equations

Multistep Methods for IVPs. t 0 < t < T

Introduction to the Numerical Solution of IVP for ODE

Numerical Methods for the Solution of Differential Equations

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

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

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

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

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

Math 411 Preliminaries

AMS 147 Computational Methods and Applications Lecture 09 Copyright by Hongyun Wang, UCSC. Exact value. Effect of round-off error.

2tdt 1 y = t2 + C y = which implies C = 1 and the solution is y = 1

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

Lecture 5: Single Step Methods

Differential Equations

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

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

Solving Ordinary Differential Equations

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

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

4 Stability analysis of finite-difference methods for ODEs

Part IB Numerical Analysis

Lecture IV: Time Discretization

The Chemical Kinetics Time Step a detailed lecture. Andrew Conley ACOM Division

Computational Methods

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

A Brief Introduction to Numerical Methods for Differential Equations

Physically Based Modeling: Principles and Practice Differential Equation Basics

1 Ordinary Differential Equations

Physically Based Modeling Differential Equation Basics

2 Numerical Methods for Initial Value Problems

Numerical solution of ODEs

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

Object-oriented scientific computing

The Initial Value Problem for Ordinary Differential Equations

Introduction to Initial Value Problems

Ordinary Differential Equations. Monday, October 10, 11

Differential equations. Differential equations

Lecture V: The game-engine loop & Time Integration

Numerical Methods for Initial Value Problems; Harmonic Oscillators

Lecture 8: Calculus and Differential Equations

Lecture 8: Calculus and Differential Equations

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

Ordinary Differential Equations I

Lecture 2. Introduction to Differential Equations. Roman Kitsela. October 1, Roman Kitsela Lecture 2 October 1, / 25

Chapter 11 ORDINARY DIFFERENTIAL EQUATIONS

16.7 Multistep, Multivalue, and Predictor-Corrector Methods

Ordinary Differential Equations I

Ordinary Differential Equations

On interval predictor-corrector methods

4.4 Computing π, ln 2 and e

ODE Runge-Kutta methods

Transcription:

NUMERICAL SOLUTION OF ODE IVPs 1 Quick review of direction fields Overview 2 A reminder about and 3 Important test: Is the ODE initial value problem? 4 Fundamental concepts: Euler s Method 5 Fundamental concepts: Truncation error 6 Fundamental concepts: of a method 7 Fundamental concepts: of a method 8 Stiff ODEs 9 Other methods overview 10 Systems and higher order IVPs 11 Solving IVPs with packaged software 1

Direction Field Review General First Order Ordinary Differential Equation: is shorthand for is a function of the variable and the variable Assumptions: is defined and single valued in some rectangular region in the plane If is a solution, then it is differentiable at all points in This allows us to plot a smooth curve 2

Direction Field Review Demo A direction field should be plotted Step 1: Draw a region in the plane Step 2: Choose a point in the region Step 3: Plot a short line starting at with slope Step 4: Repeat steps (2) and (3) for many different points y = y 2 t 4 3 2 1 y 0 1 2 3 4 2 0 2 4 6 8 10 t 3

Direction Field Review Notes A direction field gives a sense of the of the solutions Warning: be careful plotting a line that has a by zero) Example: (dividing y = (y 2 t 2 )/(2 t y) 4 3 2 1 y 0 1 2 3 4 4 3 2 1 0 1 2 3 4 t 4

Existence and Uniqueness: A Reminder Questions we must ask: Is there a solution? Is there only one solution? Why are these questions important? 1 If there is, your computer program may 2 If there is, the program will It may not be the one you want From your ODEs course, you learned theorems that gave checklists ensuring the existence and uniqueness of ODE IVP solutions A TIP: Use these theorems 5

Well-Posed Problems: A Must for Computation Before you begin computing a solution to an IVP, you must ensure that the problem is This automatically ensures that the solution to the problem exists is unique Basic meaning: The solution of a well-posed problem is not only unique, but also is to in the data (which almost always will occur on a computer) 6

for all Well-Posed Problems: Formal Definition Definition: The IVP is a well-posed problem if (1) A (2) A number solution exists such that a to the problem solution exists whenever and (3) A constant exists with the property that 7 to the

Well-Posed Problems: An Easy Test? Question: How can we tell whether criteria well-posedness are satisfied for a particular problem? for Answer: Good news! There is an easy test (ie, a theorem) that tells us immediately whether an IVP is well-posed 8

satisfies a Well-Posed Problems: An Easy Test! Theorem: Suppose and The IVP is well-posed provided 1 is on 2 on the set in the variable 9

Definition: A function Lipschitz Continuity: Definition Lipschitz condition in the variable on a set exists with the property that is said to be Lipschitz continuous or to satisfy a provided a constant whenever The constant is called the Lipschitz constant Note: If be used as a satisfied is differentiable, then the Lipschitz condition guarantees that Conversely, if is differentiable with respect to and, then satisfies the Lipschitz condition This property can of whether the is 10

on Lipschitz Condition Test: Example Example: Determine whether the IVP posed, given and If so, find the Lipschitz constant Answer: For each in, we have So, is, with Lipschitz constant in 11 is well on

Well-Posed versus Stable Solutions (1) Question: How much can a perturbed solution perturbed initial conditions solution when is assumed? with original and original initial conditions continuity with constant with perturbed and from the original on a bounded domain Answer: where 12

Well-Posed versus Stable Solutions (2) Definition: A solution of the ODE is stable if for every there is a such that if satisfies the ODE and then for all Example: The solution of the IVP with and a constant, is given by So, If, every solution is If, every solution is 13

Fundamental Concepts: Euler s Method (1) Disclaimer: Never use an IVP It is introduced here only to definitions Our canonical IVP: actually to basic concepts and on some region in the plane Assumption: All problems we will see are well-posed 14

Fundamental Concepts: Euler s Method (2) Direction Field Arrow: Take one step in this direction Slope = f(t0,y0) Start Point (t0,y0) }Step size h t1 = t0 + h (t1,y1) y1 = y0 + dy = y0 + h*f(t0,y0) } Height = f(t0,y0)*h In general: Starting at, we get to by using Note: represents the numerical approximation to Euler s method is: and 15

Truncation Error (TE) arises from the of the true solution Truncation Error Usually, a approximates an or summation Example: Taylor expand Method ): to get Euler s Method (a type of Taylor Euler s Method: Truncated Series Local Truncation Error (LTE) 16

Order of a Method Generally, Local Truncation Error (LTE) can be approximated by that LTE in the sense In general: The number is the order of the numerical method Example: Let method is: be the numerical approximation to Then LTE in Euler s Here,, so Euler s method is order Terminology: An order The method implies: error behaves like 17

Summary: Types of Numerical Error Rounding error: From finite precision floating point arithmetic (Example: ) Truncation error: From the method used Two classes: Local (LTE): Error made in method of the numerical Global (GTE): Accumulated error Error made after of the numerical method A numerical method is order if LTE = 18

Stability of a Numerical Method: Introductory Example Idea: If do not cause the solution to diverge from the solution, the numerical method is stable Example: Given the test IVP apply Euler s method with step size : which implies that Amplification Factor 19

real: Stability of a Numerical Method: Introductory Example (2) Example (continued): The Growth or Amplification Factor = Therefore, If, Euler s method is If, Euler s method is Requirements for Euler to be stable for this example: If complex: must be inside a disk in the complex plane centered at If must be in the interval Note: Choice of step-size is crucial for stability 20

Stability of a Numerical Method: General System General System: Taylor Expand: Let in Taylor expansion: (1) Euler s method: (2) Subtract equation (1) from equation (2): Global error Apply Mean Value Theorem 21

Stability of a Numerical Method: General System (2) Applying the Mean Value Theorem: where matrix of wrt is expressed in general as: LTE Amplification Factor Requirement for : where represents the of a matrix 22 and

Stability of a Numerical Method: General System (3) Observation: Stability requires that Question: What does this stability restriction imply? Answer: All eigenvalues of in the must lie inside a centered at disk Note: If eigenvalues lie the disk, the method will be Implication: We must choose that all stability constraints are satisfied so 23

Stability of a Numerical Method: Euler Method Region of Stability All eigenvalues of must lie inside the disk Im Region of Stability for Forward Euler Method 1 Re 24

Example: Consider Stability of a Numerical Method: Euler Example Question: When will Euler s Method be stable? Answer: Notice that EM implies Amplification Factor Therefore, For, the method is unstable for any For, the method will be stable if 25

Stability of a Numerical Method: Euler Example Illustration 1 EM h = 010001, ODE dy/dt = 10(t 1)y, y0 = 000673795 Euler solver True Solution 05 Solution y(t) 0 05 0 1 2 3 4 5 6 Time t 26

Implicit Methods Recall: Euler s method (EM) is and choose The limited region of stability for EM requires we carefully Improvement: Make the How? Use information at as wells as at This makes the method 27

Implicit Methods: Backward Euler Example of an Implicit Method: Backward Euler Method (BE) Implicit Question: How can we solve for Answer:? Use This often requires calculating the of the function Use methods Note: Both approaches require an initial guess, usually derived by taking one step of an explicit method 28

Implicit Methods: Stability Trade-off: Implicit methods take but are more Apply BE to the test ODE : Therefore Amplification Factor For BE to be stable we require Good news! As long as, BE is stable for any step size 29

Stability of a Numerical Method: BE Stability Region Illustration All eigenvalues of must lie in the left half plane Im Region of Stability for Backward Euler Method Entire Left Half Plane Re 30

Implicit Methods: Stability Notes Notes: BE is accurate (just like ) For a, the stability requirement becomes The stability region for BE is the entire plane (as compared to the radius 1 disk of EM) of the complex Since method is called step size keeps us within the stability region, the BE There exist higher order implicit methods, like the Trapezoid Method (order = ) Not all implicit methods are 31

Stiffness in ODEs Question: What is stiffness? Answer: Physically: A process whose components have scales Also, a process whose time scale is to the time interval over which it is being observed time compared Mathematically: A well-posed ODE has that differ greatly in magnitude is stiff if its Jacobian Practically: An ODE is stiff if an explicit method (like EM) is be extremely small because stability requirements force the step size to 32

Stiffness in ODEs: Example 1 Example 1: For test ODE with, the problem is if is real and Recall: For stability in EM, we require If, this forces For a system: A system of ODEs with is when where are the of Jacobian 33

Stiffness in ODEs: Example 2 Example 2: Consider Let Then the Jacobian is Therefore, So eigenvalue This is Note: on another interval, we have on so this ODE is on this interval 34

Consider Let Computed output with perturbed initial data: Stiffness: EM vs BE Time Exact Soln EM BE BE 35 EM

Stiffness: Comments on EM vs BE Note: EM with only perturbations BE is even with perturbations 36

Stiffness: Summary A particular ODE may be or A numerical ODE solving method can be for a particular problem or The stability of the numerical method often depends on ODEs methods should (almost) always be used to solve stiff 37

Other IVP Solvers Other classes of numerical IVP solvers include (but are not limited to): Higher Order Taylor methods (seldom used) Can give accuracy They require the computation of the of Runge-Kutta methods (very popular) Can give accuracy Do not need of Can be or These are -step methods Methods include: Midpoint, Modified Euler, Heun, 4th Order Runge-Kutta (RK4) 38

Multi-step methods Other IVP Solvers (cont) Can give accuracy Can be or Starting values must be calculated with a method (eg, RK4) Methods include: Adams-Bashforth, Adams-Moulton, Milne, Simpson Extrapolation methods These take solutions generated by lower order methods, and increase by Variations of these methods presented in [SB93], [Ste73], and [Gra65] Also see the discussion and reference list in [Asa95, p642] 39

Systems and Higher Order IVPs All methods and theories presented can be systems to apply to Many higher order IVPs can be to 1st order systems of IVPs Then all methods and theories apply here, too Example: Suppose we have the second order equation describing a linear spring, Convert this to a first order system of equations: 40

and for some solvers, sometimes and sometimes for a stiff ODE Solving IVPs with Packaged Software To solve a system of ODE IVPs with with a packaged routine typically requires to supply the following: The name of the routine that computes and values for times Initial value The number of equations in the system and/or error tolerances The routine that computes the Jacobian of function 41