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

CHAPTER 8                ROOTS OF EQUATIONS                          169



               Equations 8-25 to 8-29 can be written in the form
                                                cn =o                             (8-30)

                                            cn-1  = b,, - PCn                     (8-3 1)

                                                                                  (8-32)





                                     cn-k  = bn-k  - Pcn-k+l - qcn-k+2            (8-33)
                                               co = -4c2                          (8-34)

                   The simultaneous equations to be solved are
                                                +
                                           C~AP C3Aq = -b,                        (8-35)
                                           C~AP  + CZAq = -bo                     (8-36)

                   Using Cramer's rule, we obtain



                                                                                  (8-3  7)








                                                                                  (8-38)



                   The procedure  for calculating the  roots therefore is as follows:  with  initial
                estimates of p  and q (zero or one can be used), calculate the values of b, and c,.
                Use these values to calculate Ap and Aq, and correct the initial values.  Continue
                until  convergence  is  reached.  Obtain  the  two  roots  by  use  of  the  quadratic
                formula.  Use  the  result  of  synthetic  division  of  the  polynomial  as the  new
                polynomial,  and  repeat  the process.  Continue until the  polynomial  is of order
                one or zero.
                   The  VBA  code  is  shown  in  Figure  8-28.  The  portion  of  the  code  that
                performs  the  Bairstow  calculation  is  based  on  code  found  in  Shoup,  T.  E.,
                Numerical Methods for the Personal Computer, Prentice-Hall,  1983.
   187   188   189   190   191   192   193   194   195   196   197