Unformatted text preview: Example 9.2.4. Consider the boundary value problem for Laplace's equation on a
unit square
u=0
(x y) 2
u(x y) = 0 iif x = 0 y = 1
(x y) 2 @ :
1 f x=1 y=0 14 Solution Techniques for Elliptic Problems
K 1
0
1
0
1
0
1
0 k ν+1 (j,k) 1
0
1
0 ν 1
0
1
0 1
0
1
0 0
0 j J Figure 9.2.1: GaussSeidel iteration with row ordering.
Let us solve this problem on a 3 3 mesh using Jacobi and GaussSeidel iteration with
x = y = 1=3 hence, using (8.1.2) with x = y = 1=4 and fjk = 0, we have
Ujk = 1 (Uj+1 k + Uj;1 k + Uj k+1 + Uj k;1)
j k = 1 2:
4
The Jacobi iteration is
(
)
j k=1 2
= 0 1 ::: :
Ujk +1) = 1 (Uj(+1 k + Uj(;)1 k + Uj( k)+1 + Uj( k);1)
4
(0)
Starting with the trivial initial guess Ujk = 0, j k = 1 2, we present solutions after the
one and ve iterations in Table 9.2.1. The exact solution and di erences between the
exact and Jacobi solutions after ve iterations are shown in Table 9.2.2.
The GaussSeidel method for this problem is
1)
(
= 0 1 ::: :
Ujk +1) = 4 (Uj(+1 k + Uj(;+1) + Uj( k)+1 + Uj( k+1) )
1k
;1
Its solution after ve iterations is shown in Table 9.2.3.
The maximum error after ve Jacobi iterations is 0.01656 and after ve GaussSeidel
iterations is 0.00146. Thus, as expected, GaussSeidel iteration is converging faster than
Jacobi iteration 9.2. Basic Iterative Solution Methods 15 0
0
0 0/1
0
0
0
0/1
0
0 0.25 1
0 0.23438 0.48344 1
0 0.25 0.5 1
0 0.48344 0.73438 1
0/1 1
1
1
0/1
1
1
1
Table 9.2.1: Solution of Example 9.2.4 after one iteration ( = 0, left) and after ve
iterations ( = 4, right) using Jacobi's method.
0
0
0 0/1
0
0
0
0
0 0.25 0.5 1
0 0.01562 0.01656 0
0 0.5 0.75 1
0 0.01656 0.01562 0
0/1 1
1
1
0
0
0
0
Table 9.2.2: Exact solution of Example 9.2.4 (left) and the errors in the Jacobi solution
after ve iterations (right).
0
0
0
0/1
0
0
0
0
0 0.24927 0.49963 1
0 0.00073 0.00037 0
0 0.49854 0.74927 1
0 0.00146 0.00073 0
0/1
1
1
1
0
0
0
0
Table 9.2.3: Solution of Example 4 after ve iterations ( = 4) using the GaussSeidel
method (left) and errors in this soluti...
View
Full Document
 Spring '14
 JosephE.Flaherty
 Articles with example pseudocode, Gauss–Seidel method, Jacobi method, Iterative method, elliptic problems

Click to edit the document details