5.4 KB · commit a9602da
The iterative methods discussed in Section 9.4 can be applied to solve the finite-difference equations obtained in the preceding section. In the Crank–Nicolson method, the partial differential equation ∂t∂u=∂x2∂2u is replaced by the finite-difference equation (1+r)ui,j+1=ui,j+21r(ui−1,j+1+ui+1,j+ui+1,j+1+ui−1,j−2ui,j)(9.53) where r=k/h2.
In Eq. (9.53), the unknowns are ui,j+1, ui−1,j+1 and ui+1,j+1, and all others are known since they were already computed at the jth step. Hence, dropping the j's and setting ci=ui,j+21r(ui−1,j−2ui,j+ui+1,j)(9.54) Eq. (9.53) can be written as ui=2(1+r)r(ui−1+ui+1)+1+rci(9.55) From Eq. (9.55), we obtain the iteration formula ui(n+1)=2(1+r)r[ui−1(n)+ui+1(n)]+1+rci,(9.56) which expresses the (n+1)th iterate in terms of the nth iterates only, and is known as Jacobi's iteration formula.
It can be seen from Eq. (9.56) that at the time of computing ui(n+1), the latest value of ui−1, namely ui−1(n+1), is already available. Hence, the convergence of Jacobi's iteration formula can be improved by replacing ui−1(n) in formula given in Eq. (9.56) by its latest value available, namely by ui−1(n+1). Accordingly, we obtain the formula ui(n+1)=2(1+r)r[ui−1(n+1)+ui+1(n)]+1+rci(9.57) which is called the Gauss–Seidel iteration formula. It can be shown that Eq. (9.57) converges for all finite values of r and that it converges twice as fast as Jacobi's scheme.
Equation (9.57) can be rewritten as ui(n+1)=ui(n)+{2(1+r)r[ui−1(n+1)+ui+1(n)]+1+rci−ui(n)} from which it is clear that the expression within the curly brackets is the difference between the nth and (n+1)th iterates. If we take the difference to be ω times this expression, we then obtain ui(n+1)=ui(n)+ω{2(1+r)r[ui−1(n+1)+ui+1(n)]+1+rci−ui(n)}(9.58) which is called the successive over-relaxation (or SOR) method. ω is called the relaxation factor and it lies, generally, between 1 and 2.