Sie sind auf Seite 1von 22

Presentation

of
Numerical Methods


4/17/2014 2
Presented To: Maam Ayesha Akber

Presented By: Muhammad Sarwar
10EL20


Introduction To ODEs
An equation that consists of derivatives is called a
differential equation.
Differential equations have applications in all areas
of science and engineering.
Mathematical formulation of most of the physical
and engineering problems leads to differential
equations.
So, it is important for engineers and scientists to
know how to set up differential equations

3
Types of ODEs
Differential equations are of two types
A. Ordinary differential equations (ODE)
B. Partial differential equations (PDE)
An ordinary differential equation is that in which all
the derivatives are with respect to a single
independent variable.
Examples of Ordinary Differential Equations.



4
Order & Degree of ODE
Ordinary differential equations are classified in
terms of order and degree. Order of an ordinary
differential equation is the same as the highest
derivative and the degree of an ordinary differential
equation is the power of highest derivative.
Thus the differential equation,


is of order 3 and degree 1.
5

Eulers method is a numerical technique to solve
ordinary differential equations of the form



So only first order ordinary differential equations
can be solved by using Eulers method.

6
Eulers Method
7
( ) ( )
0
0 , , y y y x f
dx
dy
= =
Slope
Run
Rise
=
0 1
0 1
x x
y y

=
( )
0 0
, y x f =
( )( )
0 1 0 0 0 1
, x x y x f y y + =
( )h y x f y
0 0 0
, + =
Figure 1 Graphical interpretation of the first step of Eulers method
Eulers Method
i i
x x h =
+1
8
Figure 2. General graphical interpretation of Eulers method
( )h y x f y y
i i i i
,
1
+ =
+
How to write Ordinary Differential
Equation
9
Example

( ) 5 0 , 3 . 1 2 = = +

y e y
dx
dy
x
is rewritten as

( ) 5 0 , 2 3 . 1 = =

y y e
dx
dy
x
In this case

( ) y e y x f
x
2 3 . 1 , =

How does one write a first order differential equation in the form of
( ) y x f
dx
dy
, =
Example
10
A ball at 1200K is allowed to cool down in air at an ambient temperature
of 300K. Assuming heat is lost only due to radiation, the differential
equation for the temperature of the ball is given by

( ) ( ) K
dt
d
1200 0 , 10 81 10 2067 . 2
8 4 12
= =

u u
u

Find the temperature at 480 = t
seconds using Eulers method. Assume a step size of
240 = h
seconds.
Solution
11
( )
( )
( )
( ) ( )
( )
K
f
h t f
h t f
i i i i
09 . 106
240 5579 . 4 1200
240 10 81 1200 10 2067 . 2 1200
240 1200 , 0 1200
,
,
8 4 12
0 0 0 1
1
=
+ =
+ =
+ =
+ =
+ =

+
u u u
u u u
Step 1:
1
u
is the approximate temperature at

240 240 0
0 1
= + = + = = h t t t
( ) K 09 . 106 240
1
= ~u u
( )
8 4 12
10 81 10 2067 . 2 u =
u

dt
d
( ) ( )
8 4 12
10 81 10 2067 . 2 , u = u

t f
Solution Cont
12
For
09 . 106 , 240 , 1
1 1
= = = u t i
( )
( )
( ) ( )
( )
K
f
h t f
32 . 110
240 017595 . 0 09 . 106
240 10 81 09 . 106 10 2067 . 2 09 . 106
240 09 . 106 , 240 09 . 106
,
8 4 12
1 1 1 2
=
+ =
+ =
+ =
+ =

u u u
Step 2:
2
u
is the approximate temperature at 480 240 240
1 2
= + = + = = h t t t
( ) K 32 . 110 480
2
= ~u u
Solution Cont
13
The exact solution of the ordinary differential equation is given by the
solution of a non-linear equation as
( ) 9282 . 2 10 22067 . 0 00333 . 0 tan 8519 . 1
300
300
ln 92593 . 0
3 1
=
+


t u
u
u
The solution to this nonlinear equation at t=480 seconds is
K 57 . 647 ) 480 ( = u
Comparison of Exact and Numerical
Solutions
0
200
400
600
800
1000
1200
1400
0 100 200 300 400 500
Time, t(sec)
T
e
m
p
e
r
a
t
u
r
e
,

h=240
Exact Solution

(
K
)
14
Figure 3. Comparing exact and Eulers method
Step, h u(480) E
t
|
t
|%
480
240
120
60
30
987.81
110.32
546.77
614.97
632.77
1635.4
537.26
100.80
32.607
14.806
252.54
82.964
15.566
5.0352
2.2864
Effect of step size
K 57 . 647 ) 480 ( = u
15
Table 1. Temperature at 480 seconds as a function of step size, h
(exact)
Comparison with exact results
-1500
-1000
-500
0
500
1000
1500
0 100 200 300 400 500
Time, t (sec)
T
e
m
p
e
r
a
t
u
r
e
,
Exact solution
h=120
h=240
h=480

(
K
)
16
Figure 4. Comparison of Eulers method with exact solution for different step sizes
Effects of step size on Eulers Method
-1200
-800
-400
0
400
800
0 100 200 300 400 500
Step size, h (s)
T
e
m
p
e
r
a
t
u
r
e
,

(
K
)
17
Figure 5. Effect of step size in Eulers method.
Errors in Eulers Method
2
h E
t

18
It can be seen that Eulers method has large errors. This can be illustrated using
Taylor series.
( ) ( ) ( ) ...
! 3
1
! 2
1
3
1
,
3
3
2
1
,
2
2
1
,
1
+ + + + =
+ + + + i i
y x
i i
y x
i i
y x
i i
x x
dx
y d
x x
dx
y d
x x
dx
dy
y y
i i i i
i i
( ) ( ) ( ) ... ) , ( ' '
! 3
1
) , ( '
! 2
1
) , (
3
1
2
1 1 1
+ + + + =
+ + + + i i i i i i i i i i i i i i
x x y x f x x y x f x x y x f y y
As you can see the first two terms of the Taylor series
( )h y x f y y
i i i i
,
1
+ =
+
The true error in the approximation is given by
( ) ( )
...
! 3
,
! 2
,
3 2
+
' '
+
'
= h
y x f
h
y x f
E
i i i i
t
are the Eulers method.
Some Pointes To Remember:
Generally, the approximation gets less accurate the
further you are away from the initial value.
Better accuracy is achieved when the points in the
approximation are closer together.
Your approximation is going to be above the actual
curve if the function is concave down and below the
actual curve if the function is concave up .
19
Euler Method in Electrical
Engineering
Electrical Engineering involves use of Differential
Equations in many ways:
Differential equations (DE's) are used to describe the
behavior of circuits containing energy storage
components - capacitors and inductors. The order of
the DE equates to the number of such storage
elements in the circuit - either in series or in parallel.
The easiest example is a series RC network. One
resistor and one capacitor in series with a voltage
source Vs
So Vs = Vc + Vr
20
Euler Method in Electrical
Engineering

21
Thank You!

Any Questions?
22

Das könnte Ihnen auch gefallen