Introduction to Ordinary Differential Equations

SE301: 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_Topic8L1
1
Objectives of Topic 8
Solve Ordinary Differential Equations
(ODEs).
 Appreciate the importance of numerical
methods in solving ODEs.
 Assess the reliability of the different
techniques.
 Select the appropriate method for any
particular problem.

CISE301_Topic8L1
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_Topic8L1
3
Lecture 28
Lesson 1: Introduction to ODEs
CISE301_Topic8L1
4
Learning Objectives of Lesson 1

Recall basic definitions of ODEs:





Classify ODEs based on:


Order
Linearity
Initial conditions
Solution
Order, linearity, and conditions.
Classify the solution methods.
CISE301_Topic8L1
5
Derivatives
Derivatives
Ordinary Derivatives
dv
dt
v is a function of one
independent variable
CISE301_Topic8L1
Partial Derivatives
u
y
u is a function of
more than one
independent variable
6
Differential Equations
Differential
Equations
Ordinary Differential Equations
2
d v

6
tv

1
2
dt
involve one or more
Ordinary derivatives of
unknown functions
CISE301_Topic8L1
Partial Differential Equations
u u
 2 0
2
y
x
2
2
involve one or more
partial derivatives of
unknown functions
7
Ordinary Differential Equations
Ordinary Differential Equations (ODEs) involve one or
more ordinary derivatives of unknown functions with
respect to one independent variable
Examples :
dv(t )
 v(t )  et
x(t): unknown function
dt
d 2 x(t )
dx(t )
5
 2 x(t )  cos(t )
2
dt
dt
t: independent variable
CISE301_Topic8L1
8
Example of ODE:
Model of Falling Parachutist
The velocity of a falling
parachutist is given by:
dv
c
 9.8  v
dt
M
M : mass
c : drag coefficient
v : velocity
CISE301_Topic8L1
9
Definitions
dv
c
 9.8  v
dt
M
CISE301_Topic8L1
Ordinary
differential
equation
10
Definitions (Cont.)
dv
c
 9 .8 
v
dt
M
CISE301_Topic8L1
(Dependent
variable)
unknown
function to be
determined
11
Definitions (Cont.)
dv
c
 9 .8 
v
dt
M
(independent variable)
the variable with respect to which
other variables are differentiated
CISE301_Topic8L1
12
Order of a Differential Equation
The order of an ordinary differential equation is the order
of the highest order derivative.
Examples :
dx(t )
 x(t )  e t
dt
d 2 x(t )
dx(t )
5
 2 x(t )  cos(t )
2
dt
dt
 d x(t )

2
dt

2
CISE301_Topic8L1
First order ODE
Second order ODE
3
 dx(t )
 
 2 x 4 (t )  1
dt

Second order ODE
13
Solution of a Differential Equation
A solution to a differential equation is a function that
satisfies the equation.
Example :
dx(t )
 x(t )  0
dt
CISE301_Topic8L1
Solution
x(t )  e
t
Proof :
dx(t )
 e t
dt
dx(t )
t
t
 x(t )  e  e  0
dt
14
Linear ODE
An ODE is linear if
The unknown function and its derivatives appear to power one
No product of the unknown function and/or its derivatives
Examples :
dx(t )
 x(t )  et
dt
d 2 x(t )
dx(t )
2

5

2
t
x(t )  cos(t )
2
dt
dt
3
 d x(t )  dx(t )

 
 x(t )  1
2
dt
 dt 
2
CISE301_Topic8L1
Linear ODE
Linear ODE
Non-linear ODE
15
Nonlinear ODE
An ODE is linear if
The unknown function and its derivatives appear to power one
No product of the unknown function and/or its derivatives
Examples of nonlinear ODE :
dx(t )
 cos( x(t ))  1
dt
d 2 x(t )
dx(t )
 5
x(t )  2
2
dt
dt
d 2 x(t )
dx(t )

 x(t )  1
2
dt
dt
CISE301_Topic8L1
16
Solutions of Ordinary Differential
Equations
x(t )  cos( 2t )
is a solution to the ODE
2
d x(t )
 4 x(t )  0
2
dt
Is it unique?
All functions of the form x(t )  cos( 2t  c)
(where c is a real constant) are solutions.
CISE301_Topic8L1
17
Uniqueness of a Solution
In order to uniquely specify a solution to an nth
order differential equation we need n conditions.
d 2 x (t )
 4 x (t )  0
dt 2
x ( 0)  a
x (0)  b
CISE301_Topic8L1
Second order ODE
Two conditions are
needed to uniquely
specify the solution
18
Auxiliary Conditions
Auxiliary Conditions
Boundary Conditions
Initial Conditions

All conditions are at one
point of the independent
variable
CISE301_Topic8L1

The conditions are not at
one point of the
independent variable
19
Boundary-Value and
Initial value Problems
Initial-Value Problems

The auxiliary conditions
are at one point of the
independent
variable
x  2 x  x  e
x(0)  1, x (0)  2.5
CISE301_Topic8L1


2 t
same
Boundary-Value Problems
The auxiliary conditions are
not at one point of the
independent variable
More difficult to solve than
initial value problems
x  2 x  x  e 2t
x(0)  1, x(2)  1.5
different
20
Classification of ODEs
ODEs can be classified in different ways:
 Order




Linearity



First order ODE
Second order ODE
Nth order ODE
Linear ODE
Nonlinear ODE
Auxiliary conditions


Initial value problems
Boundary value problems
CISE301_Topic8L1
21
Analytical Solutions

Analytical Solutions to ODEs are available
for linear ODEs and special classes of
nonlinear differential equations.
CISE301_Topic8L1
22
Numerical Solutions
Numerical methods are used to obtain a
graph or a table of the unknown function.
 Most of the Numerical methods used to
solve ODEs are based directly (or
indirectly) on the truncated Taylor series
expansion.

CISE301_Topic8L1
23
Classification of the Methods
Numerical Methods
for Solving ODE
Single-Step Methods
Estimates of the solution
at a particular step are
entirely based on
information on the
Multiple-Step Methods
Estimates of the solution
at a particular step are
based on information on
more than one step
previous step
CISE301_Topic8L1
24