Mws Gen Ode Ppt Runge4th

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

Transcript of Mws Gen Ode Ppt Runge4th

Page 1: Mws Gen Ode Ppt Runge4th

05/03/23http://

numericalmethods.eng.usf.edu 1

Runge 4th Order Method

Major: All Engineering Majors

Authors: Autar Kaw, Charlie Barker

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

Undergraduates

Page 2: Mws Gen Ode Ppt Runge4th

Runge-Kutta 4th Order Method

http://numericalmethods.eng.usf.edu

Page 3: Mws Gen Ode Ppt Runge4th

http://numericalmethods.eng.usf.edu3

Runge-Kutta 4th Order Method

where hkkkkyy ii 43211 22

61

ii yxfk ,1

hkyhxfk ii 12 2

1,21

hkyhxfk ii 23 2

1,21

hkyhxfk ii 34 ,

For0)0(),,( yyyxf

dxdy

Runge Kutta 4th order method is given by

Page 4: Mws Gen Ode Ppt Runge4th

http://numericalmethods.eng.usf.edu4

How to write Ordinary Differential Equation

Example

50,3.12 yeydxdy x

is rewritten as

50,23.1 yyedxdy x

In this case

yeyxf x 23.1,

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

yxfdxdy ,

Page 5: Mws Gen Ode Ppt Runge4th

http://numericalmethods.eng.usf.edu5

ExampleA 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

Kdtd 12000,1081102067.2 8412

Find the temperature at 480t seconds using Runge-Kutta 4th order method.

240h seconds.

8412 1081102067.2

dtd

8412 1081102067.2, tf

Assume a step size of

hkkkkii 43211 2261

Page 6: Mws Gen Ode Ppt Runge4th

http://numericalmethods.eng.usf.edu6

SolutionStep 1: 1200)0(,0,0 00 ti

5579.410811200102067.21200,0, 841201 ftfk o

38347.0108105.653102067.205.653,120

2405579.4211200,240

210

21,

21

8412

1002

f

fhkhtfk

8954.310810.1154102067.20.1154,120

24038347.0211200,240

210

21,

21

8412

2003

f

fhkhtfk

0069750.0108110.265102067.210.265,240

240984.31200,2400,8412

3004

f

fhkhtfk

Page 7: Mws Gen Ode Ppt Runge4th

http://numericalmethods.eng.usf.edu7

Solution Cont

1 is the approximate temperature at

240240001 httt

K65.675240 1

K

hkkkk

65.675

2401848.2611200

240069750.08954.3238347.025579.4611200

2261

432101

Page 8: Mws Gen Ode Ppt Runge4th

http://numericalmethods.eng.usf.edu8

Solution ContStep 2: Kti 65.675,240,1 11

44199.0108165.675102067.265.675,240, 8412111 ftfk

31372.0108161.622102067.261.622,360

24044199.02165.675,240

21240

21,

21

8412

1112

f

fhkhtfk

34775.0108100.638102067.200.638,360

24031372.02165.675,240

21240

21,

21

8412

2113

f

fhkhtfk

25351.0108119.592102067.219.592,480

24034775.065.675,240240,8412

3114

f

fhkhtfk

Page 9: Mws Gen Ode Ppt Runge4th

http://numericalmethods.eng.usf.edu9

Solution Cont

is the approximate temperature at

48024024012 htt

K91.594480 2

K

hkkkk

91.594

2400184.26165.675

24025351.034775.0231372.0244199.06165.675

2261

432112

Page 10: Mws Gen Ode Ppt Runge4th

http://numericalmethods.eng.usf.edu10

Solution Cont

The exact solution of the ordinary differential equation is given by the solution of a non-linear equation as

9282.21022067.000333.0tan8519.1300300ln92593.0 31

t

The solution to this nonlinear equation at t=480 seconds is

K57.647)480(

Page 11: Mws Gen Ode Ppt Runge4th

http://numericalmethods.eng.usf.edu11

Comparison with exact results

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

-400

0

400

800

1200

1600

0 200 400 600

Time,t(sec)

Tem

pera

ture

,

h=120Exact

h=240

h=480

θ(K

)

Page 12: Mws Gen Ode Ppt Runge4th

Step size, h (480) Et |єt|%

4802401206030

−90.278594.91646.16647.54647.57

737.8552.6601.4122

0.0336260.00086900

113.948.1319

0.218070.0051926

0.00013419

http://numericalmethods.eng.usf.edu12

Effect of step sizeTable 1. Temperature at 480 seconds as a function of step size, h

K57.647)480( (exact)

Page 13: Mws Gen Ode Ppt Runge4th

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

-200

0

200

400

600

800

0 100 200 300 400 500

Step size, h

Tem

pera

ture

,θ(48

0)

Page 14: Mws Gen Ode Ppt Runge4th

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.

0

200

400

600

800

1000

1200

1400

0 100 200 300 400 500

Time, t(sec)

Tem

pera

ture

,θ(

K)

Exact

4th order

Heun

Euler

Page 15: Mws Gen Ode Ppt Runge4th

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

Page 16: Mws Gen Ode Ppt Runge4th

THE END

http://numericalmethods.eng.usf.edu