% FIGURE 5.3.3
%                              BREAK POINTS ARE XPTS(K), K=1,N+1
%                              UNKNOWNS ARE A(I), I=1,M
      global N XPTS M A OMEGA LOCATE
      OMEGA = @OMEGA533; 
      LOCATE = @LOCATE533;
%                              N = NUMBER OF SUBINTERVALS
      N = 4;
%                              M = NUMBER OF UNKNOWNS
      M = 2*N;
%                              BREAK POINTS ARE XPTS(K), K=0,N
      for K=1:N+1
         XPTS(K) = (K-1)*pi/N;
      end
%                              INITIAL GUESS FOR NEWTON METHOD
      for I=1:M
         [HORS,K] = LOCATE533(I);
         if (HORS == 'H')
            A(I) = 0.5 - XPTS(K+1)/pi;
         else
            A(I) = -1.0/pi;
         end
      end
%                              DO ITMAX NEWTON ITERATIONS
      ITMAX = 15;
      for ITER=1:ITMAX
%                              CALCULATE F VECTOR AND JACOBIAN
         L = 3;
         for K=1:M
            F(K) = GAUSS(@FUNF533,K,0);
            for I=max(K-L,1):min(K+L,M);
               AJACOB(K,L+1+I-K) = GAUSS(@FUNJ533,K,I);
            end
         end
%                              SOLVE LINEAR SYSTEM USING BAND SOLVER
         DELTA = LBAND(AJACOB,F,M,L);
%                              UPDATE SOLUTION VECTOR
         for I=1:M
            A(I) = A(I)-DELTA(I);
         end
%                              CALCULATE MAXIMUM ERROR
         ERMAX = 0.0;
         for J=0:100;
            X = J*pi/100.0;
            ERR = abs(USOL(0,X) - sin(X+pi/6.0));
            ERMAX = max(ERMAX,ERR);
         end
         ITER
         ERMAX
      end
