You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
With Gauss-Seidel and Jacobi one can find solutions for Ax=b in an iterative way, it is very useful.
Preconditions for convergence to a solution should also be added, (checking if T=I−(N^−1)A, is dialgonally dominant, if any norm is < 1, if largest eigenvalues is <1).
Code
SciLab:
//Gauss-Seidel with relaxationfunction x = SOR(A, b, x0, vv, eps)
sz = size(A,1)
x = x0
xant = x
suma = 0
it = 1
cont = 0while(abs(norm(x-xant)) > eps | cont == 0)
xant = x
for i = 1:sz
suma = 0for j = 1:i-1
suma = suma + A(i,j)*x(j)
endfor j = i+1:sz
suma = suma + A(i,j)*x(j)
end
x(i) = (1 - vv)*xant(i) + vv/(A(i,i))*(b(i)-suma)
end
cont = cont + 1end
mprintf("Cantidad de iteraciones: %d\n",cont);
endfunctionfunction x = jacobisolver(A,b,x0,eps)
sz = size(A,1)
x = x0
xant = x
suma = 0//it = 1
cont = 0while(abs(norm(x-xant)) > eps | cont == 0)
xant = x
for i = 1:sz
suma = 0for j = 1:sz
if (i <> j)
suma = suma + A(i,j)*xant(j)
endend
x(i) = 1/(A(i,i))*(b(i)-suma)
end
cont = cont + 1end
mprintf("Cantidad de iteraciones: %d\n",cont);
endfunction
This chapter can be added to the Master Overview (if it cannot be, explain why in a comment below -- lack of sufficient technical sources, not novel enough, too ambitious, etc.)
There is a timeline for when this chapter can be written
Chapter Request
Description
With Gauss-Seidel and Jacobi one can find solutions for Ax=b in an iterative way, it is very useful.
Preconditions for convergence to a solution should also be added, (checking if T=I−(N^−1)A, is dialgonally dominant, if any norm is < 1, if largest eigenvalues is <1).
Code
SciLab:
Python:
For Algorithm Archive Developers
The text was updated successfully, but these errors were encountered: