1. The problem statement, all variables and given/known data http://img184.imageshack.us/img184/8454/26645063th6.png [Broken] 2. Relevant equations The code Code (Text): u = [ 0 ;zeros(n-2,1); 0]; % this has to be zero. k = 0; r = b; %algoritme while k<100 z=inv(M)*r; k = k+1 if k==1 p = z; r_1 = b; z_1 = z; else beta = (r_1'*z_1)/(r_2'*z_2); p = z_1+ beta*p; end alpha = (r_1'*z_1)/(p'*A*p); u = u + alpha*p; r= r_1-alpha*A*p; r_2 = r_1; r_1 = r; z_2 = z_1; z_1 = z; end 3. The attempt at a solution Somewhere is a mistake in the code (aside the fact that A and b aren't shown), because it doesn't converge. But I can't find it. Can someone help me?