Page 235 - Excel for Scientists and Engineers: Numerical Methods
P. 235
212 EXCEL: NUMERICAL METHODS
Figure 9-15. A custom function for the Newton method for nonlinear equations.
(folder 'Chapter 09 Simultaneous Equations', workbook NonLinNewton', sheet 'Figure 9-16')
The custom function was entered in cells GI 1 :GI4 as an array formula:
{=SirnultEqNL(Ell:E14,All:D11 ,FII:F14)}
and returned the values of the variables w, x, y and z shown in Figure 9-15. You
can confirm for yourself that this set of results satisfies the set of equations by
entering the results in the four variables cells and see that the values in the
"Equations" cells agree with the values in the "Constants" cells.
The custom function can be entered in the Variables'' cells so that the
"Results" appear there. This creates a circular reference, so you must check the
iteration box in Tools+Options-,Calculation.
Again, be aware that attempting to solve large systems of equations, or even
small sets of ill-conditioned equations, can lead to erroneous results.