Python code for gauss seidel method

broken image
broken image

Then collect the x ( k+1) terms on the left hand side to get We can multiply both sides by matrix D and divide both sides by ω to rewrite this as Notice that if ω = 1 then this is the Gauss-Seidel Method. The idea of the SOR Method is to iterateĪnd where generally 1 < ω < 2. As suggested above, it turns out that convergence x ( k) x of the sequence of approximate solutions to the true solution is often faster if we go beyond the standard Gauss-Seidel correction.

broken image

Now think of this as the Gauss-Seidel correction ( x ( k+1) − x ( k)) GS. We can subtract x ( k) from both sides to get First, notice that we can write the Gauss-Seidel equation as Here is how we derive the SOR Method from the Gauss-Seidel Method. This direction is the vector x ( k+1) − x ( k), since x ( k+1) = x ( k) + ( x ( k+1) − x ( k)). If we assume that the direction from x ( k) to x ( k+1) is taking us closer, but not all the way, to the true solution x, then it would make sense to move in the same direction x ( k+1) − x ( k), but farther along that direction. Here is the idea:įor any iterative method, in finding x ( k+1) from x ( k), we move a certain amount in a particular direction from x ( k) to x ( k+1).

broken image

A third iterative method, called the Successive Overrelaxation (SOR) Method, is a generalization of and improvement on the Gauss-Seidel Method.

broken image