1/14  5.2 Euler’s Method Compute the approximations of y(t) at a set of ( usually equally-spaced ) mesh points a = t 0 < t 1 <…< t n = b. That is, to.

Slides:



Advertisements
Similar presentations
Formal Computational Skills
Advertisements

Chapter 6 Differential Equations
Ch 2.7: Numerical Approximations: Euler’s Method
Section 7.2: Direction Fields and Euler’s Methods Practice HW from Stewart Textbook (not to hand in) p. 511 # 1-13, odd.
Computational Methods in Physics PHYS 3437
Ordinary Differential Equations
CSE Differentiation Roger Crawfis. May 19, 2015OSU/CIS 5412 Numerical Differentiation The mathematical definition: Can also be thought of as the.
1cs542g-term Notes  Notes for last part of Oct 11 and all of Oct 12 lecture online now  Another extra class this Friday 1-2pm.
Copyright © 2006 The McGraw-Hill Companies, Inc. Permission required for reproduction or display. 1 Ordinary Differential Equations Equations which are.
CSE245: Computer-Aided Circuit Simulation and Verification Lecture Note 5 Numerical Integration Spring 2010 Prof. Chung-Kuan Cheng 1.
Ch 5.2: Series Solutions Near an Ordinary Point, Part I
ECIV 301 Programming & Graphics Numerical Methods for Engineers Lecture 31 Ordinary Differential Equations.
Initial-Value Problems
Dr. Jie Zou PHY Chapter 9 Ordinary Differential Equations: Initial-Value Problems Lecture (II) 1 1 Besides the main textbook, also see Ref.: “Applied.
8-1 Chapter 8 Differential Equations An equation that defines a relationship between an unknown function and one or more of its derivatives is referred.
Ordinary Differential Equations (ODEs) 1Daniel Baur / Numerical Methods for Chemical Engineers / Implicit ODE Solvers Daniel Baur ETH Zurich, Institut.
Numerical Solutions of Ordinary Differential Equations
NUMERICAL SOLUTION OF ORDINARY DIFFERENTIAL EQUATIONS
Ordinary Differential Equations (ODEs)
1 Chapter 6 Numerical Methods for Ordinary Differential Equations.
PART 7 Ordinary Differential Equations ODEs
Section 6.1: Euler’s Method. Local Linearity and Differential Equations Slope at (2,0): Tangent line at (2,0): Not a good approximation. Consider smaller.
Numerical Solutions to ODEs Nancy Griffeth January 14, 2014 Funding for this workshop was provided by the program “Computational Modeling and Analysis.
Applied Discrete Mathematics Week 9: Relations
Ch 8.1 Numerical Methods: The Euler or Tangent Line Method
Boyce/DiPrima 9th ed, Ch 8.4: Multistep Methods Elementary Differential Equations and Boundary Value Problems, 9th edition, by William E. Boyce and Richard.
Lecture 35 Numerical Analysis. Chapter 7 Ordinary Differential Equations.
Chapter 4 Numerical Differentiation and Integration 1/16 Given x 0, approximate f ’(x 0 ). h xfhxf xf h )()( lim)('    x0x0 x1x1 h x1x1 x0x0.
EE3561_Unit 8Al-Dhaifallah14351 EE 3561 : Computational Methods Unit 8 Solution of Ordinary Differential Equations Lesson 3: Midpoint and Heun’s Predictor.
Math 3120 Differential Equations with Boundary Value Problems Chapter 2: First-Order Differential Equations Section 2-6: A Numerical Method.
Modeling and simulation of systems Numerical methods for solving of differential equations Slovak University of Technology Faculty of Material Science.
Integration of 3-body encounter. Figure taken from
Numerical Methods for Solving ODEs Euler Method. Ordinary Differential Equations  A differential equation is an equation in which includes derivatives.
+ Numerical Integration Techniques A Brief Introduction By Kai Zhao January, 2011.
Finite Difference Methods Definitions. Finite Difference Methods Approximate derivatives ** difference between exact derivative and its approximation.
CHAPTER 3 NUMERICAL METHODS
Numerical Analysis – Differential Equation
Chapter 10 ordinary differential equations (ODEs) Chapter 11 systems of ODEs (6 th edition)
Please remember: When you me, do it to Please type “numerical-15” at the beginning of the subject line Do not reply to my gmail,
Chapter 5. Ordinary Differential Equation
Ch 8.2: Improvements on the Euler Method Consider the initial value problem y' = f (t, y), y(t 0 ) = y 0, with solution  (t). For many problems, Euler’s.
Dr. Mujahed AlDhaifallah ( Term 342)
Today’s class Ordinary Differential Equations Runge-Kutta Methods
Lecture 40 Numerical Analysis. Chapter 7 Ordinary Differential Equations.
ECE 576 – Power System Dynamics and Stability Prof. Tom Overbye Dept. of Electrical and Computer Engineering University of Illinois at Urbana-Champaign.
Ordinary Differential Equations
Sec 21: Generalizations of the Euler Method Consider a differential equation n = 10 estimate x = 0.5 n = 10 estimate x =50 Initial Value Problem Euler.
Lecture 39 Numerical Analysis. Chapter 7 Ordinary Differential Equations.
This chapter is concerned with the problem in the form Chapter 6 focuses on how to find the numerical solutions of the given initial-value problems. Main.
Ordinary Differential Equations (ODEs). Objectives of Topic  Solve Ordinary Differential Equations (ODEs).  Appreciate the importance of numerical methods.
Keywords (ordinary/partial) differencial equation ( 常 / 偏 ) 微分方程 difference equation 差分方程 initial-value problem 初值问题 convex 凸的 concave 凹的 perturbed problem.
1.1 Basic Concepts. Modeling
CSE245: Computer-Aided Circuit Simulation and Verification
Class Notes 18: Numerical Methods (1/2)
Numerical Solutions of Ordinary Differential Equations
CSE Differentiation Roger Crawfis.
Ch 5.2: Series Solutions Near an Ordinary Point, Part I
Chapter 26.
Sec 21: Analysis of the Euler Method
CSE245: Computer-Aided Circuit Simulation and Verification
Numerical Analysis Lecture 37.
5.3 Higher-Order Taylor Methods
Numerical Analysis Lecture 38.
MATH 175: NUMERICAL ANALYSIS II
Overview Class #2 (Jan 16) Brief introduction to time-stepping ODEs
MATH 175: Numerical Analysis II
Ch5 Initial-Value Problems for ODE
Modeling and Simulation: Exploring Dynamic System Behaviour
Presentation transcript:

1/14  5.2 Euler’s Method Compute the approximations of y(t) at a set of ( usually equally-spaced ) mesh points a = t 0 < t 1 <…< t n = b. That is, to compute w i  y(t i ) = y i for i = 1, …, n. Chapter 5 Initial-Value Problems for Ordinary Differential Equations -- Euler’s Method Difference equation Theorem: Suppose f is continuous and satisfies a Lipschitz condition with constant L on D = { (t, y) | a  t  b, –  < y <  } and that a constant M exists with |y”(t)|  M for all a  t  b. Let y(t) denote the unique solution to the IVP y’ (t) = f(t, y), a  t  b, y(a) = , and w 0, w 1, …w n be the approximations generated by Euler’s method for some positive integer n. Then for i = 0, 1, …, n

Chapter 5 Initial-Value Problems for Ordinary Differential Equations -- Euler’s Method Note: y”(t) can be computed without explicitly knowing y(t).  The roundoff error +  0 +  i+1 Theorem: Let y(t) denote the unique solution to the IVP y’ (t) = f(t, y), a  t  b, y(a) = , and w 0, w 1, …w n be the approximations obtained using the above difference equations. If |  i | <  for i = 0, 1, …, n, then for each i 2/14

Chapter 5 Initial-Value Problems for Ordinary Differential Equations -- Higher Order Taylor Methods  5.3 Higher Order Taylor Methods Definition: The difference method w 0 =  ; w i+1 = w i + h  ( t i, w i ), for each i = 0, 1, …, n – 1 has local truncation error for each i = 0, 1, …, n – 1. Note: The local truncation error is just (y i+1  w i+1 )/h with the assumption that w i = y i Note: The local truncation error is just (y i+1  w i+1 )/h with the assumption that w i = y i.  The local truncation error of Euler’s method Method of order 1 3/14

Chapter 5 Initial-Value Problems for Ordinary Differential Equations -- Higher Order Taylor Methods Note: Euler’s method can be derived by using Taylor’s expansion with n = 1 to approximate y(t).  Higher Order Taylor Methods Taylor method of order n: where The local truncation error is O(h n ) if y  C n+1 [a, b]. 4/14

Chapter 5 Initial-Value Problems for Ordinary Differential Equations -- Higher Order Taylor Methods Example: Apply Taylor’s method of order 2 and 4 to the IVP y’ = y – t 2 + 1, 0  t  2, y(0) = 0.5 Solution: Find the first 3 derivatives of f f(t, y(t)) = y(t) – t f ’(t, y(t)) = y’(t) – 2t = y(t) – t – 2t f ”(t, y(t)) = y’(t) – 2t – 2 = y(t) – t 2 – 2t – 1 f (3) (t, y(t)) = y’(t) – 2t – 2 = y(t) – t 2 – 2t – 1 T (2) (t i, w i ) = Taylor’s method of order 2: Given n = 10, thenh = 0.2 and t i = 0.2i w i+1 = 1.22w i – i 2 – 0.008i Table 5.3 on p.269 HW: p.271 #5 (a)(b) 5/14

 Other Euler’s Methods  Implicit Euler’s method )(,()()()( tytfhty’htyty    )1,...,0(),(; 1110   niwtfhwww iiii  Chapter 5 Initial-Value Problems for Ordinary Differential Equations -- Higher Order Taylor Methods Usually w i+1 has to be solved iteratively, with an initial value given by the explicit method.  The local truncation error of the implicit Euler’s method Hey! Isn’t the local truncation error of Euler’s method ? Seems that we can make a good use of it … 6/14

Chapter 5 Initial-Value Problems for Ordinary Differential Equations -- Higher Order Taylor Methods  Trapezoidal Method Note: The local truncation error is indeed O(h 2 ). However an implicit equation has to be solved iteratively.  Double-step Method Two initial points are required to start moving forward. Such a method is called double-step method. All the previously discussed methods are single-step methods. Note: If we assume that w i – 1 = y i– 1 w i = y i he local truncation error is O(h 2 ). Note: If we assume that w i – 1 = y i – 1 and w i = y i, the local truncation error is O(h 2 ). 7/14

Chapter 5 Initial-Value Problems for Ordinary Differential Equations -- Higher Order Taylor Methods Method  Euler’s explicit Euler’s implicit Trapezoidal Double-step SimpleLow order accuracy stable Low order accuracy and time consuming More accurateTime consuming More accurate, and explicit Requires one extra initial point Can’t you give me a method with all the advantages yet without any of the disadvantages? Do you think it possible? Well, call me greedy… OK, let’s make it possible. 8/14

Chapter 5 Initial-Value Problems for Ordinary Differential Equations -- Higher Order Taylor Methods  Modified Euler’s Method Step 1: Predict a solution by the explicit Euler’s method ),( 1 iiii wtfhww   Step 2: Correct w i+1 by Plugging it into the right hand side of the trapezoidal formula )],(),([   iiiiii wtfwtf h ww Note: This kind of method is called the predictor-corrector method. This modified Euler’ method is a single-step method of order 2. It is simpler than the implicit methods and is more stable that the explicit Euler’s method. 9/14

Chapter 5 Initial-Value Problems for Ordinary Differential Equations -- Runge-Kutta Methods  5.4 Runge-Kutta Methods A single-step method with high-order local truncation error without evaluating the derivatives of f. In a single-step method, a line segment is extended from (t i, w i ) to reach the next point (t i+1, w i +1 ) according to some slope. We can improve the result by finding a better slope. Idea  Check the modified Euler’s method: Must the slope be the average of K 1 and K 2 ? Must the step size be h? 10/14

Chapter 5 Initial-Value Problems for Ordinary Differential Equations -- Runge-Kutta Methods Generalize it to be: ),( ),( ][ phKwphphtfK wtfK KKhww ii ii ii     Determine 1, 2, and p such that the method has local truncation error of order 2. Step 1: Write the Taylor expansion of K 2 at ( t i, y i ) : Step 2: Plug K 2 into the first equation Step 3: Find 1, 2, and p such that  i+1 = ( y i+1 – w i+1 )/h = O(h 2 ). 11/14

Chapter 5 Initial-Value Problems for Ordinary Differential Equations -- Runge-Kutta Methods Here are unknowns and equations. 3 2 There are infinitely many solutions. A family of methods generated from these two equations is called Runge-Kutta method of order 2. Note: The modified Euler’s method is only a special case of Runge-Kutta methods with p = 1 and 1 = 2 = 1/2. Q: How to obtain higher-ordered accuracy? 12/14

Chapter 5 Initial-Value Problems for Ordinary Differential Equations -- Runge-Kutta Methods  Classical Runge-Kutta Order 4 Method – the most popular one 13/14

Chapter 5 Initial-Value Problems for Ordinary Differential Equations -- Runge-Kutta MethodsNote: The main computational effort in applying the Runge-Kutta methods is the evaluation of f. Butcher has established the relationship between the number of evaluations per step and the order of the local truncation error :  The main computational effort in applying the Runge-Kutta methods is the evaluation of f. Butcher has established the relationship between the number of evaluations per step and the order of the local truncation error : n  Best possible LTE evaluations per step  Since Runge-Kutta methods are based on Taylor’s expansion, y has to be sufficiently smooth to obtain better accuracy with higher-order methods. Usually the methods of lower order are used with smaller step size in preference to the higher-order methods using a large step size. HW: p #1 (a), 10, 13 14/14