function [u,k] = Richardson(A,b,u0,omega,prec,maxk)

u = u0;
r = b-A*u;
normr = norm(r);
normr0 = normr;
k = 0;

while normr/normr0 > prec  &&  k<maxk
    u = u + omega*r;
    normr_prev = normr;
    r = b - A*u;
    normr = norm(r);
%     normr/normr_prev, normr/normr0, pause
    k = k+1;
end
