Page 468 - Applied Numerical Methods Using MATLAB
P. 468

PROBLEMS   457
                   the mesh is nonadaptively refined every time you click ‘Refine Mesh’
                   in the Mesh pull-down menu. You can restore the previous mesh by
                   clicking ‘Undo Mesh Change’ in the Mesh pull-down menu.
               (b) Consider the PDE
                      2
                                 2
                     ∂ u(x, y)  ∂ u(x, y)
                              +          = 0    for 0 ≤ x ≤ 4, 0 ≤ y ≤ 4  (P9.8.4)
                        ∂x 2      ∂y 2
                   with the Dirichlet/Neumann boundary conditions
                             y
                                                         y
                                                                 4
                   u(0,y) = e − cos y, ∂u(x, y)/∂x| x=4 =−e sin 4 − e cos y (P9.8.5)
                                                                  x
                                                         4
                   ∂u(x, y)/∂y| y=0 =cos x, ∂u(x, y)/∂y| y=4 =e cos x + e sin 4 (P9.8.6)
                   Noting that the true analytical solution is
                                                       x
                                              y
                                     u(x, y) = e cos x − e cos y        (P9.8.7)
                   use the PDEtool to solve this PDE and fill in Table P9.8.2 with the
                   maximum absolute error and the number of nodes together with those of
                   Problem 9.3(g) for comparison.
               (c) Consider the PDE
                        2
                       ∂ u(x, t)  ∂u(x, t)
                      2        =            for 0 ≤ x ≤ π,  0 ≤ t ≤ 0.2  (P9.8.8)
                         ∂x 2       ∂t
                   with the initial/boundary conditions

                        u(x, 0) = sin(2x),  u(0,t) = 0,   u(π, t) = 0   (P9.8.9)

                   Noting that the true analytical solution is
                                        u(x, t) = sin(2x)e −8t         (P9.8.10)




                   Table P9.8.2 The Maximum Absolute Error and the Number of Nodes
                                                     The Maximum     The Number
                                                     Absolute Error    of Nodes

                   poisson()                            0.2005         21 × 21
                   PDEtool with Initialize Mesh         0.5702           177
                   PDEtool with Refine Mesh
                   PDEtool with second Refine Mesh
                   PDEtool with Adaptive Mesh
                   PDEtool with second Adaptive Mesh
   463   464   465   466   467   468   469   470   471   472   473