Académique Documents
Professionnel Documents
Culture Documents
Lecture 2:
Iterative methods for system of linear equations: The
conjugate gradient method
Computer Tutorial 3: Implementation
1 0 z0 1 0 z0
A , z z0 z1 z02 z12 0.
0 1 z1 0 1 z1
non-positive definite example:
0 1 1 0 1 1
A , z 1 1 2 0.
1 0 1 1 0 1
Some linear algebra:
1 T T
f ( x) x Ax b x c
2
The quadratic form:
3 2 2
Example: A , b , c 0.
2 6 8
Plot of f(x):
The quadratic form and Ax=b
d (0) b Ax( 0 )
r(Ti) r(i )
(i )
d (Ti ) Ad (i )
x(i 1) x(i ) (i ) d (i )
r(i 1) r(i ) ( i ) Ad ( i )
r(Ti 1) r(i 1)
( i 1)
r(Ti) r(i )
r(i 1) r(i 1) ( i 1) d (i )
Preconditioned Conjugate Gradient Method
Suppose that M is a
symmetric positive definite
r( 0 ) b Ax( 0 )
matrix that approximates A, d (0) M 1r( 0 )
but easier to invert (well T 1
conditioned). Then we can r( i ) M r( i )
solve instead: M-1 Ax = M-1x (i )
d (Ti ) Ad ( i )
x(i 1) x( i ) (i ) d (i )
r(i 1) r(i ) ( i ) Ad ( i )
T 1
r( i 1) M r( i 1)
( i 1)
r(Ti) M 1r( i )
1
d (i 1) M r( i 1) ( i 1) d (i )
Preconditioned Conjugate Gradient Method
Sample problem:
4 1 1 x1 12
1 4 2 x2 1
1 2 4 x3 5
exact solution: x1 = 3, x2 = x3 = 1.