Title: Lecture 20 Ordinary Differential Equations IVP
1Lecture 20 - Ordinary Differential Equations -
IVP
2Lectures Goals
Integration Methods (cont.)
- Gaussian Quadrature
- Taylor Series Method
- Euler and Modified Euler Methods
- Runge-Kutta Method
- Multistep Method
- Adam Bashforth
- Adam Moulton Method
- Predictor-Corrector Method
- Stability
ODE Methods
3Gaussian Quadratures
- Newton-Cotes Formulae
- use evenly-spaced functional values
- Gaussian Quadratures
- select functional values at non-uniformly
distributed points to achieve higher accuracy - change of variables so that the interval of
integration is -1,1 - Gauss-Legendre formulae
4Gaussian Quadrature on -1, 1
x2
x1
-1
1
- Choose (c1, c2, x1, x2) such that the method
yields exact integral for f(x) x0, x1, x2, x3
5Gaussian Quadrature on -1, 1
- Exact integral for f x0, x1, x2, x3
- Four equations for four unknowns
6Gaussian Quadrature on -1, 1
- Choose (c1, c2, c3, x1, x2, x3) such that the
method yields exact integral for f(x) x0, x1,
x2, x3,x4, x5
7Gaussian Quadrature on -1, 1
8Gaussian Quadrature on -1, 1
- Exact integral for f x0, x1, x2, x3, x4, x5
9Gaussian Quadrature on a, b
- Coordinate transformation from a,b to -1,1
t2
t1
a
b
10Example Gaussian Quadrature
- Evaluate
- Coordinate transformation
- Two-point formula
11Example Gaussian Quadrature
- Three-point formula
- Four-point formula
12End of Exam 2
13Taylor 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.
14Taylor Series Method
Consider
The initial conditions is
The analytical solution
15Taylor 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.
16Taylor Series Method
The higher order derivatives can be found with
the initial condition, y(0) 1, and the equation
17Taylor Series Method
From the Taylor series expansion Plug in the
initial conditions Resulting in the equation
18Taylor Series Example
The results
19Taylor 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
20Taylor 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.
21Taylor Series Method
Taylor series applicable to higher order
equations, but one needs more initial
conditions The initial conditions are
22Taylor 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.
23Euler 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.
24Euler 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.
25Euler 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.
26Eulers MethodFirst-order Taylor Method
Straight line approximation
y0
x0
x1
x2
x3
h
h
h
27Eulers Method Example
Consider The initial condition is The step
size is The analytical solution is
28Eulers 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
29Eulers Method Example
The results
30Eulers Method Example
31Eulers 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.
32Summary
- Gaussian Quadrature
- Taylor Series Expansion
- Euler Method
33Homework
- Check the Homework webpage