I've gotten the Jacobi method coded to solve the linear equations but the residual convergence is giving me problems.
Checking up some codes available online, they've done the convergence check using norm function, like this.
Code: Select all
while relerr > tol
relerr = norm( A*x-b,inf )/norm( b,inf );and my lecturer's info gives residual asnorm(x,inf) The infinity norm, or largest row sum of A, max(sum(abs(A')))
Code: Select all
r=abs(b-A*x)Code: Select all
while relerr > tol
relerr = abs(b-A*X(:,niter))
%niter =current iteration count, so the X(:,niter) picks up all the rows but only the last column with the most accurate iteration guesses.
