Page 446 - Applied Numerical Methods Using MATLAB
P. 446

GUI OF MATLAB FOR SOLVING PDES: PDETOOL  435
              6. In Plot mode, you can change the plot option in the Plot selection dialog
                 box opened by clicking the  button in the tool-bar or ‘Parameters’ in
                 the Plot pull-down menu (Fig. 9.12g). In the Plot selection dialog box
                 (Fig. 9.12h), you can set the plot type to, say, Color/Height(3-D) and set
                 the plot style to, say, interpolated shading and continuous (interpolated)
                 height. If you want the mesh to be shown in the solution graph, check
                 the box of Show mesh. In case you want to plot the graph of a known
                 function, change the option(s) of the Property into ‘user entry’, type in the
                 MATLAB expression describing the function and click the Plot button. You
                 can save the plot parameters as the current default by clicking the Done
                 button. You can also change the color map in the second line from the
                 bottom of the dialog box.

            (cf) We can extract the parameters involved in the domain geometry by clicking ‘Export..’
               in the Draw pull-down menu, the parameters specifying the boundary by clicking
               ‘Export..’ in the Boundary pull-down menu, the parameters specifying the PDE by
               clicking ‘Export..’ in the PDE pull-down menu, the parameters specifying the mesh
               by clicking ‘Export..’ in the Mesh pull-down menu, the parameters related to the
               solution by clicking ‘Export..’ in the Solve pull-down menu, and the parameters
               related to the graph by clicking ‘Export..’ in the Plot pull-down menu. Whenever
               you want to save what you have worked in PDEtool, you may select File/Save in
               the top menu-bar.
            (cf) Visit  the  website  “http://www.mathworks.com/access/helpdesk/help/helpdesk.
               html” for more details.


            9.5.3  Examples of Using PDETOOL to Solve PDEs
            In this section, we will make use of PDEtool to solve some PDE problems that
            were dealt with in the previous sections.

            Example 9.7. Laplace’s Equation: Steady-State Temperature Distribution Over
            a Plate. Consider the Laplace’s equation (Example 9.1)

                            2
                                       2
                           ∂ u(x, y)  ∂ u(x, y)
                 2
               ∇ u(x, y) =         +          = 0    for 0 ≤ x ≤ 4, 0 ≤ y ≤ 4
                             ∂x 2       ∂y 2
                                                                        (E9.7.1)
            with the following boundary conditions.
                                y
                                                      y
                                                               4
                      u(0,y) = e − cos y,    u(4,y) = e cos 4 − e cos y  (E9.7.2)
                                       x
                                                               x
                                                      4
                      u(x, 0) = cos x − e ,  u(x, 4) = e cos x − e cos 4  (E9.7.3)
              The procedure for using PDEtool to solve this problem is as follows:
              0. Type ‘pdetool’ into the MATLAB command window to have the PDE
                 toolbox window on the screen. Then, adjust the ranges of the x-axis and
   441   442   443   444   445   446   447   448   449   450   451