entertainmentmdf.blogg.se

Gauss seidel method in python cODE
Gauss seidel method in python cODE













gauss seidel method in python cODE

However, because this is quite a bit more complicated, we do not derive these expressions here. So optimal convergence is achieved by choosing a value of ω that minimizesĪs we did earlier for the Jacobi and Gauss-Seidel Methods, we can find the eigenvalues and eigenvectors for the 2 x 2 SOR Method B matrix. The iteration matrix B that determines convergence of the SOR Method is Notice that the SOR Method is also of the form x = B x +, so the general convergence analysis on page 6 also applies to the SOR Method, as does the more specific analysis on page 7 for the Jacobi and Gauss-Seidel Methods. Then collect the x ( k+1) terms on the left hand side to get

gauss seidel method in python cODE

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.

gauss seidel method in python cODE

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

gauss seidel method in python cODE

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). A third iterative method, called the Successive Overrelaxation (SOR) Method, is a generalization of and improvement on the Gauss-Seidel Method.















Gauss seidel method in python cODE