n = 64;
h = 1/64;
omega = 2/3;
sigma = 1;
d = ones(n-1,1);
D = spdiags([((2/h^2) + sigma)*d], 0, n-1, n-1);
LpU = spdiags([(1/h^2)*d 0*d (1/h^2)*d], -1:1, n-1, n-1);
xj = 1:n-1;
xj = xj/n;
k = input('input k \n');
v1 = (sin(k*pi*xj))';
v2 = (sin(k*pi*xj))';
for i = 1:100
    v1 = (D\(LpU*v1));
    s1(i) = norm(v1,inf);
    v2 = omega*(D\(LpU*v2)) + (1 - omega)*v2;
    s2(i) = norm(v2,inf);
end
clf
hold on
plot(s1,'red')
plot(s2,'blue')
