Académique Documents
Professionnel Documents
Culture Documents
|
.
|
\
|
+ A + =
(
|
.
|
\
|
+ A + =
=
+ + + = A
Problem :
1) Using Runge Kutta fourth order method, find y(0.2) for the
equation dy/dx= (y-x)/(y+x), y(0)=1 taking h=0.2
>> By data f(x,y) = (y-x)/(y+x), x
0
=0, y
0
=1, h=0.2
We shall first compute k
1,
k
2
, k
3
, k
4
k
1
= h f(x
0
,y
0
) = (0.2) f(0,1) = (0.2) [(1-0)/(1+0)] = 0.2
k
2
= h f(x
0
+ h/2 , y
0
+k
1
/2) = (0.2) f(0.1, 1.1) =
(0.2) [(1.1-0.1)/ (1.1+0.1)] = 0.1667
k
3
= h f(x
0
+h/2 , y
0
+k
2
/2) = (0.2) f(0.1, 1.0835) =
(0.2) [(1.0835-0.1)/ (1.0835+0.1)] = 0.1662
k
4
= h f(x
0
+ h , y
0
+k
3
) = (0.2) f(0.2, 1.1662) =
(0.2) [(1.1662-0.2)/ (1.1662+0.2)] = 0.1414
We have, y(x
0
+ h) = y
0
+ 1/6 (k
1
+
k
2
+ k
3
+ k
4
)
Therefore,
y(0.2) = 1 + 1/6 [(0.2 + 2(0.1667) + 2(0.1662) + 0.1414]
Thus y(0.2) = 1.1679
2) Use Runge Kutta fourth order method to find y at x=0.1 given
that dy/dx= 3e
x
+ 2y, y(0)=0 taking h=0.1
>> By data f(x, y) = 3e
x
+ 2y, x
0
=0, y
0
=0, h=0.1
We shall first compute k
1,
k
2
, k
3
, k
4
k
1
= h f(x
0
,y
0
) = (0.1) f(0,0) = (0.1) [3e
0
+ 2 0] = 0.3
k
2
= h f(x
0
+ h/2 , y
0
+k
1
/2) = (0.1) f(0.05, 0.15)
= (0.1) [3e
0.05
+ 2(0.15)] = 0.3454
k
3
= h f(x
0
+h/2 , y
0
+k
2
/2) = (0.1) f(0.05, 0.1727)
= (0.1) [3e
0.05
+ 2(0.1727)] = 0.3499
k
4
= h f(x
0
+ h , y
0
+k
3
) = (0.1) f(0.1, 0.3499)
= (0.1) [3e
0.1
+ 2(0.3499)] = 0.4015
We have, y(x
0
+ h) = y
0
+ 1/6 (k
1
+2
k
2
+2 k
3
+ k
4
)
Therefore,
y(0.1) = 0 + 1/6 [(0.3 + 2(0.3454) + 2(0.3499) + 0.4015]
Thus y(0.2) = 0.3487
Engineering 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
Find the temperature at t= 480 seconds seconds using Runge
Kutta 4
th
order method. Assume a step size of h= 240 seconds.
( ) ( ) K
dt
d
1200 0 , 10 81 10 2067 . 2
8 4 12
= =
u u
u
Step 1:
( )
8 4 12
10 81 10 2067 . 2 =
u
u
dt
d
( ) ( )
8 4 12
10 81 10 2067 . 2 , =
u u t f
( )h k k k k
i i 4 3 2 1 1
2 2
6
1
+ + + + =
+
u u
1200 ) 0 ( , 0 , 0
0 0
= = = = u u t i
( ) ( ) ( ) 5579 . 4 10 81 1200 10 2067 . 2 1200 , 0 ,
8 4 12
0 1
= = = =
f t f k
o
u
( ) ( )
( ) ( ) 38347 . 0 10 81 05 . 653 10 2067 . 2 05 . 653 , 120
240 5579 . 4
2
1
1200 , 240
2
1
0
2
1
,
2
1
8 4 12
1 0 0 2
= = =
|
.
|
\
|
+ + =
|
.
|
\
|
+ + =
f
f h k h t f k u
Continued..
( ) ( )
( ) ( ) 8954 . 3 10 81 0 . 1154 10 2067 . 2 0 . 1154 , 120
240 38347 . 0
2
1
1200 , 240
2
1
0
2
1
,
2
1
8 4 12
2 0 0 3
= = =
|
.
|
\
|
+ + =
|
.
|
\
|
+ + =
f
f h k h t f k u
( ) ( ) ( ) ( )
( ) ( ) 0069750 . 0 10 81 10 . 265 10 2067 . 2 10 . 265 , 240
240 984 . 3 1200 , 240 0 ,
8 4 12
3 0 0 4
= = =
+ + = + + =
f
f h k h t f k u
( )
( ) ( ) ( ) ( )
( )
K
h k k k k
65 . 675
240 1848 . 2
6
1
1200
240 069750 . 0 8954 . 3 2 38347 . 0 2 5579 . 4
6
1
1200
2 2
6
1
4 3 2 1 0 1
=
+ =
+ + + + =
+ + + + = u u
1 is the approximate temperature at t1= t0+ h= 0+ 240=240
( 240) = 1 = 675.65K
Step 2:
K t i 65 . 675 , 240 , 1
1 1
= = = u
( ) ( ) ( ) 44199 . 0 10 81 65 . 675 10 2067 . 2 65 . 675 , 240 ,
8 4 12
1 1 1
= = = =
f t f k u
( ) ( )
( ) ( ) 31372 . 0 10 81 61 . 622 10 2067 . 2 61 . 622 , 360
240 44199 . 0
2
1
65 . 675 , 240
2
1
240
2
1
,
2
1
8 4 12
1 1 1 2
= = =
|
.
|
\
|
+ + =
|
.
|
\
|
+ + =
f
f h k h t f k u
( ) ( )
( ) ( ) 34775 . 0 10 81 00 . 638 10 2067 . 2 00 . 638 , 360
240 31372 . 0
2
1
65 . 675 , 240
2
1
240
2
1
,
2
1
8 4 12
2 1 1 3
= = =
|
.
|
\
|
+ + =
|
.
|
\
|
+ + =
f
f h k h t f k u
2 is the approximate temperature at t2= t1 +h =
240+240=480
(480) = 2 = 594.91K
( ) ( ) ( ) ( )
( ) ( ) 25351 . 0 10 81 19 . 592 10 2067 . 2 19 . 592 , 480
240 34775 . 0 65 . 675 , 240 240 ,
8 4 12
3 1 1 4
= = =
+ + = + + =
f
f h k h t f k u
( )
( ) ( ) ( ) ( )
( )
K
h k k k k
91 . 594
240 0184 . 2
6
1
65 . 675
240 25351 . 0 34775 . 0 2 31372 . 0 2 44199 . 0
6
1
65 . 675
2 2
6
1
4 3 2 1 1 2
=
+ =
+ + + + =
+ + + + = u u
Comparison with other methods
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
,
(
K
)
Exact
4th order
Heun
Euler
Conclusion
The solutions obtained from range kutta method is
almost accurate when compared with that of other
methods.
The graph in the previous slide also depicts that range
Kutta methods solution is almost near exact solution.
Bibliography
Engineering mathematics by Dr K.S.C
Wikipedia
http://numericalmethods.eng.usf.edu/topics/rung
e_kutta_4th_method.html
Queries ???
Thank you