0% found this document useful (0 votes)
28 views12 pages

Numerical Solving in Excel, Unnarrated

This document discusses using the fourth-order Runge-Kutta method to solve systems of ordinary differential equations. It presents the RK4 method formulas and explains how to model an example system of ODEs in Excel using RK4. Graphs comparing the actual and RK4 solutions show the accumulation of error over time as the step size remains constant.

Uploaded by

faisal58650
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPT, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
28 views12 pages

Numerical Solving in Excel, Unnarrated

This document discusses using the fourth-order Runge-Kutta method to solve systems of ordinary differential equations. It presents the RK4 method formulas and explains how to model an example system of ODEs in Excel using RK4. Graphs comparing the actual and RK4 solutions show the accumulation of error over time as the step size remains constant.

Uploaded by

faisal58650
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPT, PDF, TXT or read online on Scribd
You are on page 1/ 12

Numerical Solving

ODEs in Excel
Solving a System of ODEs
Using the Runge-Kutta Method
Brought to You By Chris Mark and Katie Feldt

Fourth-Order Runge-Kutta: RK4


x' f (t , x, y )
y ' g (t , x, y )

x(t0 ) x0
y(t0 ) y0

h
xn 1 xn ( F1 2 F2 2 F3 F4 )
6
h
yn 1 yn (G1 2G2 2G3 G4 )
6

Fourth-Order Runge-Kutta: RK4


h
xn1 xn ( F1 2 F2 2 F3 F4 )
6

F1 f (tn , xn , yn )
F2 f (tn 1 h, xn
2
F3 f (tn 1 h, xn
2
F4 f (tn 1 h, xn
2

1 hF1 , yn 1 hG1 )
2
2
1 hF2 , yn 1 hG2 )
2
2
1 hF3 , yn 1 hG3 )
2
2

Fourth-Order Runge-Kutta: RK4


h
yn1 yn (G1 2G2 2G3 G4 )
6

G1 g (tn , xn , yn )
G2 g (tn 1 h, xn 1 hF1 , yn 1 hG1 )
2
2
2
G3 g (tn 1 h, xn 1 hF2 , yn 1 hG2 )
2
2
2
G4 g (tn 1 h, xn 1 hF3 , yn 1 hG3 )
2
2
2

Modeling in Excel: An Example


Example Problem
x = 3x 2y
y = 5x 4y

x(0) = 3
y(0) = 6

Known Solution

x 2e

2t

y 5e

2t

t
t

Edwards, C. Henry and David E. Penney. Differential Equations: Computing and Modeling, Third Edition. Upper Saddle River: Pearson Education, Inc., 2004. 266-268.

Modeling in Excel

F1 3xn 2 yn

Modeling in Excel

F2 3( xn 1 hF1 ) 2( yn 1 hG1 )
2
2

Modeling in Excel

F3 3( xn 1 hF2 ) 2( yn 1 hG2 )
2
2

Modeling in Excel

F4 3( xn 1 hF3 ) 2( yn 1 hG3 )
2
2

Modeling in Excel

h
xn1 xn ( F1 2 F2 2 F3 F4 )
6

Error Analysis
x

Actual vs. RK4 Method


160.00
140.00
120.00
100.00
80.00
60.00
40.00
20.00
0.00
0.00

t
x (actual)
x (RK4)

1.00

2.00

3.00

4.00

5.00

Actual vs. RK4 Method


160.00
140.00
120.00
100.00
80.00
60.00
40.00
20.00
0.00
0.00

y (actual)
y (RK4)

1.00

2.00

3.00
t

4.00

5.00

0.00
0.50
1.00
1.50
2.00
2.50
3.00
3.50
4.00
4.50
5.00

x error
0.00
0.14
0.17
0.26
0.50
0.99
1.94
3.70
6.90
12.70
23.08

y error
0.00
0.30
0.28
0.32
0.53
1.01
1.94
3.70
6.91
12.70
23.08

Thank you for tuning in!

You might also like