Lecture 20 Ordinary Differential Equations IVP - PowerPoint PPT Presentation

1 / 40
About This Presentation
Title:

Lecture 20 Ordinary Differential Equations IVP

Description:

The first derivative and the initial y values are update each iteration. Euler's method: ... The derivative is calculated as: ... – PowerPoint PPT presentation

Number of Views:94
Avg rating:3.0/5.0
Slides: 41
Provided by: San59
Category:

less

Transcript and Presenter's Notes

Title: Lecture 20 Ordinary Differential Equations IVP


1
Lecture 20 - Ordinary Differential Equations -
IVP
  • CVEN 302
  • July 18, 2001

2
Lectures Goals
ODE Methods
  • Taylor Series Method
  • Euler and Modified Euler Methods
  • Runge-Kutta Method
  • Multistep Method
  • Adam Bashforth
  • Adam Moulton Method
  • Predictor-Corrector Method
  • Stability

3
Taylor Series Method
The Taylor series method is a straight forward
adaptation of classic calculus to develop the
solution as an infinite series. The catch is
that a computer usually can not be programmed to
construct the terms and one does not know how
many terms should be used. The method is not
strictly a numerical method but is use in
conjunction with numerical schemes.
4
Taylor Series Method
Consider
The initial conditions is
The analytical solution
5
Taylor Series Method
From the Taylor series expansion The step size
is defined as Using the initial condition, the
higher order derivatives of the equation can be
obtained.
6
Taylor Series Method
The higher order derivatives can be found with
the initial condition, y(0) 1, and the
equation.

7
Taylor Series Method
From the Taylor series expansion Plug in the
initial conditions Resulting in the equation
8
Taylor Series Example
The results
9
Taylor Series Example
Note that the last set of terms, you start to
lose accuracy for the 4th order All we know is
that it is in the range of 0lt x ltDh
10
Taylor Series Method
Numerical analysis is an art. The number of
terms, we chose is a mater of judgment and
experience. We will normally truncate the Taylor
series, when the contribution of the last term is
negligible to the number of decimal places to
which we are working.
11
Taylor Series Method
Taylor series applicable to higher order
equations, but one needs more initial
conditions The initial conditions are
12
Taylor Series Method
We can use the initial conditions to get the
higher derivative, however it will become more
complicated. The higher order terms can be
calculated from previous values and they are
difficult to calculate.
13
Euler Method
As you can see the Taylor series method is a bit
awkward to apply as the derivatives become more
complex. There are errors in finding the
derivatives. One thing about the Taylor series,
is that the error is small when the Dh is small
and only a few terms are need for good accuracy.
14
Euler Method
The Euler method may be though of as extreme of
the idea for a Taylor series having a small error
when Dh is extremely small. The Euler method is
a first-order Taylor series with each step having
an upgrade of the derivative and y term changed.

15
Euler Method
The Euler method can have the algorithm, where
the coefficients are upgraded each time step.
The first derivative and the initial y values
are update each iteration.
16
Eulers methodFirst-order Taylor Method
Straight line approximation
y0
x0
x1
x2
x3
h
h
h
17
Eulers Method Example
Consider The initial condition is The step
size is The analytical solution is
18
Eulers Method Example
The algorithm has a loop using the initial
conditions and definition of the derivative The
derivative is calculated as The next y value is
calculated Take the next step
19
Eulers Method Example
The results
20
Eulers Method Example
Compare the error at y(0.1) with a Dh0.02 Error
1.1103-1.1081 0.0022 If we want the
error to be smaller than 0.0001 We need to
reduce the step size by 22 to get the desired
error.
21
Eulers Method
  • The trouble with this method is
  • Lack of accuracy
  • Small step size

Note for the simple Euler method, we use the
slope at the beginning of the interval , to
determine the increment to the function, but this
is always wrong. If the the slope is constant,
the solution is linear.
22
Modified Euler Method
The Modified Euler method uses the slope at the
new location and is a predictor-corrector
technique. The method uses the average slope
between the two locations.
23
Modified Euler Method
The algorithm will be Initial guess of the
value Updated value
24
Modified Eulers Method Example
Consider The initial condition is The step
size is The analytical solution is
25
Modified Eulers Method Example
The results are
26
Modified Euler Method
If we were to look at the Taylor series expansion
Use a forward difference to represent the 2nd
derivative
27
Runge-Kutta Methods
Runge-Kutta methods are very popular because of
their good efficiency and are used in most
computer programs for differential equations.
They are single-step methods, as the Euler
methods.
28
Runge-Kutta Methods
To convey some idea of how the Runge-Kutta is
developed, lets look at the derivation of the
2nd order. Two estimates
29
Runge-Kutta Methods
The initial conditions are The Taylor series
expansion
30
Runge-Kutta Methods
Expand the derivatives The Taylor series
expansion becomes
31
Runge-Kutta Methods
From the Runge-Kutta The definition of the
function Expand the next step
32
Runge-Kutta Methods
From the Runge-Kutta Compare with the Taylor
series
4 unknowns
33
Runge-Kutta Methods
The Taylor series coefficients (3 equations/4
unknowns) If you select a as If you select
a as Note These coefficient would result in a
modified Euler or Midpoint Method
34
Runge-Kutta Method (2nd Order) Example
Consider Exact
Solution The initial condition is The step
size is Use the coefficients
35
Runge-Kutta Method (2nd Order) Example
The values are
36
Runge-Kutta Method (2nd Order) Example
The values are equivalent of Modified Euler
37
Runge-Kutta Method (2nd Order) Example b
The values are
38
Runge-Kutta Method (2nd Order) Example b
The values are
39
Summary
  • Taylor Series Expansion
  • Euler Method
  • Modified Euler Method
  • Runge-Kutta Method
  • 2nd order Method (Midpoint/Modified Euler)

40
Homework
  • Check the Homework webpage
Write a Comment
User Comments (0)
About PowerShow.com