Beruflich Dokumente
Kultur Dokumente
BerlinChen
DepartmentofComputerScience&InformationEngineering
NationalTaiwanNormalUniversity
Reference:
1. Applied Numerical Methods with MATLAB for Engineers, Chapter 12 & Teaching material
Chapter Objectives
Understanding the difference between the Gauss-Seidel
and Jacobi methods
Knowing how to assess diagonal dominance and
knowing what it means
Recognizing how relaxation can be used to improve
convergence of iterative methods
Understanding how to solve systems of nonlinear
equations with successive substitution and NewtonRaphson
Gauss-Seidel Method
The Gauss-Seidel method is the most commonly used
iterative method for solving linear algebraic equations
[A]{x}={b}
The method solves each equation in a system for a
particular variable, and then uses that value in later
equations to solve later variables
For a 3x3 system with nonzero elements along the
diagonal, for example, the jth iteration values are found
from the j-1th iteration using:
j1
j1
a11 x1 a12 x2 a13 x3 b1
a 21 x1 a 22 x2 a 23 x3 b2
a31 x1 a32 x2 a33 x3 b3
x1j
b1 a12 x2 a13 x3
a11
NM Berlin Chen 3
xij xij1
a,i
100%
j
xi
The method is ended when all elements have converged
to a set tolerance
NM Berlin Chen 4
NM Berlin Chen 5
NM Berlin Chen 6
NM Berlin Chen 7
Jacobi Iteration
The Jacobi iteration is similar to the Gauss-Seidel
method, except the j-1th information is used to update all
variables in the j th iteration:
Gauss-Seidel
Jacobi
NM Berlin Chen 8
Diagonal Dominance
The Gauss-Seidel method may diverge, but if the
system is diagonally dominant, it will definitely
converge
Diagonal dominance means:
n
aii aij
j1
ji
NM Berlin Chen 9
MATLAB Program
NM Berlin Chen 10
Relaxation
To enhance convergence, an iterative program
can introduce relaxation where the value at a
particular iteration is made up of a combination
of the old value and the newly calculated value:
Example 12.2
NM Berlin Chen 12
Example 12.2
NM Berlin Chen 13
Example 12.2
NM Berlin Chen 14
Nonlinear Systems
Nonlinear systems can also be solved using the same
strategy as the Gauss-Seidel method
Solve each system for one of the unknowns and update each
unknown using information from the previous iteration
x12 x1 x2 10
x2 3x1 x22 57
NM Berlin Chen 15
Example 12.3
NM Berlin Chen 16
1.Forsuccessivesubstitution,convergence
oftendependsonthemannerinwhich
theequationsareformulated
2.Divergencealsocanoccuriftheinitial
guessesareinsufficientlyclosetothetrue
solution
Example 12.3
NM Berlin Chen 17
Newton-Raphson (1/3)
Nonlinear systems may also be solved using the
Newton-Raphson method for multiple variables
For a two-variable system, the Taylor series
approximation and resulting Newton-Raphson equations
are:
f
f
f1,i 1 f1,i x1,i 1 x1,i
1,i
x2,i 1 x2,i
1,i
x1
x2
f 2,i
f 2,i
f 2,i 1 f 2,i x1,i 1 x1,i
x2,i 1 x2,i
x1
x2
f1,i 1 0
f 2,i 1 0
f xi 1 f xi xi 1 xi f xi 0
xi 1 xi
f xi
f xi
f1,i
f
f
f
x1,i 1 1,i x2,i 1 f1,i 1,i x1,i 1,i x2,i
x1
x2
x1
x2
f1,i
f
f
f
x1,i 1 1,i x2,i 1 f1,i 1,i x1,i 2,i x2,i
x1
x2
x1
x2
NM Berlin Chen 18
Newton-Raphson (2/3)
After algebraic manipulation
f 2 ,i
x2
f 1,i f 2 ,i
x1 x 2
f 1,i
f 2 ,i
x1
f 1,i f 2 ,i
x1 x 2
f 1,i
x 1,i 1 x 1,i
x 2 ,i 1 x 2 ,i
f 1, i
J fx1
2 ,i
x
1
f 1, i
x 2
f 2 ,i
x 2
ReferredtoastheJacobian ofthesystem
f 1,i
x2
f 1,i f 2 ,i
x 2 x1
f 2 ,i
f 1,i
x1
f 1,i f 2 ,i
x 2 x1
f 2 ,i
Referredtoasthedeterminant
oftheJacobian ofthesystem
NM Berlin Chen 19
Newton-Raphson (3/3)
Matrix notion of Newton-Raphson
Also can be generalized to n simultaneous equations
J x i 1 f J x i
x i 1 x i J 1 f
NM Berlin Chen 20
Newton-Raphson: An Example
x12 x1 x2 10
x2 3x1 x22 x12 57
f1 x1 , x2 x12 x1 x2 10 0
Example 12.4
NM Berlin Chen 21
MATLAB Program
NM Berlin Chen 22