Professional Documents
Culture Documents
Numerical Analysis
D E PA R T M E N T O F M E C H A N I C A L E N G I N E E R I N G
BUET
Iterative Methods - Gauss-Seidel Method
§ Gauss Elimination and its variants are called direct methods. They are not preferred for large systems.
§ Iterative methods start with an initial solution vector and iteratively converge to the true solution.
§ They stop when the pre-specified tolerance is reached and round-off errors are not an issue.
§ Given the system [A]{x}={B} and starting values {x}0, Gauss-Seidel uses the first equation to solve for x1,
second for x2, etc.
x1 = (b1 – a12x2 – a13x3 – . . . . . – a1nxn) / a11
x2 = (b2 – a21x1 – a23x3 – . . . . . – a2nxn) / a22
......
xn = (bn – an1x1 – an2x2 – . . . . . – a(n-1)(n-1)xn-1) / ann
After the first iteration you get {x}1. Use these values to start a new iteration. Repeat until the tolerance is
satisfied as,
𝑥#$ − 𝑥#$%&
𝜀!,# = ×100% < 𝜀' (Convergence criteria)
𝑥#$
for all the unknowns (i=1,…,n), where k and k-1 represent the present and previous iterations.
Gauss-Seidel Example
• Solve the following system using the Gauss-Seidel Method
6x1 – 2x2 + x3 = 11
-2x1 + 7x2 + 2x3 = 5 starting with x10 = x20 = x30 = 0.0
x1 + 2x2 – 5x3 = -1
§ First iteration
x11 = (11 + 2x20 – x30) / 6 = (11 + 0 - 0)/6 = 1.833
•Continue like this to get (Do not forget to check convergence using the specified tolerance)
•Continue like this to get (Do not forget to check convergence using the specified tolerance)
Gauss-Seidel Jacobi
Convergence of the Iterative Methods
§ Iterative methods are similar in spirit to the technique of simple fixed-point iteration used
to solve for the roots of a single equation
§ Simple fixed-point iteration had two fundamental problems:
(1) it was sometimes nonconvergent
(2) when it converged, it often did so very slowly
§ The iterative methods can also exhibit these shortcomings
§ sufficient conditions for convergence of two nonlinear equations, u(x, y) and y(x, y), are
………….(1)
Convergence of the Iterative Methods
§ In the case of two simultaneous equations, the iterative algorithm can be expressed as,
§ The partial derivatives of these equations can be evaluated with respect to each of the
unknowns as,
and, and,
That is, the diagonal element must be greater than the off-diagonal element for each row
Convergence of the Iterative Methods
§ Note that these methods can be seen as the multiple application of Simple One-Point
Iteration
§ When the system of equations can be ordered so that each diagonal entry of the coefficient
matrix is larger in magnitude than the sum of the magnitudes of the other coefficients in that
row (diagonally dominant system) the iterations converge for any starting values. This is a
sufficient but not necessary criteria
n
For all i = 1,..., n |aii | > å |aij |
j=1
j¹i
• After each new value of x is computed, that value is modified by a weighted average of the results
of the previous and present iterations,
Select a starting values for x and y, such as x0=0.0 and y0=0.0. They don’t need to satisfy the equations. Use
these values in g functions to calculate new values.
x1= g1(y0) = 0 y1= g2(x1) = -2
x2= g1(y1) = 1.098612289 y2= g2(x2) = -1.67124236
x3= g1(y2) = 0.982543669 y3= g2(x3) = -1.74201261
x4= g1(y3) = 1.00869218 y4= g2(x4) = -1.72700321
§ Solve the following linear system using any of the techniques that we learned in this chapter
[Z]i {x}i+1 = -{F}i + [Z]i {x}i
Solving System of Nonlinear Equations
• Newton’s method requires solving a linear systems, which can become
complicated when there are many variables
• First major shortcomings: It requires computing a whole matrix of
derivatives (Jacobian matrix), which can be expensive or hard to do
• Second major shortcomings: excellent initial guesses are usually required to
ensure convergence
• Therefore, variations of the Newton-Raphson approach have been developed
to encounter these problems:
• Using more simple approximations for the partial derivatives that comprise Jacobian [Z]
• Try to use better guess value from the knowledge of the system (problem specific
knowledge)