If a is None or NxM, where N != M - the functions returns None. a, the NxN matrix that the method is being performed on.
The algorithms will terminate when the change in x is less than tolerance, or if max_iter iterations have been exceeded.įor each function: (jacobi_calc() or gauss_seidel_calc())
Jacobi & Gauss-Seidel Algorithms Using Python The following methods solve the line system of equations, Ax=b,using Jacobi OR Gauss-Seidel algorithms, starting from an initial guess, x0.