Professional Documents
Culture Documents
Direct
direct methods
may be faster than direct methods
may handle special structures (such
as sparsity) in a simpler way
Residual r = bAx
10
10
Iterative
10
10
15
10
10
15
Iteration
20
25
30
+ 2 =1
2
x
y
on a square grid using centered finite difference approximations:
n+1
uij
n+1
A=delsq(numgrid(S,n+2));
10
20
30
40
50
60
0
20
40
nz = 288
60
Choosing a Splitting
Find a splitting A = M K such that
(1)
(2)
(R) is small
= 1 to n
for j = 1 to n
(k+1)
(k)
(k)
(k)
(k)
ui,j = (ui1,j + ui+1,j + ui,j1 + ui,j+1 + h2 )/4
1
(RJ ) = max |1 ij /4| = |1 11 /4| = cos
i,j
n+1
2(n + 1)2
Therefore, it converges with a constant factor every O(n 2 ) iteration
10
= 1 to n
for j = 1 to n
(k+1)
(k+1)
(k)
(k+1)
(k)
ui,j = (ui1,j + ui+1,j + ui,j1 + ui,j+1 + h2 )/4
The order matters! For Cartesian grids, the red-black ordering updates in
a checkerboard pattern
11
x(k+1) =
xi
(k)
+ (1 )xi
where x
is the Gauss-Seidel iterate
12
= 2/ 1 + sin
n+1
2
(RSOR ) 1
n+1
which is n times faster than Jacobi/Gauss-Seidel, or a constant factor
improvement every O(n) iteration
13
14