Professional Documents
Culture Documents
Numerical Methods
3. 1. Solving Systems of Linear Algebraic Equations
Iterative Methods
Mechanical Engineering Department
Middle East Technical University
Ankara, Turkey
Ali Karakus (akarakus@metu.edu.tr)
These presentations were adapted from lecture notes of Dr. Cüneyt Sert, Dr. Sezer Özerinç and Altuğ
Özçelikkale.
They cannot be used and/or modified without the permission of the authors.
1

• Iterative methods start with an initial guess vector and iteratively converge to the true solution.
• They stop when the pre-specified tolerance is reached, therefore round-off errors are not an issue.
......
xn = (bn – an1x1 – an2x2 – . . . . . – a(n-1)(n-1)xn-1) / ann
• After the first iteration {x}1 is obtained. {x}1 is used to start a new iteration and iterations are repeated
until the tolerance is satisfied as:
xik − xik −1
ε a ,i = < εs
xik
for all the unknowns (i = 1, …, n), where k and k-1 indicate the present and previous iterations.
• Iterative methods are also advantageous for solving systems with sparse coefficient matrices, because
there is no need to store the zero-valued elements.
• Each double precision number requires 8 bytes. How much RAM do you need for a 100K x 100K matrix?
and so on.
x2 = ( 5 + 2x1 - 2x3) / 7
x3 = ( 1 + x1 + 2x2) / 5
Gauss-Seidel Method
Iter # 0 1 2 3 4 5
Jacobi Method (always uses the xi values from the previous iteration)
Iter # 0 1 2 3 4 5 8
x1 0.000 1.833 2.038 2.085 2.004 1.994 2.000
x2 0.000 0.714 1.181 1.053 1.001 0.990 1.000
x3 0.000 0.200 0.852 1.080 1.038 1.001 1.000
Exercise: The previous example has a diagonally dominant coefficient matrix. Interchange its 2nd and 3rd
equations. Is the system still diagonally dominant? Solve the system using both iterative methods we
learned. Compare their convergence rates with that of the solved example. Do you observe any
divergence?
Exercise: Solve the system we used in the Gauss-Seidel example with different weighting factors. Do you
notice any difference in the convergence rate?
∂ ui ∂ ui ∂ ui ∂ ui
xi +1 + yi +1 = −ui + xi + yi
∂x ∂y ∂x ∂y
To find the solution set u i+1 = 0 and v i+1 = 0. Rearrange ∂ vi ∂ vi ∂ vi ∂ vi
xi +1 + yi +1 = − vi + xi + yi
∂x ∂y ∂x ∂y
⎧ ∂ ui ∂ ui ⎫
⎡ ∂ ui ∂ ui ⎤ ⎪ − ui + xi + yi ⎪
⎢∂x x
⎧ i +1 ⎫ ∂ x ∂ y
∂ y ⎥⎪ ⎪ ⎪⎪ ⎪⎪ The 2 x 2 coefficient
⎢ ⎥⎨ ⎬=⎨ ⎬
⎢ ∂ vi ∂ vi ⎥ ⎪ ⎪ ⎪ ⎪ matrix is called the
⎢⎣ ∂ x ⎩ y ⎭ ∂ v ∂ v Jacobian matrix.
∂ y ⎥⎦ i +1
⎪ − vi + i
xi + i
yi ⎪
⎪⎩ ∂x ∂ y ⎪⎭
• Solve the following system using any of the techniques we learned in this chapter.
[Z]k {x}k+1 = -{F}k + [Z]k {x}k where Fik = fi ( x1k, x2k, …, xnk )
• k is the iteration counter. [Z]k is [Z] calculated at xi = xik . Therefore [Z] and {F} should be
12