Escolar Documentos
Profissional Documentos
Cultura Documentos
ChE 106
Maria Christine Tankeh Asuncion
You never know a good thing till its gone
-The Script (Live Like Were Dying)
Outline: September 25, 2012
Review: Reducing ODEs to Canonical Form
ODEs Boundary Value Problems
Shooting Method (Linear)
Finite Difference Method for Linear BVPs
Review of ODEs
Ordinary Differential Equations: Recall
Linear vs. Nonlinear
order: 1 [linear]
order: 2 [nonlinear]
order: 3 [nonlinear]
Ordinary Differential Equations: Recall
Transformation to Canonical Form (system of 1
st
order DEs)
system of
equations
Ordinary Differential Equations: Recall
Transformation to Canonical Form (system of 1
st
order DEs)
initial conditions solution
Ordinary Differential Equations: Recall
Transformation to Canonical Form (system of 1
st
order DEs) CAN ALSO BE DONE TO n-th ORDER
DEs
Steps:
1. represent dependent variable & its derivatives with
new variables (start from z and end in z
(n-1)
)
2. reduce n-th order DE to system of 1
st
order DEs
Ordinary Differential Equations: Recall
y
1
,y
2
y
n
are new variables
canonical form
Ordinary Differential Equations: Recall
Exercise on the board. :D Reduce these to canonical
form.
Ordinary Differential Equations: Recall
a b
Ordinary Differential Equations: Recall
c [nonlinear] d [nonlinear]
Boundary Value Problems
Ordinary Differential Equations: BVP
we will focus on second order two-point boundary
value problems
with the boundary conditions
) ' , , ( ' ' ) , , (
2
2
y y t f y or
dt
dy
y t f
dt
y d
= =
|
o
=
=
) (
) (
b y
a y
Ordinary Differential Equations: BVP
Methods of Solving
1. Shooting Methods
Linear Shooting Method
Nonlinear Shooting Method
2. Finite Difference Methods for Linear BVPs
3. Rayleigh-Ritz Method
Ordinary Differential Equations: BVP
note: we will be dealing with LINEAR differential
equations only TODAY (degree of derivatives are 1,
no products of the dependent variable or/and its
derivatives)
Ordinary DEs: BVP: Application Example
cooling fin: what is the temperature profile across
the fin?
Shooting Method
Linear Shooting Method
solves the BVP by
solving 2 IVPs (2
shots)
a linear combination
of the 2 solutions
from the 2 IVPs will
yield a solution for
the BVP
Linear Shooting Method
given a linear BVP
with the boundary conditions:
we can associate 2 IVPs
) ( ) ( ' ) ( ) ( ' ' t r y t q y t p t y + + =
| o = = ) ( & ) ( b y a y
= =
+ + =
0 ) ( ' , ) (
) ( ) ( ' ) ( ) ( ' '
1
1 1
1 1 1
a y a y
t r y t q y t p t y
IVP
o
= =
+ =
1 ) ( ' , 0 ) (
) ( ' ) ( ) ( ' '
2
2 2
2 2 2
a y a y
y t q y t p t y
IVP
identical to y(t)
homogeneous
Linear Shooting Method
if is a solution to IVP-1 and
is a solution to IVP-2
then
is a solution of the original BVP, as long as
now, lets prove it. :D
) (
) (
2
1
t y
t y
) (
) (
) (
) ( ) (
2
2
1
1
t y
b y
b y
t y t y
+ =
|
0 ) (
2
= b y
Linear Shooting Method: Derivation
To prove is a solution
to
To be a solution and because of linearity of the
differential operator, it should be that
) (
) (
) (
) ( ) (
2
2
1
1
t y
b y
b y
t y t y
+ =
|
) ( ) ( ' ) ( ) ( ' ' t r y t q y t p t y + + =
) ( ' ' ) ( ' ' ) ( ' '
2 1
t Cy t y t y + =
C
Linear Shooting Method: Derivation
plugging in the form of y
1
and y
2
from IVP-1 and
IVP-2,
) ( ' ' ) ( ' ' ) ( ' '
2 1
t Cy t y t y + =
) ( ) ( ) ( ' ) ( ) ( ) ( ) ( ) ( ' ) ( ) ( ' '
2 2 1 1
t y t Cq t y t Cp t r t y t q t y t p t y + + + + =
| | | | ) ( ) ( ) ( ) ( ) ( ' ) ( ' ) ( ) ( ' '
2 1 2 1
t r t Cy t y t q t Cy t y t p t y + + + + =
) ( ) ( ) ( ) ( ' ) ( ) ( ' ' t r t y t q t y t p t y + + =
and this is the form of the original
linear BVP, thus proving the claim
Linear Shooting Method: Derivation
now to derive the expression for , let us use the
given boundary conditions in this expression:
using IVP-1 conditions
using IVP-2 conditions
now imposing the boundary condition that
and solving for C, we get for BC2 to
be true
C
) ( ) ( ) (
2 1
t Cy t y t y + =
0 ) ( ) ( ) (
2 1
+ = + = o a Cy a y a y
) ( ) ( ) (
2 1
b Cy b y b y + =
| = ) (b y
which is
consistent with
BC1
) (
) (
2
1
b y
b y
C
=
|
Linear Shooting Method
so finally, the solution when using the shooting
method is given by
) (
) (
) (
) ( ) (
2
2
1
1
t y
b y
b y
t y t y
+ =
|
Linear Shooting Method: Steps
Steps:
1. Derive IVP-1 and IVP-2 from BVP
2. Specify h to be used in solving the IVPs
3. Solve the two IVPs using the Runge-Kutta Method
4. Use the formula at each discrete value of the
independent variable
) (
) (
) (
) ( ) (
2
2
1
1
t y
b y
b y
t y t y
+ =
|
Linear Shooting Method: Example
Solve the BVP over the interval [0,4] using RK
(h=0.2)
#1
1 ) (
1
2
) ( '
1
2
) ( ' '
2 2
+
+
+
= t x
t
t x
t
t
t x
95 . 0 ) 4 ( , 25 . 1 ) 0 ( = = x x
1 ) (
1
2
) ( '
1
2
) ( ' '
1
2
1
2
1
+
+
+
= t x
t
t x
t
t
t x
) (
1
2
) ( '
1
2
) ( ' '
2
2
2
2
2
t x
t
t x
t
t
t x
+
+
=
0 ) 0 ( ' , 25 . 1 ) 0 (
1 1
= = x x
1 ) 0 ( ' , 0 ) 0 (
2 2
= = x x
Linear Shooting Method: Example
#2, h=0.2
#3 using RK4
1 ) (
1
2
) ( '
1
2
) ( ' '
1
2
1
2
1
+
+
+
= t x
t
t x
t
t
t x
'
1 2
1 1
x u
x u
=
=
1
1
2
1
2
'
'
1
2
2
2
2
2 1
+
+
+
=
=
u
t
u
t
t
u
u u
converting this 2
nd
order DE to a system of 1
st
order DEs
0 ) 0 ( ' , 25 . 1 ) 0 (
1 1
= = x x
note that u
1
is x
1
0 ) 0 ( , 25 . 1 ) 0 (
2 1
= = u u
Linear Shooting Method: Example
) (
1
2
) ( '
1
2
) ( ' '
2
2
2
2
2
t x
t
t x
t
t
t x
+
+
=
'
2 2
2 1
x r
x r
=
=
1
2
2
2
2
2 1
1
2
1
2
'
'
r
t
r
t
t
r
r r
+
+
=
=
converting this 2
nd
order DE to a system of 1
st
order DEs
note that r
1
is x
2
1 ) 0 ( ' , 0 ) 0 (
2 2
= = x x
1 ) 0 ( , 0 ) 0 (
2 1
= = r r
Linear Shooting Method: Example
=
+
+ +
2
2
1 1
2
1 1
( )
i i
i
i i i
i
r h y
h p
y q h y
h p
2
1
2
1
2
1 2
2
1 =
|
.
|
\
|
+ +
|
.
|
\
|
+
+
for
0<i<N
Finite Difference Method: Derivation
And since we know that
we can use that in our system of equations with
N-1 equations (since N-1 interior values)
N-1 unknowns (since you already know y
0
& y
N
)
unknowns are
| o = = ) ( & ) ( b y a y
1 3 2 1
... , ,
N
y y y y
Finite Difference Method: Derivation
writing down all the equations, we can put it in
matrix form
C AY =
(
(
(
(
(
(
(
(
|
.
|
\
|
|
.
|
\
|
+
=
(
(
(
(
(
(
(
(
(
(
(
(
(
(
(
+ +
+ +
+ +
+
|
o
2
1
2
1
) 2 (
2
1 0 0
2
1 ) 2 (
2
1
0
0
2
1 ) 2 (
2
1
0 0
2
1 ) 2 (
1
1
2
2
2
2
2
1
1
2
3
2
1
1
2 1
2
2
2 2
2
2
2 2
1
1
2
h p
r h
r h
r h
h p
r h
y
y
y
y
q h
h p
h p
q h
h p
h p
q h
h p
h p
q h
N
N
N
N
N
N
N
N
N
A is a tridiagonal matrix!
Finite Difference Method: Derivation
To solve the system of equations, you may use
LU Decomposition, Inverse Method, Cramers Rule
Gaussian-Elimination, Gauss-Jordan, etc.
Thomas Method
etc.
Finite Difference Method: Steps
Steps:
1. Identify p(t), q(t), and r(t)
2. Specify N, and calculate h
3. Build matrix A and C
4. Solve for Y
Finite Difference Method: Example
Given the following BVP
#1 & #2
0 ) 50 ( & 0 ) 0 (
1920000
) 50 (
10 25 . 6 ) ( ' '
6
= =
+ =
y y
x x
y x x y
1920000
) 50 (
) (
10 25 . 6 ) (
0 ) (
6
=
=
=
x x
t r
x t q
t p
5 . 2
20
0 50
=
=
N
a b
h
Finite Difference Method: Example
#3
Finite Difference Method: Example
= =
= +
0 ) 3 ( , 4 ) 1 (
2 ) ( ' 3 ) ( ' '
2
y y
t ty t y t
try replicating the values in the slides first