0% found this document useful (0 votes)
18 views14 pages

Chapter22rev1-ODE 1st Order

This chapter focuses on initial-value problems for ordinary differential equations (ODEs) and discusses various one-step methods, including Euler, Heun, Midpoint, and Fourth-Order Runge-Kutta methods. It explains the concepts of local and global truncation errors, their relationship to step size, and provides MATLAB code examples for implementing these methods. Additionally, the chapter addresses the application of these methods to systems of ODEs.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPT, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
18 views14 pages

Chapter22rev1-ODE 1st Order

This chapter focuses on initial-value problems for ordinary differential equations (ODEs) and discusses various one-step methods, including Euler, Heun, Midpoint, and Fourth-Order Runge-Kutta methods. It explains the concepts of local and global truncation errors, their relationship to step size, and provides MATLAB code examples for implementing these methods. Additionally, the chapter addresses the application of these methods to systems of ODEs.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPT, PDF, TXT or read online on Scribd
You are on page 1/ 14

Part 6

Chapter 22
Initial-Value Problems

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


All images copyright © The McGraw-Hill Companies, Inc. Permission required for reproduction or display.
Chapter Objectives
• Understanding the meaning of local and global truncation
errors and their relationship to step size for one-step methods
for solving ODEs.
• Knowing how to implement the following Runge-Kutta (RK)
methods for a single ODE:
– Euler
– Heun
– Midpoint
– Fourth-Order RK
• Knowing how to iterate the corrector of Heun’s method.
• Knowing how to implement the following Runge-Kutta
methods for systems of ODEs:
– Euler
– Fourth-order RK
Ordinary Differential Equations
• Methods described here are for solving differential
equations of the form:
dy
 f t, y
dt
• The methods in this chapter are all one-step
methods and have the general format:
 yi1 yi  h
where  is called an increment function, and is
used to extrapolate from an old value yi to a new
value yi+1. 
Euler’s Method
• The first derivative
provides a direct
estimate of the slope
at ti: dy
 f t i , yi 
dt ti
and the Euler method
uses that estimate as
 the increment
function:
  f t i , yi 
yi1 yi  f t i , yi h
Error Analysis for Euler’s Method
• The numerical solution of ODEs involves two types
of error:
– Truncation errors, caused by the nature of the techniques
employed
– Roundoff errors, caused by the limited numbers of
significant digits that can be retained
• The total, or global truncation error can be further
split into:
– local truncation error that results from an application
method in question over a single step, and
– propagated truncation error that results from the
approximations produced during previous steps.
Error Analysis for Euler’s Method
• The local truncation error for Euler’s method
is O(h2) and proportional to the derivative of
f(t,y) while the global truncation error is O(h).
• This means:
– The global error can be reduced by decreasing
the step size, and
– Euler’s method will provide error-free predictions
if the underlying function is linear.
• Euler’s method is conditionally stable,
depending on the size of h.
MATLAB Code for Euler’s Method
Heun’s Method
• One method to improve Euler’s method is to determine derivatives at
the beginning and predicted ending of the interval and average them:

• This process relies on making a prediction of the new value of y, then


correcting it based on the slope calculated at that new value.
• This predictor-corrector approach can be iterated to convergence:
Midpoint Method
• Another improvement to Euler’s method is
similar to Heun’s method, but predicts the
slope at the midpoint of an interval rather
than at the end:

• This method has a local truncation error of


O(h3) and global error of O(h2)
Runge-Kutta Methods
• Runge-Kutta (RK) methods achieve the accuracy of a Taylor
series approach without requiring the calculation of higher
derivatives.
• For RK methods, the increment function  can be generally
written as:
 a1k1  a2 k2  an kn

where the a’s are constants and the k’s are
k1  f t i , yi 
k2  f t i  p1h, yi  q11 k1h

k3  f t i  p2 h, yi  q21k1h  q22 k2 h

k  f t i  pn 1h, yi  qn 1,1k1h  qn 1,2 k2 h  qn 1,n 1kn 1h
n
where the p’s and q’s are constants.
Classical Fourth-Order Runge-
Kutta Method
• The most popular RK methods are fourth-
order, and the most commonly used form is:
1
yi1 yi  k1  2k2  2k3  k4 h
6

where:
k1  f t i , yi 

 1 1 
k2  f t i  h, yi  k1h 
 2 2 
 1 1 
k3  f t i  h, yi  k2 h 
 2 2 
k4  f t i  h, yi  k3h
Systems of Equations
• Many practical problems require the solution of a
system of equations:
dy1
 f1 t, y1 , y2 ,, yn 
dt
dy2
 f2 t, y1 , y2 ,, yn 
dt

dyn
 fn t, y1 , y2 ,, yn 
dt

• The solution of such a system requires that n initial
conditions be known at the starting value of t.

Solution Methods
• Single-equation methods can be used to
solve systems of ODE’s as well; for example,
Euler’s method can be used on systems of
equations - the one-step method is applied
for every equation at each step before
proceeding to the next step.
• Fourth-order Runge-Kutta methods can also
be used, but care must be taken in
calculating the k’s.
MATLAB RK4 Code

You might also like

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy