You are on page 1of 26

Chapter 7

Ordinary Differential
Equations (ODE)
2
Vc Qc F
dt
dc
=
Given a differential equation;
Such equation plays important role in
engineering because it express the
rate of change of a variable as a
function of variables and parameters.
When the function involves one
independent variable, the equation is
called ordinary differential equation
(ODE).
Ordinary
Differential
Equations
Runge-Kutta
Methods
Multistep
methods
Eigenvalues
Problems
- Eigenvalues
- Non-self-Starting
Heun Method

- Eulers method
- Improvement of
Eulers method
-Runge-Kutta method
-Sytems of Equations

Runge-Kutta Method
This section will solve ordinary differential
equations of the form;
) , ( y x f
dx
dy
=
The method in general form;
size step slope value old value New + =
h y y
i i
| + =
+1
The slope, is used to extrapolate from an
old value to a new value over a distance, h.
|
The first derivative provides a direct
estimate of the slope at x
i
;


where f(x
i
,y
i
) is the differential equation
evaluated at x
i
and y
i
. This estimate can be
substituted into the equation 25.1

>>> Equation 25.2
A new value of y is predicted using the slope
to extrapolate linearly over the step size h.
) , (
i i
y x f = |
Eulers method
Try out Example 25.1
Comparison of the true solution with
numerical solution using Eulers method.
Improvement of Eulers
method
A source of error in Eulers method is
the derivative at the beginning of the
interval is assumed to apply across
the entire interval.
Two simple modifications are
available to avoid this limitation:
1) Heuns Method
2) The Midpoint Method
Heuns method
To improve the estimate of the slope,
its involves the determination of two
derivatives at the initial point and
at the end point.

The two derivatives are then averaged
to obtain an improved estimate of the
slope for the entire interval using
predictor >>>equation 25.15 and
corrector >>>equation 25.16
Graphical depiction of Heuns method
a) predictor b) corrector
1. (slope at (x
0
, y
0
)

2. (estimate of y at x
1
)

3. (slope at end of interval)

4. y (average slope)

5. y
1

(value of y at x
1
using average
slope) >>(Eqn 25.15)
6. y
1
(value of y at x
1
using corrector)
>>(Eqn 25.16)
0
1
y
'
0
y
'
1
y
Try out Example 25.5
Runge-Kutta Method
Runge-Kutta methods achieve the accuracy
of a Taylor series approach without requiring
the calculation of higher derivatives.
The method in general form;
h h y x y y
i i i i
) , , (
1
| + =
+
where is called an increment
function;
( ) h y x
i i
, , |
n n
k a k a k a + + + = ....
2 2 1 1
|
) , (
) , (
) , (
) , (
1 1 , 1 2 2 , 1 1 1 1
2 22 1 21 3 3
1 11 1 2
1
h k q h k q h k q y h p x f k
h k q h k q y h p x f k
h k q y h p x f k
y x f k
n n n n n i n i n
i i
i i
i i

+ + + + + =
+ + + =
+ + =
=

as, ps and qs are constants


2
nd
-order Runge-Kutta method
where there are 3 versions of 2
nd
-order
Runge-Kutta method;

a) Heun method >>>equation 25.36
b) Midpoint method >>>equation 25.37
c) Ralstons method >>>equation 25.38
The method in general form:
>>>equation 25.30 to 25.30b
3
rd
-order Runge-Kutta method
>>> equation 25.39 to 25.39c
4
th
-order Runge-Kutta method
The most commonly used. Called as
the classical fourth-order Runge-
Kutta.
>>> equation 25.40 to 25.40d
Try out Example 25.7
Systems of Equations
Many practical problems in engineering and
science require the solution of a system of
ordinary differential equations rather than a
single equation:
) , , , , (
) , , , , (
) , , , , (
2 1
2 1 2
2
2 1 1
1
n n
n
n
n
y y y x f
dx
dy
y y y x f
dx
dy
y y y x f
dx
dy

=
=
=
Try out Example 25.9 & 25.10
Multi-step method
The familiar simple second-order method
used is non-self-starting Heun method:
Try out Example 26.2
>>> Figure 26.5
Boundary-Value and
Eigenvalue Problems
An ODE is accompanied by 2 supportive
conditions. These conditions are used to
evaluate the integral that result during the
solution of the equation.

There are:
a)Initial-value problem.
b)Boundary-value problem.


Conditions are specified
at the same value of the
independent variable,
then we have an initial-
value problem.
Conditions are specified
at different value of the
independent variable,
then we have an
boundary-value
problem.
Given a noninsulated uniform rod positioned
between bodies of constant but different
temperature. Where T
1
<T
2
and T
2
>T
a
.
Boundary-value
Problems
200 ) (
40 ) 0 (
01 . 0
10
20
0 ) (
2
1
2
2
2
= =
= =
=
'
=
=
=
'
+

T L T
T T
m h
m L
T
T T h
dx
T d
a
a
(Boundary Conditions)
(Heat transfer coefficient)
If the rod is not insulated along its length and
the system is at a steady-state, heat balance;
(Temperature of surrounding)
Finite-Difference Methods
Finite-divided differences are substitute for
the derivatives in the original equation.
2
1 1
2
2
2
2
2
0 ) (
x
T T T
dx
T d
T T h
dx
T d
i i i
a
A
+
=
=
'
+
+
( )
( )
a i i i
a i
i i i
T x h T T x h T
T T h
x
T T T
2
1
2
1
2
1 1
2
0
2
A
'
= A
'
+ +
=
'

A
+
+
+
This equation is applied for each of the
interior nodes of the rod. The first and last
nodes,T
i-1
and T
i+1
, respectively, resulting
set of linear algebraic equation.
Try out Example 27.3 and Problem 27.3
Eigenvalue Problems
Eigenvalue problems are special class of
boundary-value problems involving vibrations,
elasticity and oscillation systems.
| | | | | |{ } 0 = X I A
Eigenvalue problems are typically solve by
the general form of linear algebraic equation;
where is an unknown parameter called
eigenvalue.
0 ) (
0 ) (
0 ) (
2 2 1 1
2 2 22 1 21
1 2 12 1 11
= + + +
= + + +
= + + +
n nn n n
n n
n n
x a x a x a
x a x a x a
x a x a x a

Tutorial

Problem 25.11
Problem 27.28(b)
Problem 28.10

You might also like