% FIGURE 5.4.2
%                              BREAK POINTS ARE XPTS(K), K=1,N+1
%                              UNKNOWNS ARE A(I), I=1,M
      global N XPTS M A OMEGA LOCATE
      OMEGA = @OMEGA542;
      LOCATE = @LOCATE542;
%                              N = NUMBER OF SUBINTERVALS
      N = 4;
%                              M = NUMBER OF UNKNOWNS
      M = 2*N;
      ALPHA = 3.636;
      for K=1:N+1
         XPTS(K) = ((K-1)/N)^ALPHA;
      end
%                              CALCULATE RIGHT HAND SIDE VECTOR AND
%                              COEFFICIENT MATRIX
      BETA(1) = 0.5 - 0.5/sqrt(3.0);
      BETA(2) = 0.5 + 0.5/sqrt(3.0);
      L = 2;
      for LL=0:N-1
      for J=1:2
         K = 2*LL+J;
         ZK = XPTS(LL+1) + BETA(J)*(XPTS(LL+2)-XPTS(LL+1));
         B(K) = -OMEGA542(2,ZK) + 0.11*OMEGA542(0,ZK)/ZK^2;
         for I=max(K-L,1):min(K+L,M)
            AMAT(K,L+1+I-K) = PHI(I,2,ZK) - 0.11*PHI(I,0,ZK)/ZK^2;
         end
      end
      end
%                              SOLVE LINEAR SYSTEM USING BAND SOLVER
      A = LBAND(AMAT,B,M,L);
%                              CALCULATE MAXIMUM ERROR
      ERMAX = 0.0;
      for J=0:100
         X = J/100.0;
         ERR = abs(USOL(0,X) - X^1.1);
         ERMAX = max(ERMAX,ERR);
      end
      ERMAX
