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

CHAPTER 12         PARTIAL DIFFERENTIAL EOUATIONS                    27 1




                                                                                 (1 2-23)

               and the forward difference formula for dFldy

                                                                                 (1 2-24)

                   When these  are substituted  into equation  12-22, we  obtain  equation  12-25,
               where  r  = Ay/(~l(hx)~). (Using  forward  and  central  differences  simplifies  the
               expression.)
                                    F,,/+I  = f.(F,+l,/  + F,-l,/  ) + 0 - rk,/   (1 2-25)
               Or, when i represents distance x andj represents time t,

                                    Fx,t+l = r(Fx+,,, + Fx-l,, 1 + 0 - r)Fx,t   (12-25a)
                   Equation  12-25a permits us to calculate the value of the function at time t+l
               based  on  values at time  t.  This  is  illustrated  graphically  by the  stencil  of  the
               method.















                                         -1           0            1
                                                      X

                    Figure 12-4.  Stencil of the explicit method for the solution of a parabolic PDE.
                      The points shown as solid squares represent previously calculated values
                        of the function; the open square represents the value to be calculated.

                   An alternative to the use of equation 12-25 is to choose hx and Ay such that r
                = 0.5 (e.g.,  for a given value  of Ax, Ay  = k(A~)~/2), that equation  12-25 is
                                                                 so
                simplified to

                                                                                 ( 12-26)
   289   290   291   292   293   294   295   296   297   298   299