Professional Documents
Culture Documents
Mws Gen Ode PPT Euler
Mws Gen Ode PPT Euler
Mws Gen Ode PPT Euler
Euler s Method
y
dy ! f x, y
, y 0
! y0 dx
Slope
!
!
Rise Run
y1 y 0 x1 x0
x0,y0
Step size, h x
! f x 0 , y 0
y1 ! y 0 f x0 , y 0 x1 x0
! y0 f x0 , y0
h
2
Euler s Method
y
yi 1 ! yi f xi , yi
h h ! xi 1 xi
yi h Step size xi xi+1
True Value
Example
dy 2 y ! 1.3e x , y 0
! 5 dx
is rewritten as
dy ! 1.3e x 2 y , y 0
! 5 dx In this case
f x, y
! 1.3e x 2 y
4
Example
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
dU ! 2 .2067 v 10 12 U 4 81 v 10 8 , U 0
! 1200 K dt
h ! 240 seconds.
Solution
Step 1:
dU ! 2.2067 v 10 12 U 4 81 v 10 8 dt
! 1200 2.2067 v 10 12 1200 4 81 v 10 8 240 ! 1200 4.5579 240 ! 106 .09 K
U1
6
U 240 } U1 ! 106.09 K
Solution Cont
Step 2:
For
i ! 1,
t1 ! 240, U1 ! 106.09
U 2 ! U1 f t1 , U 1 h ! 106 .09 f 240 ,106 .09 240 ! 106 .09 2 .2067 v 10 12 106 .09 4 81 v 10 8 240 ! 106 .09 0 .017595 240 ! 110 .32 K
Solution Cont
The exact solution of the ordinary differential equation is given by the solution of a non-linear equation as
0.92593 ln
U (480) ! 647.57 K
(K)
Temperature,
h=240
200 0 0 100 200 300 400 500
Time, t(sec)
Step, h
U(480)
Et
| t|%
U (480) ! 647.57 K
10
Tim e, t (sec)
h=480
Figure 4. Comparison of Euler s method with exact solution for different step sizes
11
e at e
K)
Ste s ze h s)
-800
-1200
yi 1 ! y i f ( xi , y i )xi 1 xi
As you can see the first two terms of the Taylor series
y i 1 ! yi f xi , y i
h are the Euler s method.
w h2