Sunteți pe pagina 1din 5

Chapter 08.03 Runge-Kutta 2nd Order Method for Ordinary Differential Equations-More Examples Mechanical Engineering

Example 1

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

A solid steel shaft at room temperature of 27 C

o

33

o

C

. The rate of change of temperature of the solid shaft is given by

dθ

dt



5 33

.

10

6

3 69

.

10

6

θ

5 42

.

4

10

2 33

.

2

θ

5

θ

10

5 588

.

3

1 35

.

10

3

θ

2

 

θ 33

θ027 C Using the Runge-Kutta 2 nd order method, find the temperature of the steel shaft after 86400 seconds. Take a step size of h 43200 seconds. Solution

dθ

dt



5 33

.

10

f



t, θ 

5 33

.

6

10

6

3 69

.

10

3 69

.

5 42

10

.

6

6

θ

4

10

θ

4

5 42

.

10

5 588

2 33

.

2

θ

10

2 33

.

2

θ

.

5

θ

10

5 588

.

5

θ

3

Per Heun’s method

For

i

i

1

i

1


2

k 1

k

k

0,

k

k 1 f 0,27

f

1

t ,

i

i

t

2

f

t

0

1 f

i

0,

t

0

,

h

i

0

,

0

27

1

k

2

2

k h

1


h

 

5.33

10

6

3.69

1.35

10

10

6

3

 4



27

27

2

2.33

5.42

10

10

5

2





27

27

 0.0020893

k

2

f

t

0

,

h

0

k h

1

08.03.1

1 35

.

10

3

1 35

.

3

θ

2

θ 33

10

3

θ

2

θ 33

3

5.588

27 33

08.03.2

Chapter 08.03

f 0 43200,27 0.002089343200f 43200,63.278

 

5.33

10

6

3.69

1.35

10

10

6

3

 4



63.278

63.278

2

2.33

5.42

10

10

5

2

1

 0.0092607

 

0

27

1

2

2

1

k

1

1

2

k

2

h

0.0020893

1

2

27 0.005675043200

 218.16 C

0.009260743200

1 is the approximate temperature at

For

i

t t

1

t

0

h

0 43200 43200 s

43200

1,

k

1

t

1

1



1

218.16 C

1



1

218.16

43200,

t ,

f

f 43200,218.16





63.278

63.278

3

5.588

 

k

2

5.33

10

6

10

1.35 10

3.69

6

3

 4



218.16

218.16

2

2.33

5.42

10

10

 8.4304

k h

f

t

1

,

h

1

f 43200 43200,218.16 8.430443200

f 86400,364410

1

5

2





218.16

218.16

3

5.588

 

5.33

10

6

 

1.35

3.69

10

10

6

3

 4



364410

364410

2

2.33

5.42

 1.263810

17

 

218.16

1 k

2 1

1

2

1



k

   1

2

2 2

h

8.4304

1

2

1.2638





218.16

2.7298

 6.3190

10

21

C

10 43200

16

10

17

10

10

5

2





364410

364410

43200

3

5.588

2

is the approximate temperature at

63.278

218.16

364410

33

33

33

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

t t

2

t

1

86400

h

43200 43200 86400 s



2

2.7298

10

21

C

08.03.3

The solution to this nonlinear equation at t 86400s is (86400)  26.099 C

The results from Heun’s method are compared with exact results in Figure 1.

Heun’s method are compared with exact results in Figure 1. Figure 1 Heun’s method results fo

Figure 1 Heun’s 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 Heun’s method.

Step size, h

86400

E

t

t

%

86400

58466

58440

223920

 

43200

2.729810

21

2.729810

21

1.0460 10

22

21600

24.537

1.5619

5.9845

 

10800

25.785

0.31368

1.2019

5400

26.027

0.072214

0.27670

 

08.03.4

Chapter 08.03

08.03.4 Chapter 08.03 Figure 2 Effect of step size in Heun’s method. In Table 2, the

Figure 2 Effect of step size in Heun’s method.

In Table 2, the Euler’s method and Runge-Kutta 2 nd 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

43200

464.32

2.7298 10

21

0.33691

19.776

21600

29.541

24.537

24.069

24.268

10800

27.795

25.785

25.808

25.777

5400

26.958

26.027

26.039

26.032

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

for ODE-More Examples: Mechanical Engineering 08.03.5 Figure 3 Comparison of Euler and Runge Kutta methods

Figure 3

Comparison of Euler and Runge Kutta methods with exact results

over time.