Professional Documents
Culture Documents
Basic Procedure:
-Algebraically solve each linear equation for xi
-Assume an initial guess solution array
-Solve for each xi and repeat
-Use absolute relative approximate error after each iteration
to check if error is within a pre-specified tolerance.
http://numericalmethods.eng.usf.edu
Gauss-Seidel Method
The Gauss-Seidel Method allows the user to control round-off error.
http://numericalmethods.eng.usf.edu
Gauss-Seidel Method
Algorithm
. .
. .
If: the diagonal elements are
non-zero
a11 x1 a12 x2 a13 x3 ... a1n xn b1
. .
http://numericalmethods.eng.usf.edu
Gauss-Seidel Method
Algorithm
Rewriting each equation
c1 a12 x 2 a13 x3 a1n x n From Equation 1
x1
a11
c2 a21 x1 a23 x3 a2 n xn
x2 From equation 2
a22
cn 1 an 1,1 x1 an 1, 2 x2 an 1, n 2 xn 2 an 1,n xn From equation n-1
xn 1
an 1,n 1
cn an1 x1 an 2 x2 an ,n 1 xn 1
xn From equation n
ann
http://numericalmethods.eng.usf.edu
Gauss-Seidel Method
Algorithm
General Form of each equation
n n
c1 a1 j x j cn 1 a
j 1
n 1, j xj
j 1
j n 1
x1
j 1 xn 1
a11 an 1,n 1
n
c n a nj x j
n
c2 a2 j x j
j 1 j 1
j n
x2
j2
xn
a 22 a nn
http://numericalmethods.eng.usf.edu
Gauss-Seidel Method
Algorithm
General Form for any row ‘i’
n
ci aij x j
j 1
j i
xi , i 1,2, , n.
aii
http://numericalmethods.eng.usf.edu
Gauss-Seidel Method
Solve for the unknowns
Assume an initial guess for [X] Use rewritten equations to solve for
each value of xi.
Important: Remember to use the
x1 most recent value of xi. Which
x means to apply values calculated to
2 the calculations remaining in the
current iteration.
xn-1
xn
Gauss-Seidel Method
Calculate the Absolute Relative Approximate Error
x new
x old
a i i
new
i
100
x i
http://numericalmethods.eng.usf.edu
Example: Thermal Coefficient
A trunnion of diameter 12.363”
has to be cooled from a room
temperature of 80°F before it is
shrink fit into a steel hub.
a2
1.04162 102 2860 4.4042 106 1.86472 108 0 3.0024 10 9
7.26 105
a1
1.057 10 4 2860 3.0024 10 9 7.26 105 1.3269 10 12
24
4.8021 10 6
Iteration a1 a 1 % a2 a 2 % a3 a 3 %
1 4.4042×10−6 100 3.0024×10−9 100 −1.3269×10−12 100
2 4.8021×10−6 8.2864 4.2291×10−9 29.0073 −2.4738×10−12 46.3605
3 4.9830×10−6 3.6300 4.6471×10−9 8.9946 −3.4917×10−12 29.1527
4 5.0636×10−6 1.5918 4.7023×10−9 1.1922 −4.4083×10−12 20.7922
5 5.0980×10−6 0.6749 4.6033×10−9 2.1696 −5.2399×10−12 15.8702
6 5.1112×10−6 0.2593 4.4419×10−9 3.6330 −5.9972×10−12 12.6290
! Notice – After six iterations, the absolute relative approximate errors are
decreasing, but are still high.
Example: Thermal Coefficient
Repeating more iterations, the following values are obtained
Iteration a1 a 1 % a2 a 2 % a3 a 3 %
75 5.0692×10−6 2.2559×10−4 2.0139×10−9 0.02428 −1.4049×10−11 0.01125
76 5.0691×10−6 2.0630×10−4 2.0135×10−9 0.02221 −1.4051×10−11 0.01029
T a1 a2T a3T 2