Академический Документы
Профессиональный Документы
Культура Документы
Differential Equation
Definition:
a
mathematical
equation that consists of an
unknown
function
and
its
derivatives.
It expresses the relation between a
function and its derivatives.
Differential equations play a
fundamental role in engineering
because many physical phenomena
are
best
formulated
mathematically in terms of their
rate of change.
Examples: reaction rate, mass flow,
heat transfer rate, acceleration,
velocity, etc.
dv
c
g v
dt
m
(1)
Where:
= velocity
g = gravitational constant
t = time
m = mass
c = drag coefficient
- dependent variable
t- independent variable
2
MDH-KKEK2142 (Sem 2 2014/2015)
Differential Equation
When a function involves one independent variable, the
equation is called an ordinary differential equation (or ODE).
A partial differential equation (or PDE) involves two or more
independent variables.
3
MDH-KKEK2142 (Sem 2 2014/2015)
A BC
k2
(2)
Input
+ Generation
Output +
Accumulation
Hence,
dC A
k1C AC B k 2CC
dt
dC B
k1C AC B k 2CC
dt
dCC
k1C AC B k 2CC
dt
ODE
(3)
Output +
Accumulation
Classification of ODEs
ODEs are classified according to their order and their linearity.
The order of an ODE is the order of the highest derivative present in
that equation.
1st order
2nd order
dy
y kx
dx
d2y
dy
y
kx
2
dx
dx
3rd order
d y
d y dy
a 2 b kx
3
dx
dx
dx
3
Classification of ODEs
ODEs also can be classified according to its linearity, i.e. linear
and nonlinear ODE.
An ODE is nonlinear if it contains product of the dependent
variable or its derivatives or both.
Linear
Nonlinear
dy
y kx
dx
d2y
dy
y
kx
2
dx
dx
Nonlinear
d y
d y
dy
a 2 b kx
3
dx
dx
dx
3
Degree of ODEs
The degree of an ODE is the largest power to which the highest
order derivative is raised.
d y
d y dy
3 a 2 b kx
dx
dx
dx
3
d y
d y
dy
3 a 2 b kx
dx
dx
dx
3
Has degree of 5
10
Has degree of 2
7
MDH-KKEK2142 (Sem 2 2014/2015)
Runge-Kutta Methods
However not all ODEs can be solved using analytical
methods of calculus.
Need to use numerical methods.
Methods used to solve ODEs using iterative
methods.
Developed by German mathematicians C. Runge and
M.W. Kutta.
dy
f ( x, y )
dx
8
MDH-KKEK2142 (Sem 2 2014/2015)
Runge-Kutta Methods
Eulers method
Heuns method
Midpoint method
Higher Order Runge-Kutta (RK) method
Runge-Kutta Methods
Solve ordinary differential equations of the form
dy
f ( x, y )
dx
10
Runge-Kutta Methods
The type of RK methods can be differentiated by the manner in
which the slope is estimated.
The easiest one-step method: Eulers method.
However, Eulers method has the least accurate predictions
compared to other RK methods.
11
Eulers Method
Named after Leonhard Euler (1707-1783).
Swiss mathematician and physicist.
He introduced several mathematical notations
such as f(x), e (also known as Eulers number),
for summation and i.
He also had introduce the Eulers method to
solve ordinary differential equation.
It is the simplest method to solve an ODE with
a given initial value, yo.
12
Eulers Method
The first derivative provides a direct
estimate of the slope at xi
f ( xi , yi )
where f(xi,yi) is the differential
equation evaluated at xi and yi. This
estimate can be substituted into the
equation:
yi 1 yi f ( xi , yi )h
A new value of y is predicted using
the slope to extrapolate linearly over
the step size h.
13
MDH-KKEK2142 (Sem 2 2014/2015)
14
Exercise (homework)
Calculate the values from previous example for the subsequent steps, i.e.
y(1.0), y(1.5), y(2.0), y(2.5), y(3.0), y(3.5) and y(4.0).
Compare the value that you obtained using Eulers method with those
obtained using exact solution of
= 0.5 4 + 4 3 10 2 + 8.5 + 1
15
16
ii)
17
18
ii)
19
MATLAB
Short for MATrix LABoratory
Advantages:
1.
Ease of use
2.
Platform independence
3.
Pre-defined functions
4.
Device-independent plotting
5.
6.
MATLAB Compiler
Disadvantages:
1.
Interpreted language
execute more slowly
2.
Cost
20
The MATLAB
Workspace
Stores the
variable name
and value
The Command
History Window
Displays the
commands that
user has entered
21
Getting Help
Help Browser
22
23