Page 459 - Applied Numerical Methods Using MATLAB
P. 459

448    PARTIAL DIFFERENTIAL EQUATIONS
           9.3 Elliptic PDEs with Neumann Boundary Condition
               Consider the PDE (E9.1.1) (dealt with in Example 9.1)

                     2
                               2
                   ∂ u(x, y)  ∂ u(x, y)
                            +          = 0    for 0 ≤ x ≤ 4, 0 ≤ y ≤ 4  (P9.3.1)
                      ∂x 2       ∂y 2
               with different boundary conditions of Neumann type, which was discussed
               in Section 9.1. Modify the routine “poisson()” so that it can deal with the
               Neumann boundary condition and declare it as

               function [u,x,y] = poisson_Neuman(f,g,bx0,bxf,by0,byf,x0,xf,y0,yf,...)


               where the third/fourth/fifth/sixth input arguments are supposed to carry the
               functions of
                                u(x 0 ,y)/u(x f ,y)/u(x, y 0 )/u(x, y f )


               or


                 ∂u(x, y)/∂x| x=x 0  /∂u(x, y)/∂x| x=x f  /∂u(x, y)/∂y| y=y 0  /∂u(x, y)/∂y| y=y f

               and the seventh/eighth/ninth/tenth input arguments are to carry x 0 /x f /y 0 /y f
               or [x 0 1]/[x f 1]/[y 0 ]/[y f 1] depending on whether each boundary condition
               is of Dirichlet or Neumann type. Use it to solve the PDE with the
               following boundary conditions and plot the solutions by using the MATLAB
               command “mesh()”. Divide the solution region (domain) into M x × M y =
               20 × 20 sections.

               (cf) You may refer to the related part of the program in the previous page.
                                                       y       4
               (a) ∂u(x, y)/∂x| x=0 =− cos y,  u(4,y) = e cos 4 − e cos y  (P9.3.2)
                                                              x
                                                     4
                    ∂u(x, y)/∂y| y=0 = cos x,  u(x, 4) = e cos x − e cos 4  (P9.3.3)
                             y
                                                                  4
                                                         y
               (b) u(0,y) = e − cos y, ∂u(x, y)/∂x| x=4 =−e sin 4 − e cos y(P9.3.4)
                                                        4
                                                                 x
                                    x
                    u(x, 0) = cos x − e , ∂u(x, y)/∂y| y=4 = e cos x + e sin 4 (P9.3.5)
                                                               4
                                                       y
               (c) ∂u(x, y)/∂x| x=0 =− cos y,  u(4,y) = e cos 4 − e cos y  (P9.3.6)
                                                         4
                                    x
                                                                  x
                    u(x, 0) = cos x − e ,  ∂u(x, y)/∂y      = e cos x + e sin 4 (P9.3.7)
                                                   y=4
                                                                 4
                            y
                                                         y
               (d) u(0,y) = e − cos y, ∂u(x, y)/∂x       =−e sin 4 − e cos y(P9.3.8)
                                                 x=4
                                                      4        x
                   ∂u(x, y)/∂y     = cos x,  u(x, 4) = e cos x − e cos 4  (P9.3.9)
                              y=0
   454   455   456   457   458   459   460   461   462   463   464