Gauss Seidel Final-1
Gauss Seidel Final-1
Gauss Seidel Final-1
Question 1 →
In[9]:= n = 3;
a = 5, 2, 1, 3, 7, 4, 1, 1, 9;
MatrixForm[a]
x = 1, 2, 3
y = 0, 0, 0
Out[11]//MatrixForm=
5 2 1
3 7 4
1 1 9
Out[12]=
{1, 2, 3}
Out[13]=
{0, 0, 0}
Out[14]=
y[1]=0.999999
y[2]=2.
y[3]=1.
Question 2 →
2
In[287]:=
n = 3;
a = 4, 1, 1, 1, 5, 2, 1, 2, 3;
MatrixForm[a]
x = 0, 0, 0
y = 0, 0, 0
b = 2, - 6, - 4
Out[289]//MatrixForm=
4 1 1
1 5 2
1 2 3
Out[290]=
{0, 0, 0}
Out[291]=
{0, 0, 0}
Out[292]=
{2, - 6, - 4}
y[1]=1.
y[2]=- 1.
y[3]=- 1.
Question 3 →
3
In[9]:= n = 3;
a = 3, - 6, 2, - 4, 1, - 1, 1, - 3, 7;
MatrixForm[a]
x = 0, 0, 0
y = 0, 0, 0
b = 23, - 8, 17
For k = 1, k ≤ 4, k ++,
{0, 0, 0}
Out[13]=
{0, 0, 0}
Out[14]=
{23, - 8, 17}
y[1]=- 101.88
y[2]=243.621
y[3]=- 27.424
Question 4 →
4
In[17]:= n = 3;
a = 4, 1, 1, 1, 5, 2, 1, 2, 3;
MatrixForm[a]
x = 0, 0, 0
y = 0, 0, 0
b = 3, - 8, 7
For k = 1, k ≤ 4, k ++,
{0, 0, 0}
Out[21]=
{0, 0, 0}
Out[22]=
{3, - 8, 7}
y[1]=0.51
y[2]=- 3.3
y[3]=4.10444
Question 5 →
5
In[41]:= n = 3;
a = 3, - 6, 2, - 4, 1, - 1, 1, - 3, 7;
MatrixForm[a]
x = 0, 0, 0
y = 0, 0, 0
For k = 1, k ≤ 4, k ++,
{0, 0, 0}
Out[45]=
{0, 0, 0}
Out[46]=
y[1]=237.651
y[2]=243.079
y[3]=47.0159