Page 279 - Excel for Scientists and Engineers: Numerical Methods
P. 279
256 EXCEL: NUMERICAL METHODS
It is important to remember that the formulas for the first and last terms of
the constants vector are different. The formula in cells G10:G16 is
= hA2*b b*x+ hA2*cc
while the formulas in cells G9 and GI 7 are, respectively,
=h"2*bb*x+ hA2*cc-B8
and
=h"2*bb*x+hA2*cc-BI 6.
Be careful not to Fill Down the wrong formula when constructing a worksheet.
Figure 11-10. Portion of the spreadsheet to solve the second-order differential equation
y" - (0.15 - x/2.3)y = x by using the finite-difference method.
(folder 'Chapter 1 1 Examples', workbook 'ODE-BVP', worksheet 'Finite Difference 1')
The coefficients matrix (Figure 11-11) was assembled from the values in
columns F and G by entering the formula
I
=IF( ROW()-top=COLU MN()-left, INDIRECT("F"&ROW()), F(ABS(( ROW()-top)
-(COLUMN()-left))=l, 1 ,O))
in cell 19 and filling the formula into the 9 x 9 matrix of cells 18:Q16 to produce
the matrix shown in Figure 11-1 1. The cell 19 was assigned the name TopCell