Gauss-Jacobi and Gauss-Siedel

Apprentice123

New member
Joined
Sep 2, 2008
Messages
22
Solving the system of linear equations using the methods of Gauss-Jacobi and Gauss-Siedel. Using precision of \(\displaystyle 1x10^{-3}\)
A=[-4 -1 2; 1 -10 6; 1 -3 -6]
B=[x1; x2; x3]
C=[1 -5 7]

A.B = C

Using Gauss-Jacobi I find:
I used x^0 = [0;0;0]. I can ?
With 11 iterations I find
\(\displaystyle X_1 = -0,762\)
\(\displaystyle X_2 = -0,271\)
\(\displaystyle X_3 = -1,159\)
Test Stop
\(\displaystyle M_r = \frac{|-1,159 - (-1,158)|}{|-1,159|} = 8,63x10^{-4} < 1x10^{-3}\)
The test is stopped for any X (x1, x2, x3) or for all ?

Using Gauss-Siedel
With 9 iterations I find
Used x^0 = [0;0;0]
\(\displaystyle X_1 = -0,758\)
\(\displaystyle X_2 = -0,269\)
\(\displaystyle X_3 = -1,155\)
Test Stop
\(\displaystyle M_r = \frac{|-1,155 - (-1,154)|}{|-1,155|} = 8,65x10^{-4} < 1x10^{-3}\)


Are correct ?
 
Top