Page 447 - Applied Numerical Methods Using MATLAB
P. 447

436    PARTIAL DIFFERENTIAL EQUATIONS
                the y-axis to [0 5] and [0 5], respectively, in the dialog box opened by
                clicking ‘Axes Limits’ in the Options pull-down menu. You can also click
                ‘Axes Equal’ in the Options pull-down menu to have the x axis and
                the y axis of equal scale so that a circle/square may not look like an
                ellipse/rectangle.
              1. Click the   button in the tool-bar and click-and-drag on the graphic
                region to create a rectangle of domain. Then, in the Object dialog box
                opened by double-clicking the rectangle, set the Left/Bottom/Width/Height
                to 0/0/4/4. In this case, you don’t have to construct a CSG model by
                editing the set formula, because the domain consists of a single object:
                a rectangle.
              2. Click the   button in the tool-bar and double-click each boundary seg-
                ment to specify the boundary condition as Eqs. (E9.7.2,3) in the boundary
                condition dialog box (see Fig. 9.13a).
              3. Open the PDE specification dialog box by clicking the PDE button in the
                tool-bar, check the box on the left of Elliptic as the type of PDE, and set
                its parameters in Eq. (E9.7.1) as depicted in Fig. 9.13b.
              4. Click the   button in the tool-bar to divide the domain into a number of
                triangular subdomains to get the triangular mesh as depicted in Fig. 9.13c.
                You can click the  button in the tool-bar to refine the mesh successively
                for better accuracy.
              5. Click the = button in the tool-bar to plot the solution in the form of two-
                dimensional graph with the value of u(x, y) shown in color.
              6. If you want to plot the solution in the form of a three-dimensional graph
                with the value of u(x, y) shown in height as well as color, check the box
                before Height on the far-left side of the Plot selection dialog box opened
                by clicking the  button in the tool-bar. If you want the mesh shown in
                the solution plot as Fig. 9.13d, check the box before Show mesh on the
                far-left and low side and click the Plot button at the bottom of the Plot
                selection dialog box (Fig. 9.12h). You can compare the result with that of
                Example 9.3 depicted in Fig. 9.4.
              7. If you have the true analytical solution

                                             y
                                                      x
                                   u(x, y) = e cos x − e cos y          (E9.7.4)
                and you want to plot the difference between the PDEtool (FEM) solution
                and the true analytical solution, change the entry ‘u’ into ‘user entry’ in the
                Color/Contour row and the Height row of the Property column and write
                ‘u-(exp(y).*cos(x)-exp(x).*cos(y))’ into the corresponding fields in
                the User entry column of the Plot selection dialog box opened by clicking
                the    button in the tool-bar and click the Plot button at the bottom of the
                dialog box.
   442   443   444   445   446   447   448   449   450   451   452