1/16/2016 1 runge 4 th order method civil engineering majors authors: autar kaw, charlie barker

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

Upload: tamsyn-strickland

Post on 06-Jan-2018

215 views

Category:

Documents


0 download

DESCRIPTION

3 Runge-Kutta 4 th Order Method where For Runge Kutta 4 th order method is given by

TRANSCRIPT

Page 1: 1/16/2016  1 Runge 4 th Order Method Civil Engineering Majors Authors: Autar Kaw, Charlie Barker

05/03/23http://

numericalmethods.eng.usf.edu 1

Runge 4th Order Method

Civil Engineering Majors

Authors: Autar Kaw, Charlie Barker

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

Undergraduates

Page 2: 1/16/2016  1 Runge 4 th Order Method Civil Engineering Majors Authors: Autar Kaw, Charlie Barker

Runge-Kutta 4th Order Method

http://numericalmethods.eng.usf.edu

Page 3: 1/16/2016  1 Runge 4 th Order Method Civil Engineering Majors Authors: Autar Kaw, Charlie Barker

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: 1/16/2016  1 Runge 4 th Order Method Civil Engineering Majors Authors: Autar Kaw, Charlie Barker

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: 1/16/2016  1 Runge 4 th Order Method Civil Engineering Majors Authors: Autar Kaw, Charlie Barker

http://numericalmethods.eng.usf.edu5

ExampleA polluted lake with an initial concentration of a bacteria is 107 parts/m3, while the acceptable level is only 5x106 parts/m3. The concentration of the bacteria will reduce as fresh water enters the lake. The differential equation that governs the concentration C of the pollutant as a function of time (in weeks) is given by

710)0(,006.0 CCdtdC

Find the concentration of the pollutant after 7 weeks. Take a step size of 3.5 weeks.

CdtdC 06.0

CCtf 06.0,

hkkkkCC ii 43211 2261

Page 6: 1/16/2016  1 Runge 4 th Order Method Civil Engineering Majors Authors: Autar Kaw, Charlie Barker

http://numericalmethods.eng.usf.edu6

SolutionStep 1:

3700 /10,0,0 mpartsCti

6000001006.010,0, 77001 fCtfk

537000895000006.08950000,75.1

5.36000002110,5.3

210

21,

21 7

1002

f

fhkChtfk

543620906030006.09060300,75.1

5.35370002110,5.3

210

21,

21 7

2003

f

fhkChtfk

485840809730006.08097300,75.1

5.354362010,5.30, 73004

ffhkChtfk

Page 7: 1/16/2016  1 Runge 4 th Order Method Civil Engineering Majors Authors: Autar Kaw, Charlie Barker

http://numericalmethods.eng.usf.edu7

Solution Cont

is the approximate concentration of bacteria at 1C

weeks5.35.3001 httt

361 parts/m101059.85.3 CC

6

7

7

432101

101059.8

5.332471006110

5.3485840543620253700026000006110

2261

kkkkCC

Page 8: 1/16/2016  1 Runge 4 th Order Method Civil Engineering Majors Authors: Autar Kaw, Charlie Barker

http://numericalmethods.eng.usf.edu8

Solution ContStep 2: 6

11 101059.8,5.3,1 Cti

486350101059.806.0101059.8,5.3, 66111 fCtfk

435290725480006.07254800,25.5

5.3486350218105900,5.3

215.3

21,

21

1112

f

fhkChtfk

440648734410006.07344100,25.5

5.3435290218105900,5.3

215.3

21,

21

2113

f

fhkChtfk

393820656360006.06563600,7

5.34406488105900,5.35.3, 3114

ffhkChtfk

Page 9: 1/16/2016  1 Runge 4 th Order Method Civil Engineering Majors Authors: Autar Kaw, Charlie Barker

http://numericalmethods.eng.usf.edu9

Solution Cont

36

432112

parts/m105705.6

5.32632000618105900

5.33982044064824352902484350618105900

)22(61

hkkkkCC

is the approximate concentration of bacteria at 2C

weekshtt 75.35.312

362 parts/m105705.67 CC

Page 10: 1/16/2016  1 Runge 4 th Order Method Civil Engineering Majors Authors: Autar Kaw, Charlie Barker

http://numericalmethods.eng.usf.edu10

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

The solution to this nonlinear equation at t=7 weeks is

503

7101)(t

etC

36 parts/m105705.6)7( C

Page 11: 1/16/2016  1 Runge 4 th Order Method Civil Engineering Majors Authors: Autar Kaw, Charlie Barker

http://numericalmethods.eng.usf.edu11

Comparison with exact results

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

Page 12: 1/16/2016  1 Runge 4 th Order Method Civil Engineering Majors Authors: Autar Kaw, Charlie Barker

Step size

73.51.75

0.8750.4375

6.5715×106

6.5705×106

6.5705×106

6.5705×106

6.5705×106

−1017.2−53.301−3.0512

−0.18252−0.011161

0.0154818.1121×10−4

4.6438×10−5

2.7779×10−6

1.6986×10−7

http://numericalmethods.eng.usf.edu12

Effect of step size

h tE %|| t

(exact)6105705.6)7( C

7C

Table 1 Value of concentration of bacteria at 3 minutes for different step sizes

Page 13: 1/16/2016  1 Runge 4 th Order Method Civil Engineering Majors Authors: Autar Kaw, Charlie Barker

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

Page 14: 1/16/2016  1 Runge 4 th Order Method Civil Engineering Majors Authors: Autar Kaw, Charlie Barker

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.

Page 15: 1/16/2016  1 Runge 4 th Order Method Civil Engineering Majors Authors: Autar Kaw, Charlie Barker

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: 1/16/2016  1 Runge 4 th Order Method Civil Engineering Majors Authors: Autar Kaw, Charlie Barker

THE END

http://numericalmethods.eng.usf.edu