5/19/2015 1 runge 4 th order method mechanical engineering majors authors: autar kaw, charlie...

16
03/25/22 http:// numericalmethods.eng.usf.edu 1 Runge 4 th Order Method Mechanical Engineering Majors Authors: Autar Kaw, Charlie Barker http://numericalmethods.eng.u sf.edu Transforming Numerical Methods Education for STEM Undergraduates

Upload: reynold-stewart

Post on 18-Dec-2015

217 views

Category:

Documents


0 download

TRANSCRIPT

04/18/23http://

numericalmethods.eng.usf.edu 1

Runge 4th Order Method

Mechanical Engineering Majors

Authors: Autar Kaw, Charlie Barker

http://numericalmethods.eng.usf.eduTransforming Numerical Methods Education for STEM

Undergraduates

Runge-Kutta 4th Order Method

http://numericalmethods.eng.usf.edu

http://numericalmethods.eng.usf.edu3

Runge-Kutta 4th Order Method

where

hkkkkyy ii 43211 226

1

ii yxfk ,1

hkyhxfk ii 12 2

1,

2

1

hkyhxfk ii 23 2

1,

2

1

hkyhxfk ii 34 ,

For0)0(),,( yyyxf

dx

dy

Runge Kutta 4th order method is given by

http://numericalmethods.eng.usf.edu4

How to write Ordinary Differential Equation

Example

50,3.12 yeydx

dy x

is rewritten as

50,23.1 yyedx

dy x

In this case

yeyxf x 23.1,

How does one write a first order differential equation in the form of

yxfdx

dy,

http://numericalmethods.eng.usf.edu5

ExampleA solid steel shaft at room temperature of 27°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°C. The rate of change of temperature of the solid shaft is given by

33588510425

1035110332106931033.5

2

2335466

θ

.θ.

θ.θ.θ.

dt

Cθ 270Find the temperature of the steel shaft after 24 hours. Take a step size of h=43200 seconds.

33588510425

1035110332106931033.5

2

2335466

θ

.θ.

θ.θ.θ.

dt

33588510425

1035110332106931033.5

2

2335466

θ

.θ.

θ.θ.θ.t,θf

hkkkkii 43211 226

1

http://numericalmethods.eng.usf.edu6

SolutionStep 1: Cti 27,0,0 00

0020893.03327588.5271042.5271035.1

271033.2271069.31033.527,0,

223

35466

001

ftfk

00035761.033129.18588.5129.181042.5129.181035.1

129.181033.2129.181069.31033.5

129.18,21600432000020893.02

127,43200

2

10

2

1,

2

1

223

35466

1002

ffhkhtfk

0018924.033276.19588.5276.191042.5276.191035.1

276.191033.2276.191069.31033.5

276.19,216004320000035761.02

127,43200

2

10

2

1,

2

1

223

35466

2003

ffhkhtfk

0035147.033751.54588.5751.541042.5751.541035.1

751.541033.2751.541069.31033.5

751.54,43200432000018924.02

127,432000,

223

35466

3004

ffhkhtfk

http://numericalmethods.eng.usf.edu7

Solution Cont

1 is the approximate temperature at shttt 4320043200001

C

hkkkk

749.45

43200010104.06

127

432000035147.00018924.0200035761.020020893.06

127

)22(6

1432101

C 749.4543200 1

http://numericalmethods.eng.usf.edu8

Solution ContStep 2: 749.45,43200,1 11 ti

00084673.0

33749.45588.5749.451042.5749.451035.1

749.451033.2749.451069.31033.5749.45,43200,

223

35466

111

ftfk

010012.033038.64588.5038.641042.5038.641035.1

038.641033.2038.641069.31033.5

038.64,648004320000084673.02

1749.45,43200

2

143200

2

1,

2

1

223

35466

1112

ffhkhtfk

636.2133588.22588.501.2621042.501.2621035.1

01.2621033.201.2621069.31033.5

01.262,6480043200010012.02

1749.45,43200

2

143200

2

1,

2

1

223

35466

2113

ffhkhtfk

195

52253

3554566

53114

104035.133103474.9588.5103474.91042.5103474.91035.1

103474.91033.2103474.91069.31033.5

103474.9,8640043200636.21749.45,4320043200,

ffhkhtfk

http://numericalmethods.eng.usf.edu9

Solution Cont

2is the approximate temperature at 86400432004320012 htt

C

hkkkk

23

19

19

432112

100105.1

43200104035.16

1749.45

43200104035.1636.212010012.0200084673.06

1749.45

226

1

C 232 101015.186400

http://numericalmethods.eng.usf.edu10

Solution Cont

The solution to this nonlinear equation at t=86400s is

C 099.26)86400(

http://numericalmethods.eng.usf.edu11

Comparison with exact results

Figure 1. Comparison of Runge-Kutta 4th order method with exact solution

Step Size,

864004320021600108005400

−5.3468×1028

−1.0105×1023

−26.061−26.094−26.097

−5.2468×1028

−0.034808×1023

−0.038680−0.0050630−0.0015763

2.0487×1029

3.8718×1023

0.148200.0194000.0060402

http://numericalmethods.eng.usf.edu12

Effect of step size

h tE %|| t

(exact) C 099.2686400

Table 1. Value of temperature at 86400 seconds for different step sizes

86400

http://numericalmethods.eng.usf.edu13

Effects of step size on Runge-Kutta 4th Order Method

Figure 2. Effect of step size in Runge-Kutta 4th order method

http://numericalmethods.eng.usf.edu14

Comparison of Euler and Runge-Kutta Methods

Figure 3. Comparison of Runge-Kutta methods of 1st, 2nd, and 4th order.

Additional ResourcesFor all resources on this topic such as digital audiovisual lectures, primers, textbook chapters, multiple-choice tests, worksheets in MATLAB, MATHEMATICA, MathCad and MAPLE, blogs, related physical problems, please visit

http://numericalmethods.eng.usf.edu/topics/runge_kutta_4th_method.html

THE END

http://numericalmethods.eng.usf.edu