Vergleich Gradientenverfahren und CG-Verfahren A = [4 0; 0 4] , b ...
Vergleich Gradientenverfahren und CG-Verfahren A = [4 0; 0 4] , b ... Vergleich Gradientenverfahren und CG-Verfahren A = [4 0; 0 4] , b ...
Prof. Dr. Barbara Wohlmuth Lehrstuhl für Numerische Mathematik Vergleich Gradientenverfahren und CG-Verfahren A = [4 0; 0 4], b = [1; 4] Gradientenverfahren CG-Verfahren 3 3 2 2 1 1 0 0 −1 −1 0 1 2 −1 −1 0 1 2 Kapitel III.4 (linalg38) 1
- Seite 2 und 3: Prof. Dr. Barbara Wohlmuth Lehrstuh
- Seite 4 und 5: Prof. Dr. Barbara Wohlmuth Lehrstuh
- Seite 6 und 7: Prof. Dr. Barbara Wohlmuth Lehrstuh
- Seite 8 und 9: Prof. Dr. Barbara Wohlmuth Lehrstuh
Prof. Dr. Barbara Wohlmuth<br />
Lehrstuhl für Numerische Mathematik<br />
<strong>Vergleich</strong> <strong>Gradientenverfahren</strong> <strong>und</strong> <strong>CG</strong>-<strong>Verfahren</strong><br />
A = [4 0; 0 4], b = [1; 4]<br />
<strong>Gradientenverfahren</strong><br />
<strong>CG</strong>-<strong>Verfahren</strong><br />
3<br />
3<br />
2<br />
2<br />
1<br />
1<br />
0<br />
0<br />
−1<br />
−1 0 1 2<br />
−1<br />
−1 0 1 2<br />
Kapitel III.4 (linalg38) 1
Prof. Dr. Barbara Wohlmuth<br />
Lehrstuhl für Numerische Mathematik<br />
<strong>Vergleich</strong> <strong>Gradientenverfahren</strong> <strong>und</strong> <strong>CG</strong>-<strong>Verfahren</strong><br />
A = [2 1; 1 9], b = [1; 4]<br />
<strong>Gradientenverfahren</strong><br />
<strong>CG</strong>-<strong>Verfahren</strong><br />
2<br />
2<br />
1.5<br />
1.5<br />
1<br />
1<br />
0.5<br />
0.5<br />
0<br />
0<br />
−0.5<br />
−0.5<br />
−1<br />
−1<br />
−1.5<br />
−1 0 1 2<br />
−1.5<br />
−1 0 1 2<br />
Kapitel III.4 (linalg36) 2
Prof. Dr. Barbara Wohlmuth<br />
Lehrstuhl für Numerische Mathematik<br />
<strong>Vergleich</strong> <strong>Gradientenverfahren</strong> <strong>und</strong> <strong>CG</strong>-<strong>Verfahren</strong><br />
A = [1 2; 2 9], b = [2; 1]<br />
<strong>Gradientenverfahren</strong><br />
<strong>CG</strong>-<strong>Verfahren</strong><br />
1<br />
1<br />
0.5<br />
0.5<br />
0<br />
0<br />
−0.5<br />
−0.5<br />
−1<br />
−1<br />
−1.5<br />
−1.5<br />
−2<br />
−2<br />
−2.5<br />
2 3 4 5<br />
−2.5<br />
2 3 4 5<br />
Kapitel III.4 (linalg37) 3
Prof. Dr. Barbara Wohlmuth<br />
Lehrstuhl für Numerische Mathematik<br />
<strong>Vergleich</strong> iterativer Lösungsverfahren<br />
Testmatrizen<br />
Poisson-Matrix<br />
A ∈ R n2 ×n 2 ,A = A T ,<br />
⎛ ⎞<br />
B −I<br />
A := ⎜−I ... ...<br />
⎟<br />
⎝ ... ... −I⎠<br />
−I B<br />
mit I,B ∈ R n×n ,<br />
⎛ ⎞<br />
4 −1<br />
B := ⎜−1 ... ...<br />
⎟<br />
⎝ ... ... −1⎠ .<br />
−1 4<br />
Lehmer-Matrix<br />
M ∈ R p×p , M = M T ,<br />
m ij := i für j ≥ i<br />
j<br />
z.B. p = 4<br />
⎛ ⎞<br />
1 1/2 1/3 1/4<br />
−→ M = ⎜1/2 1 2/3 1/2<br />
⎟<br />
⎝1/3 2/3 1 3/4⎠<br />
1/4 1/2 3/4 1<br />
Kapitel III.4 (linalg39) 4
Prof. Dr. Barbara Wohlmuth<br />
Lehrstuhl für Numerische Mathematik<br />
<strong>Vergleich</strong> iterativer Lösungsverfahren<br />
Fehler gegen Anzahl der Iterationen, n 2 = p = 100<br />
Poisson-Matrix<br />
Lehmer-Matrix<br />
10 0<br />
10 −4<br />
Jacobi<br />
GS<br />
SGS<br />
10 −8<br />
<strong>CG</strong><br />
0 20 40 60 80<br />
10 −4<br />
10 −8<br />
0 200 400<br />
Jacobi-<strong>Verfahren</strong> divergiert!<br />
10 0 GS<br />
SGS<br />
<strong>CG</strong><br />
Kapitel III.4 (linalg40) 5
Prof. Dr. Barbara Wohlmuth<br />
Lehrstuhl für Numerische Mathematik<br />
<strong>Vergleich</strong> iterativer Lösungsverfahren<br />
Anzahl der Iterationen, bis Fehler < 10 −8 ,<br />
gegen n 2 bzw. p<br />
Poisson-Matrix<br />
Lehmer-Matrix<br />
1000<br />
800<br />
600<br />
400<br />
Jacobi<br />
GS<br />
SGS<br />
<strong>CG</strong><br />
2000<br />
1500<br />
1000<br />
Jacobi<br />
GS<br />
SGS<br />
<strong>CG</strong><br />
200<br />
500<br />
0<br />
0 50 100 150 200<br />
0<br />
0 20 40 60 80 100<br />
Jacobi-<strong>Verfahren</strong> divergiert!<br />
Kapitel III.4 (linalg41) 6
Prof. Dr. Barbara Wohlmuth<br />
Lehrstuhl für Numerische Mathematik<br />
SOR <strong>und</strong> konjungiertes <strong>Gradientenverfahren</strong> im <strong>Vergleich</strong> für die<br />
Poisson Matrix<br />
300<br />
250<br />
sor<br />
cg<br />
pcg−sgs<br />
pcg−ssor1.8<br />
pcg−ssoropt<br />
Anzahl der Iterationen<br />
<strong>Vergleich</strong> des optimalen SOR mit cg: rel. Fehler < 1e−6<br />
1<br />
0.9<br />
0.8<br />
numerische Konvergenzrate<br />
sor<br />
cg<br />
pcg−sgs<br />
pcg−ssor1.8<br />
pcg−ssoropt<br />
<strong>Vergleich</strong> des optimalen SOR mit cg<br />
Anzahl der Iterationen<br />
200<br />
150<br />
100<br />
asymptotische Konvergenzraten<br />
0.7<br />
0.6<br />
0.5<br />
0.4<br />
0.3<br />
50<br />
0.2<br />
0.1<br />
0<br />
0 10 20 30 40 50 60 70 80 90 100<br />
Dimension der Matrix ist N 2<br />
0<br />
0 10 20 30 40 50 60 70 80 90 100<br />
Dimension der Matrix ist N 2<br />
Rot: optimales SOR, Blau: konjugiertes <strong>Gradientenverfahren</strong>, Pink: vorkonditioniertes<br />
<strong>CG</strong> mit symmetrischen Gauß–Seidel, Grün: vorkonditioniertes <strong>CG</strong> mit SSOR, ω = 1.8,<br />
Gelb: vorkonditioniertes <strong>CG</strong> mit SSOR, ω = ω opt<br />
Kapitel III.4 (linalg46) 7
Prof. Dr. Barbara Wohlmuth<br />
Lehrstuhl für Numerische Mathematik<br />
<strong>Vergleich</strong> iterativer Lösungsverfahren<br />
Massenmatrix<br />
Strukturiertes Gitter auf (0,1) 2 ,<br />
Gitterweite h = 1/(n+1), n ∈ N,<br />
Knoten x ij = (hi,hj), 1 ≤ i,j ≤ n,<br />
Matrixeinträge zu x ij aus<br />
1/36<br />
1/9<br />
1/36<br />
0<br />
5<br />
−→ Struktur der Matrix<br />
1/9 4/9 1/9<br />
10<br />
15<br />
1/36 1/9 1/36<br />
0 5 10 15<br />
n = 4,A ∈ R n2 ×n 2<br />
Kapitel III.4 (linalg43) 8
Prof. Dr. Barbara Wohlmuth<br />
Lehrstuhl für Numerische Mathematik<br />
<strong>Vergleich</strong> iterativer Lösungsverfahren<br />
Massenmatrix<br />
Iterationen<br />
Zeit<br />
Iterationen<br />
2 Anzahl Iterationen, bis Fehler < 10−8<br />
10<br />
10 1<br />
Jacobi (damped)<br />
GS<br />
SGS<br />
10 0<br />
<strong>CG</strong><br />
0 100 200 300 400<br />
n 2<br />
Zeit<br />
0.6<br />
0.4<br />
0.2<br />
Zeit, bis Fehler < 10 −8<br />
LU (voll)<br />
GS<br />
<strong>CG</strong><br />
0<br />
0 200 400 600 800 1000<br />
n 2<br />
Kapitel III.4 (linalg44) 9