You are on page 1of 5

Chapter 08.

03
Runge-Kutta 2nd 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 2nd 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
3 .69 10 2 .33 10 1.35 10 2
33
f t, 5 .33 10 6
2

5
.
42

10

5
.
588

Per Heuns method


1
1
i 1 i k1 k 2 h
2
2
k1 f t i , i
k 2 f t i h, i k1 h
For i 0, t 0 0, 0 27
k1 f t 0 , 0
k1 f 0,27
6

27 4 2.33 10 5 27 3
6 3.69 10

27 33
5.33 10
1.35 10 3 27 2 5.42 10 2 27 5.588

0.0020893
k 2 f t 0 h, 0 k1 h

08.03.1

08.03.2

Chapter 08.03
f 0 43200,27 0.002089343200
f 43200,63.278

4
3
6
5

6 3.69 10 63.278 2.33 10 63.278

63.278 33
5.33 10
1.35 10 3 63.2782 5.42 10 2 63.278 5.588

0.0092607
1
1
1 0 k1 k 2 h
2
2
1
1

27 0.0020893 0.0092607 43200


2
2

27 0.0056750 43200
218.16 C
1 is the approximate temperature at
t t1 t 0 h 0 43200 43200 s

43200 1 218.16 C
For i 1, t1 43200, 1 218.16
k1 f t1 , 1
f 43200,218.16

218.164 2.33 10 5 218.163


6 3.69 10

218.16 33
5.33 10
1.35 10 3 218.16 2 5.42 10 2 218.16 5.588

8.4304
k 2 f t1 h, 1 k1 h
f 43200 43200,218.16 8.4304 43200
f 86400,364410
6

3644104 2.33 10 5 3644103


6 3.69 10

364410 33
5.33 10
1.35 10 3 364410 2 5.42 10 2 364410 5.588

17
1.2638 10
1
1
2 1 k1 k 2 h
2
2
1
1

218.16 8.4304 1.2638 1017 43200


2
2

16
218.16 6.3190 10 43200

2.7298 10 C
21

2 is the approximate temperature at

Runge-Kutta 2nd Order Method for ODE-More Examples: Mechanical Engineering 08.03.3
t t 2 t1 h 43200 43200 86400 s

86400 2 2.7298 10 21 C

The solution to this nonlinear equation at t 86400 s is


(86400) 26.099 C
The results from Heuns method are compared with exact results in Figure 1.

Figure 1 Heuns method results for different step sizes.

Using smaller step size would increases the accuracy of the result as given in Table 1 and
Figure 2 below.
Table 1 Effect of step size for Heuns method.
Step size, h
86400
Et
t %
86400
43200
21600
10800
5400

58466
2.7298 10 21
24.537
25.785
26.027

58440
2.7298 10 21
1.5619
0.31368
0.072214

223920
1.0460 10 22
5.9845
1.2019
0.27670

08.03.4

Chapter 08.03

Figure 2 Effect of step size in Heuns method.

In Table 2, the Eulers method and Runge-Kutta 2nd order method results are shown as a
function of step size.
Table 2 Comparison of Euler and the Runge-Kutta methods.
Step size,
(86400)
h
Euler
Heun
Midpoint
Ralston
86400
153.52
58466
774.64
12163
21
43200
0.33691
464.32
19.776
2.7298 10
21600

24.069
29.541
24.268
24.537
10800

25.808
27.795
25.777
25.785
5400
26.039
26.958
26.032
26.027

While in Figure 3, the comparison is shown over the range of time.

Runge-Kutta 2nd Order Method for ODE-More Examples: Mechanical Engineering 08.03.5

Figure 3 Comparison of Euler and Runge Kutta methods with exact results
over time.

You might also like