Professional Documents
Culture Documents
Y. Sharath Chandra Mouli (IITK) Solving System of Linear Equations September 11, 2017 1 / 32
Overview I
1 System of Linear Equations
2 Gaussian Elimination (Back substitution)
3 Gauss-Jordon Elimination
4 LU Decomposition
Performing the LU Decomposition
Crouts algorithm
5 Tridiagonal Systems of Equations
6 Band Diagonal Systems of Equations
7 Iterative Methods
Stationary Iterative Methods
The Jacobi Method
The Gauss-Seidel Method
Successive Overrelaxation Method (SOR)
Symmetric Successive Overrelaxation Method (SSOR)
Non-Stationary Iterative Methods
Conjugate Gradient Method (CG)
MINRES and SYMMLQ
Y. Sharath Chandra Mouli (IITK) Solving System of Linear Equations September 11, 2017 2 / 32
Overview II
CG on Normal Equations, CGNE and CGNR
Generalized Minimal Residual (GMRES)
BiConjugate Gradient (BiCG)
Quasi-Minimal Residual (QMR)
Conjugate Gradient Squared Method (CGS)
BiConjugate Gradient Stabilized (Bi-CGSTAB)
Conclusions from Iterative Methods
Y. Sharath Chandra Mouli (IITK) Solving System of Linear Equations September 11, 2017 3 / 32
System of Linear Equations
Y. Sharath Chandra Mouli (IITK) Solving System of Linear Equations September 11, 2017 4 / 32
Gaussian Elimination (Back substitution)
Echelon form
0 0 0 0
0
a11 a12 a13 . . . a1n x1 b1
0 0 0 0
0 a x2 b2
22 a23 . . . a2n
.. = ..
. . . . . . . . . . . . . . . . . . . . . . .
. .
0 0
0 0 0 . . . amn xm bm
Back substitution:
0 0
xm = bm /amn (2)
N
0 0 0
X
xi = (1/aii ) bi aij xi (3)
j=i+1
Y. Sharath Chandra Mouli (IITK) Solving System of Linear Equations September 11, 2017 5 / 32
Gauss-Jordon Elimination
Writing,
LU = A
We decompose as,
Ax = (LU)x = L(Ux) = b
Such that, Ly = b and then solving Ux = y
Y. Sharath Chandra Mouli (IITK) Solving System of Linear Equations September 11, 2017 7 / 32
LU Decomposition
By forward substitution,
b1
y1 =
11
i1
1 X
yi = bi ij yj i = 2, 3, .., N
ii
j=1
By backward substitution,
bN
xN =
11
N
1 X
yi = yi ij xj i = N 1, N 2, .., 1
ii
j=i+1
Y. Sharath Chandra Mouli (IITK) Solving System of Linear Equations September 11, 2017 8 / 32
Performing the LU Decomposition
Crouts algorithm:
Set ii = 1, i = 1, .., N
For each j = 1, 2, 3, .., N do these two procedures:
First, for i = 1, 2, .., j
i1
X
ij = aij ik kj
k=1
Second, or i = j + 1, j + 2, ..., N
j1
" #
1 X
ij = aij ik kj
jj
k=1
Y. Sharath Chandra Mouli (IITK) Solving System of Linear Equations September 11, 2017 9 / 32
Tridiagonal Systems of Equations
Y. Sharath Chandra Mouli (IITK) Solving System of Linear Equations September 11, 2017 10 / 32
Band Diagonal Systems of Equations
Definition:
aij = 0 when j > i + m2 or i > j + m1
Band diagonal matrices are stored and manipulated in a so-called
compact form.
Results in a long narrow matrix with m1 + 1 + m2 columns and N
rows.
3 1 0 0 0 0 0 x x 3 1
4 1 5 0 0 0 0 x 4 1 5
9 2 6 5 0 0 0 9 2 6 5
0 3 5 8 9 0 0 = 3 5 8 9
0 0 7 9 3 2 0 7 9 3 2
0 0 0 3 8 4 6 3 8 4 6
0 0 0 0 2 4 4 2 4 4 x
The band diagonal matrix which has N = 7, m1 = 2, and m2 = 1, is
stored compactly as the 7X 4 matrix.
Y. Sharath Chandra Mouli (IITK) Solving System of Linear Equations September 11, 2017 11 / 32
Iterative Methods
Stationary methods:
Y. Sharath Chandra Mouli (IITK) Solving System of Linear Equations September 11, 2017 12 / 32
Stationary Iterative Methods
Y. Sharath Chandra Mouli (IITK) Solving System of Linear Equations September 11, 2017 14 / 32
Stationary Iterative Methods
Y. Sharath Chandra Mouli (IITK) Solving System of Linear Equations September 11, 2017 15 / 32
Stationary Iterative Methods
Y. Sharath Chandra Mouli (IITK) Solving System of Linear Equations September 11, 2017 16 / 32
Non-Stationary Iterative Methods
Contd..
Y. Sharath Chandra Mouli (IITK) Solving System of Linear Equations September 11, 2017 17 / 32
Non-Stationary Iterative Methods
where, i = r (i)T
r (i) /r (i1)T
r (i1) ensures that p (i) and Ap (i1) - or equiv-
alently, r (i) and r (i1) - are orthogonal.
Theory
The unpreconditioned conjugate gradient method constructs the ith
iterate x (i) as an element of x (0) + span{r (0) , ..., A(i1) r (0) } so that
(x (i) x)T A(x (i) x) is minimized, where x is the exact solution of
Ax = b.
Minimum is guaranteed to exist in general, if A is symmetric
positive definite.
Y. Sharath Chandra Mouli (IITK) Solving System of Linear Equations September 11, 2017 18 / 32
Non-Stationary Iterative Methods
Y. Sharath Chandra Mouli (IITK) Solving System of Linear Equations September 11, 2017 19 / 32
Non-Stationary Iterative Methods
Y. Sharath Chandra Mouli (IITK) Solving System of Linear Equations September 11, 2017 21 / 32
Non-Stationary Iterative Methods
Y. Sharath Chandra Mouli (IITK) Solving System of Linear Equations September 11, 2017 22 / 32
Non-Stationary Iterative Methods
w (i) = Av (i)
for k = 1, ..., i
w (i) = w (i) (w (i) , v (k) )v (k)
end
v (i+1) = w (i) / k w (i) k
The inner product coefficients (w (i) , v (i) ) and k w (i) k are stored in
an upper Hessenberg matrix.
The GMRES iterates are constructed as
Y. Sharath Chandra Mouli (IITK) Solving System of Linear Equations September 11, 2017 25 / 32
Non-Stationary Iterative Methods
Y. Sharath Chandra Mouli (IITK) Solving System of Linear Equations September 11, 2017 26 / 32
Non-Stationary Iterative Methods
This suggests that if Pi (A) reduces r (0) to a smaller vector r (i) , then
it might be advantageous to apply this contraction operator twice,
and compute Pi2 (A)r (0) .
Y. Sharath Chandra Mouli (IITK) Solving System of Linear Equations September 11, 2017 27 / 32
Non-Stationary Iterative Methods
Eq.18 shows that the iteration coefficients can still be recovered from
these vectors, and it turns out to be easy to find the corresponding
approximations for x.
Convergence
A speed of convergence for CGS that is about twice as fast as for
BiCG.
This may lead to a less accurate solution than suggested by the
updated residual.
Highly irregular convergence behavior.
Local corrections to the current solution may be so large that
cancellation effects occur.
The method tends to diverge if the starting guess is close to the
solution.
Y. Sharath Chandra Mouli (IITK) Solving System of Linear Equations September 11, 2017 28 / 32
Non-Stationary Iterative Methods
Y. Sharath Chandra Mouli (IITK) Solving System of Linear Equations September 11, 2017 29 / 32
Conclusions from Iterative Methods
Y. Sharath Chandra Mouli (IITK) Solving System of Linear Equations September 11, 2017 30 / 32
Conclusions from Iterative Methods
Y. Sharath Chandra Mouli (IITK) Solving System of Linear Equations September 11, 2017 31 / 32
The End
Y. Sharath Chandra Mouli (IITK) Solving System of Linear Equations September 11, 2017 32 / 32