% Solve Delta u =0 over the circular sector with % Dirichlet BC u = cos(2/3 atan(y,x)) along the arc % and u=0 along the straight lines theta = -3pi/4, 3pi/4. % The following commands solve the BVP by adaptive mesh refinement. [u,p,e,t]= adaptmesh('cirsg','cirsb',1,0,0,'maxt',500, ... 'tripick', 'pdeadworst', 'ngen', inf); x = p(1,:); y= p(2,:); % Compute the exact solution at the vertices exact = ((x.^2+y.^2).^(1/3).*cos(2/3*atan2(y,x)))'; maxerror = max(abs(u-exact)) % Compute the number of triangles in the mesh ntri = size(t,2) % Plot the mesh pdemesh(p,e,t)