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

CHAPTER 12         PARTIAL DIFFERENTIAL EQUATIONS                    265



               specified  around  a  closed  boundary,  the  equation  describes  a  steady-state
               condition.

               Solving Elliptic Partial Differential Equations:
               Replacing Derivatives with Finite Differences
                   In Chapter 6 we used the following approximation for a derivative
                                        dF(x) - F(x + h) - F(x)
                                        --                                        (12-5)
                                          dx           h
               where  h was  a  suitably  small value.  Equation  12-5 is the  forward  difference
               equation. The corresponding backward difference equation is
                                        dF(x) - F(x) - F(x - h)
                                        --                                        ( 12-6)
                                          dx           h
                   For  a  partial  derivative  involving  two  independent  variables,  the  finite
               difference equation will  involve suitable small differences in both x and y.  We
               will  use  h  and  k  to  represent  these  differences.  The  forward  and  backward
               difference equations corresponding to 12-5 and 12-6 are
                                     dF(x, Y) - F(x + h, Y) - F(x, Y)             ( 12-7)
                                              -
                                        dx              h
                                     dm, r) - F(x, Y) - F(x - h, Y)               (1 2-8)
                                              -
                                        dx              h
                and, for the partial derivative
                                               dF(x + h, Y) - dF(x, Y)
                                             -
                                   a2F(x,Y) -      dx          dx                 (1 2-9)
                                      ax2                h
                Since we have used the forward difference equation  12-9 to calculate the partial
                derivative, we can use backward differences for dF/dx in order to eliminate bias.
                The result is
                                               h,
                                              +
                                                                     h,
                              awx, Y) - ~(x Y) - WX,  Y) + ~(x Y)                (12-10)
                                        -
                                                                   -
                                 ax2                    h2
                and in a similar fashion,
                              a2m, Y) - F(x, Y + k) - 2J-k Y) + F(x, Y - k)      (12-1 1)
                                       -
                                 au2                    k2
                and
                           d2F(x,y) - F(x + h,y + k) - 2F(x,y) + F(x - h,y - k)   (1 2- 12)
                                    -
                             axay                       hk
   283   284   285   286   287   288   289   290   291   292   293