Ordinary differenctial equations methods.ppt

21bec114 22 views 39 slides Apr 30, 2024
Slide 1
Slide 1 of 39
Slide 1
1
Slide 2
2
Slide 3
3
Slide 4
4
Slide 5
5
Slide 6
6
Slide 7
7
Slide 8
8
Slide 9
9
Slide 10
10
Slide 11
11
Slide 12
12
Slide 13
13
Slide 14
14
Slide 15
15
Slide 16
16
Slide 17
17
Slide 18
18
Slide 19
19
Slide 20
20
Slide 21
21
Slide 22
22
Slide 23
23
Slide 24
24
Slide 25
25
Slide 26
26
Slide 27
27
Slide 28
28
Slide 29
29
Slide 30
30
Slide 31
31
Slide 32
32
Slide 33
33
Slide 34
34
Slide 35
35
Slide 36
36
Slide 37
37
Slide 38
38
Slide 39
39

About This Presentation

Ode


Slide Content

CISE301_Topic8L8&9 1
CISE301: Numerical Methods
Topic 8
Ordinary Differential Equations (ODEs)
Lecture 28-36
KFUPM
(Term 101)
Section 04
Read 25.1-25.4, 26-2, 27-1

CISE301_Topic8L8&9 2
Outline of Topic 8
Lesson 1: Introduction to ODEs
Lesson 2: Taylor series methods
Lesson 3: Midpoint and Heun’s method
Lessons 4-5: Runge-Kutta methods
Lesson 6: Solving systems of ODEs
Lesson 7: Multiple step Methods
Lesson 8-9:Boundary value Problems

CISE301_Topic8L8&9 3
Lecture 35
Lesson 8: Boundary Value Problems

CISE301_Topic8L8&9 4
Outlines of Lesson 8
Boundary Value Problem
Shooting Method
Examples

CISE301_Topic8L8&9 5
Learning Objectives of Lesson 8
Grasp the difference between initial value
problems and boundary value problems.
Appreciate the difficulties involved in solving the
boundary value problems.
Grasp the concept of the shooting method.
Use the shooting method to solve boundary
value problems.

CISE301_Topic8L8&9 6
Boundary-Value and
Initial Value Problems
Boundary-Value Problems
The auxiliary conditions are
not at one point of the
independent variable
More difficult to solve than
initial value problem5.1)2(,1)0(
2
2



xx
exxx
t

Initial-Value Problems
The auxiliary conditions
are at one point of the
independent
variable5.2)0(,1)0(
2
2



xx
exxx
t


same
different

CISE301_Topic8L8&9 7
Shooting Method

CISE301_Topic8L8&9 8
The Shooting Method
Target

CISE301_Topic8L8&9 9
The Shooting Method
Target

CISE301_Topic8L8&9 10
The Shooting Method
Target

CISE301_Topic8L8&9 11
Solution of Boundary-Value Problems
Shooting Method for Boundary-Value Problems
1.Guess a value for the auxiliary conditions at one
point of time.
2.Solve the initial value problem using Euler,
Runge-Kutta, …
3.Check if the boundary conditions are satisfied,
otherwise modify the guess and resolve the
problem.
Use interpolation in updating the guess.
It is an iterative procedure and can be
efficient in solving the BVP.

CISE301_Topic8L8&9 12
Solution of Boundary-Value Problems
Shooting Method8.0)1(,2.0)0(
2
)(
2


yy
xyyy
BVPsolvetoxyFind

Boundary-Value
Problem
Initial-value
Problem
convert
1.Convert the ODE to a system of
first order ODEs.
2.Guess the initial conditions that
are not available.
3.Solve the Initial-value problem.
4.Check if the known boundary
conditions are satisfied.
5.If needed modify the guess and
resolve the problem again.

CISE301_Topic8L8&9 13
Example 1
Original BVP2)1(,0)0(
044


yy
xyy
0 1 x

CISE301_Topic8L8&9 14
Example 1
Original BVP2)1(,0)0(
044


yy
xyy
2. 0
0 1 x

CISE301_Topic8L8&9 15
Example 1
Original BVP2)1(,0)0(
044


yy
xyy
2. 0
0 1 x

CISE301_Topic8L8&9 16
Example 1
Original BVP2)1(,0)0(
044


yy
xyy
to be
determined
2. 0
0 1 x

CISE301_Topic8L8&9 17
Example 1
Step1: Convert to a System of First Order ODEs 2y(1) have weuntil )0(y of valuesdifferent for
0.01h with RK2 using solved be willproblem The
?
0
)0(y
)0(y
,
)4(y
y
y
y
Equationsorder first ofsystem atoConvert
2)1(,0)0(
044
2
2
1
1
2
2
1































x
yy
xyy




CISE301_Topic8L8&9 18
Example 1
Guess # 10)0(
1#
y
Guess

-0.7688
0 1 x2)1(,0)0(
044


yy
xyy

CISE301_Topic8L8&9 19
Example 1
Guess # 21)0(
2#
y
Guess

0.99
0 1 x2)1(,0)0(
044


yy
xyy

CISE301_Topic8L8&9 20
Example 1
Interpolation for Guess # 32)1(,0)0(
044


yy
xyy )0(y
Guess y(1)
1 0 -0.7688
2 1 0.9900
0.99
0 1 2 y’(0)
-0.7688
y(1)

CISE301_Topic8L8&9 21
Example 1
Interpolation for Guess # 32)1(,0)0(
044


yy
xyy )0(y
Guess y(1)
1 0 -0.7688
2 1 0.9900
0.99
0 1 2 y’(0)
-0.7688
1.5743
2
y(1)
Guess 3

CISE301_Topic8L8&9 22
Example 1
Guess # 35743.1)0(
3#
y
Guess

2.000
0 1 x2)1(,0)0(
044


yy
xyy
This is the solution to the
boundary value problem.
y(1)=2.000

CISE301_Topic8L8&9 23
Summary of the Shooting Method
1.Guess the unavailable values for the
auxiliary conditions at one point of the
independent variable.
2.Solve the initial value problem.
3.Check if the boundary conditions are
satisfied, otherwise modify the guess and
resolve the problem.
4.Repeat (3) until the boundary conditions
are satisfied.

CISE301_Topic8L8&9 24
Properties of the Shooting Method
1.Using interpolation to update the guess often
results in few iterations before reaching the
solution.
2.The method can be cumbersome for high order
BVP because of the need to guess the initial
condition for more than one variable.

CISE301_Topic8L8&9 25
Lecture 36
Lesson 9: Discretization Method

CISE301_Topic8L8&9 26
Outlines of Lesson 9
Discretization Method
Finite Difference Methods for Solving Boundary
Value Problems
Examples

CISE301_Topic8L8&9 27
Learning Objectives of Lesson 9
Use the finite difference method to solve
BVP.
Convert linear second order boundary
value problems into linear algebraic
equations.

CISE301_Topic8L8&9 28
Solution of Boundary-Value Problems
Finite Difference Method8.0)1(,2.0)0(
2
)(
2


yy
xyyy
BVPsolvetoxyFind

y
4=0.8
0 0.25 0.5 0.75 1.0 x
x0 x1 x2 x3 x4
y
y
0=0.2
y
1=?
y
2=?
y
3=?
Boundary-Value
Problems
Algebraic
Equations
convert
Find the unknowns y
1, y
2, y
3

CISE301_Topic8L8&9 29
Solution of Boundary-Value Problems
Finite Difference Method
Divide the interval into nsub-intervals.
The solution of the BVP is converted to
the problem of determining the value of
function at the base points.
Use finite approximations to replace the
derivatives.
This approximation results in a set of
algebraic equations.
Solve the equations to obtain the solution
of the BVP.

CISE301_Topic8L8&9 30
Finite Difference Method
Example8.0)1(,2.0)0(
2
2


yy
xyyy
y
4=0.8
0 0.25 0.5 0.75 1.0 x
x0 x1 x2 x3 x4
y
y
0=0.2
Divide the interval
[0,1 ] into n = 4
intervals
Base points are
x0=0
x1=0.25
x2=.5
x3=0.75
x4=1.0
y1=?
y2=?
y3=?
To be
determined

CISE301_Topic8L8&9 31
Finite Difference Method
Example8.0)1(,2.0)0(
2
2


yy
xyyy 211
2
11
2
11
2
11
2
2
2
2
2
2
Replace
ii
iiiii
ii
iii
xy
h
yy
h
yyy
Becomes
xyyy
formuladifferencecentral
h
yy
y
formuladifferencecentral
h
yyy
y















Divide the interval
[0,1 ] into n = 4
intervals
Base points are
x0=0
x1=0.25
x2=.5
x3=0.75
x4=1.0

CISE301_Topic8L8&9 32
Second Order BVP2
11
22
2
1
43210
2
2
2
2)()(2)(
)()(
1,75.0,5.0,25.0,0
Points Base
25.0
8.0)1(,2.0)0(2
h
yyy
h
hxyxyhxy
dx
yd
h
yy
h
xyhxy
dx
dy
xxxxx
hLet
yywithxy
dx
dy
dx
yd
iii
ii














CISE301_Topic8L8&9 33
Second Order BVP  
2
11
2
111
43210
43210
21
2
11
2
2
2
163924
8216
8.0?,?,?,,2.0
1,75.0,5.0,25.0,0
3,2,12
2
2
iiii
iiiiiii
ii
iiiii
xyyy
xyyyyyy
yyyyy
xxxxx
ixy
h
yy
h
yyy
xy
dx
dy
dx
yd













CISE301_Topic8L8&9 34
Second Order BVP0.74360.6477,0.4791,
)8.0(2475.0
5.0
)2.0(1625.0
39160
243916
02439
1639243
1639242
1639241
163924
321
2
2
2
3
2
1
2
3234
2
2123
2
1012
2
11










































yyySolution
y
y
y
xyyyi
xyyyi
xyyyi
xyyy
iiii

CISE301_Topic8L8&9 35
Second Order BVP   
2
11
2
111
10099210
10099210
21
2
11
2
2
2
100002019910200
200210000
8.0?, ... ?,?,,2.0
1,99.0 ... 02.0,01.0,0
100,...,2,12
2
2
iiii
iiiiiii
ii
iiiii
xyyy
xyyyyyy
yyyyy
xxxxx
ixy
h
yy
h
yyy
xy
dx
dy
dx
yd













CISE301_Topic8L8&9 36

CISE301_Topic8L8&9 37
Summary of the Discretiztion Methods
Select the base points.
Divide the interval into nsub-intervals.
Use finite approximations to replace the
derivatives.
This approximation results in a set of
algebraic equations.
Solve the equations to obtain the solution
of the BVP.

CISE301_Topic8L8&9 38
Remarks
Finite Difference Method:
Different formulas can be used for
approximating the derivatives.
Different formulas lead to different
solutions. All of them are approximate
solutions.
For linear second order cases, this
reduces to tri-diagonal system.

CISE301_Topic8L8&9 39
Summary of Topic 8
Solution of ODEs
Lessons 1-3:
•Introduction to ODE, Euler Method,
•Taylor Series methods,
•Midpoint, Heun’s Predictor corrector methods
Lessons 4-5:
•Runge-Kutta Methods (concept & derivation)
•Applications of Runge-Kutta Methods To solve first order ODE
Lessons 6:
•Solving Systems of ODE
Lessons 8-9:
•Boundary Value Problems
•Discretization method
Lesson 7:
Multi-step methods
Tags