function Feb18()
% If  A = [a b;c d], then L = [0 0;c 0], D = [a 0 ; 0 d], U = [0 b;0 0];
% then for Gauss Seidel, the iteration  matrix 
%    G = -inv(D+L)*U = -[1/a  0 ; -c/(ad) 1/d]*[0 b; 0 0] 
%      = -[0 b/a; 0 -bc/(ad)]
% This has eigenvalues 0 and (bc)/(ad). So we must have |bc|<|ad| for
% Gauss-Seidel converges.
%
format long
A = [2 3; 4 8];
% The spectal radius of G is .75.
b = A*[1;1];
x0 = [0;0];
x = x0;
for k=1:100
    x(1) = (b(1) - A(1,2)*x(2))/A(1,1);
    x(2) = (b(2) - A(2,1)*x(1))/A(2,2);
    home
    k = k
    x = x
    pause(.2)
end
    