Page 188 - Excel for Scientists and Engineers: Numerical Methods
P. 188

CHAPTER 8                ROOTS OF EOUATIONS                          165























                                                    X
                  Figure 8-25.  Root of a function returned by the Newton-Raphson custom function.
                 (folder 'Chapter 08 Examples', workbook 'Newton-Raphson Function', sheet 'Newton-Raphson')
                   To  use  the  custom  function,  enter  the  function  in  cell  C7  by  typing  it
               following  the  syntax  above,  or  choose  Insert-+Function.. ., choose  the  User
               Defined category and choose the function from the list box.  For the expression
               argument, enter a reference to a cell containing the worksheet function (e.g., cell
                87 in Figure 8-26).  For the variable argument, enter A7, the cell reference of the
                independent variable in the formula expression. If you do not enter a value for
               the optional inifial_value argument, the value of the independent variable will be
                used  as the  starting value.  When  you  press  ENTER,  a  root  of the function  is
               returned, as shown in Figure 8-26.













                  Figure 8-26.  Root of a function returned by the Newton-Raphson custom function.
                 (folder 'Chapter 08 Examples', workbook 'Newton-Raphson Function', sheet 'Newton-Raphson')
                   The root  that  is returned  depends  on  the  initial  or trial  value  used  by  the
               Newton-Raphson  procedure.  In this example, if a relatively large negative value
                is used (e.g., -7),  the root near -5  will be obtained.  (See Figure 8-10 if this is not
                clear.)  Some caution must  be  exercised in  choosing a trial  value to  direct the
   183   184   185   186   187   188   189   190   191   192   193