Page 246 - Excel for Scientists and Engineers: Numerical Methods
P. 246
CHAPTER 10 ORDINARY DIFFERENTIAL EQUATIONS. PART I 223
=-k*( C_t+TA3)*DX
= C-t+ (TA 1 +2 *TA2 +2*TA3 +TA4)/6
and cell 87 contains the formula =G6.
Fourth-Order Runge-Kutta Method
Applied to a Differential Equation
Involving Both x and y
In the preceding examples, the differential equation involved only the
dependent variable y. In the general case, the differential equation can be a
function of both x and y. The following example illustrates the use of the Runge-
Kutta method for dyldx = F(x, y).
A function is described by the differential equation
dyldx = 2x2 + 2y (1 0-1 6)
and the function has the value y = 0.5 at x = 0. We want to find the value of the
function over the range x = 0 to x = 1. Figure 10-4 illustrates the use of the RK
method to model the function. The formulas for the TI-T~ terms, in cells B11 to
El 1 are, respectively,
=2*A10A2+2*F10
=2*(A1 O+deltax/2)"2+2*(FI O+BI 1 *deltax/2)
F1
=2*(A1 O+delta~/2)~2+2*( O+C11 *deltax/2)
Figure 10-4. The fourth-order Runge-Kutta method applied toy' = 2x2+2y.
(folder 'Chapter 10 Examples', workbook 'ODE Examples', worksheet 'Both x and y (Formulas)')