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

220                                        EXCEL NUMERICAL METHODS



               10-1 with  the  analytical  expression  for  the  concentration,  [A],  =   in
               column C.  At the end of approximately one half-life (seven cycles of calculation
               in  this  example),  the  error  has  already  increased  to  3.6%.  Accuracy  can  be
               increased  by  decreasing  the  size  of At, but  only  at  the  expense  of  increased
               computation.  A much more efficient way of increasing the accuracy is by means
               of  a  series  expansion.  The Runge-Kutta  methods,  which  are  described  next,
               comprise the most commonly used approach.

               The Fourth-Order Runge-Kutta  Method
                   The Runge-Kutta  methods for numerical solution of the differential equation
               dyldx = F(x, y) involve,  in effect,  the evaluation  of the differential  function at
               intermediate  points  between  x,  and  x,,+~. The  value  of ynCl is  obtained  by
               appropriate summation of the intermediate terms in a single equation.  The most
               widely  used  Runge-Kutta  formula  involves  terms  evaluated  at x,,, x,+~/x/~ and
               x,,+~. The fourth-order Runge-Kutta equations for dyldx = F(x, y) are

                                               Ti  + 2Tz + 2T3 + T4
                                    Yn+l =Yn +                   Ax                (1 0-7)
                                                       6
               where


                                                                                  (1 0-9)


                                                    Ax
                                       T3  = F(x,+ --,yn+  -)                    (1 0-1 0)
                                                            T2
                                                    2        2
                                        T4  = F (xn + b, ~n  + T3)               (10-1  1)
                   If more than one variable appears in the expression, then each is corrected by
               using its own set of TI to T4  terms.


               Fourth-Order Runge-Kutta Method
               Implemented on a Worksheet

                   The  spreadsheet  in  Figure  10-2  illustrates  the  use  of  the  RK  method  to
               simulate the first-order kinetic process A + By again using  initial concentration
               [Ale = 0.2000 and rate constant k = 5 x   The differential equation is, again,
               equation  10-4.  This equation is of the simple form dyldx = F(y), and thus only
               they, terms of TI to T4  need to be evaluated.  The FK terms (note that  TI is the
               Euler method term) are shown in equations 10-12 through 10-15.
   238   239   240   241   242   243   244   245   246   247   248