Mws Mec Ode TXT Runge4th Examples PDF
Mws Mec Ode TXT Runge4th Examples PDF
04
Runge-Kutta 4th Order Method for
Differential Equations-More Examples
Mechanical Engineering
Ordinary
Example 1
A solid steel shaft at room temperature of 27 o C is needed to be contracted so that it can be
shrunk-fit into a hollow hub. It is placed in a refrigerated chamber that is maintained at
33 o C . The rate of change of temperature of the solid shaft is given by
3 .69 10 6 4 2 .33 10 5 3 1.35 10 3 2
d
33
5 .33 10 6
dt
5 .42 10 2 5 .588
0 27 C
Using the Runge-Kutta 4th order method, find the temperature of the steel shaft after 86400
seconds. Take a step size of h 43200 seconds.
Solution
3 .69 10 6 4 2 .33 10 5 3 1.35 10 3 2
d
5 .33 10 6
dt
5 .42 10 2 5 .588
33
6
4
5
3
3
2 .33 10 1.35 10 2
6 3 .69 10
33
f t, 5 .33 10
2
5
.
42
10
5
.
588
1
k1 2k 2 2k 3 k 4 h
6
For i 0 , t 0 0 , 0 27
k1 f t 0 , 0
f 0,27
i 1 i
4
3
6
5
6 3.69 10 27 2.33 10 27
27 33
5.33 10
1.35 10 3 27 2 5.42 10 2 27 5.588
0.0020893
1
1
k 2 f t 0 h, 0 k1 h
2
2
1
1
f 0 43200 , 27 0.002089343200
2
2
08.04.1
08.04.2
Chapter 08.04
f 21600, 18.129
6
18.129 33
5.33 10
1.35 10 3 18.129 2 5.42 10 2 18.129 5.588
0.00035761
1
1
k 3 f t 0 h, 0 k 2 h
2
2
1
1
f 0 43200,27 0.0003576143200
2
2
f 21600, 19.276
4
3
6
5
19.276 33
5.33 10
1.35 10 3 19.276 2 5.42 10 2 19.276 5.588
0.0018924
k 4 f t 0 h , 0 k 3 h
f 0 43200 , 27 0.0018924 43200
f 43200 , 54.751
6
54.751 33
5.33 10
1.35 10 3 54.7512 5.42 10 2 54.751 5.588
0.0035147
1
1 0 ( k1 2 k 2 2 k 3 k 4 ) h
6
1
27 0.0020893 2 0.00035761 2 0.0018924 0.0035147 43200
6
1
27 0.010104 43200
6
45.749 C
1 is the approximate temperature at
t t1 t 0 h 0 43200 43200 s
43200 1 45.749 C
For i 1, t1 43200, 1 45.749
k1 f t1 , 1
f 43200,45.749
45.749 33
5.33 10
1.35 10 3 45.749 2 5.42 10 2 45.749 5.588
0.00084673
Runge-Kutta 4th Order Method for ODE-More Examples: Mechanical Engineering 08.04.3
1
1
k 2 f t1 h, 1 k1 h
2
2
1
1
f 64800,64.038
6
64.038 33
5.33 10
1.35 10 3 64.0382 5.42 10 2 64.038 5.588
0.010012
1
1
k 3 f t1 h, 1 k 2 h
2
2
1
1
f 64800,262.01
6
262.01 33
5.33 10
1.35 10 3 262.012 5.42 10 2 262.01 5.588
21.636
k 4 f t1 h,1 k 3 h
f 43200 43200,45.749 21.636 43200
f 86400 , 9.3474 10 5
6
5.33 10 1.35 10 3 9.4374 10 5
1.4035 1019
1
6
2 1 ( k1 2 k 2 2 k 3 k 4 ) h
1 0.00084673 2 0.010012
45.749
6 2 21.636 1.4035 1019
43200
9.4374 10 5 33
08.04.4
Chapter 08.04
Figure 1 Comparison of Runge-Kutta 4th order method with exact solution for
different step sizes.
Table 1 and Figure 2 shows the effect of step size on the value of the calculated temperature
at t 86400 s .
Runge-Kutta 4th Order Method for ODE-More Examples: Mechanical Engineering 08.04.5
Table 1 Value of temperature at 86400 seconds for different step sizes.
Step size, h
86400
43200
21600
10800
5400
86400
|t | %
Et
5.3468 10
1.0105 10 23
26.061
26.094
26.097
28
5.3468 10
1.0205 10 23
0.038680
0.0050630
0.0015763
28
2.0487 10 29
3.8718 10 23
0.14820
0.019400
0.0060402
In Figure 3, we are comparing the exact results with Eulers method (Runge-Kutta 1st order
method), Heuns method (Runge-Kutta 2nd order method) and Runge-Kutta 4th order method.
08.04.6
Chapter 08.04