Gauss Elimination Method (Second Practical)
Gauss Elimination Method (Second Practical)
x1 + 2 x2 + 3 x3 = 1;
2 x1 + 6 x2 + 10 x3 = 0;
3 x1 + 14 x2 + 28 x3 = - 8;
In[116]:=
In[7]:=
In[41]:=
In[53]:=
2
In[54]:= upper.X ⩵ c
Out[54]=
In[55]:= Solve[upper.X ⩵ c]
Out[55]=
{{x1 → 2, x2 → 1, x3 → - 1}}
In[71]:= ClearAll
Out[71]=
ClearAll
3
In[121]:=
x1 + 10 x2 - x3 = 3;
2 x1 + 3 x2 + 20 x3 = 7;
10 x1 - x2 + 2 x3 = 4;
In[127]:=
In[131]:=
In[133]:=
In[136]:=
In[152]:=
In[154]:=
c = Take[aug, 3, - 1];
c // MatrixForm
Out[155]//MatrixForm=
3
1
543
-
17
In[157]:=
upper.X ⩵ c
Out[157]=
2018 x3 543
x1 + 10 x2 - x3, - 17 x2 + 22 x3, - ⩵ {3}, {1}, -
17 17
In[158]:=
Solve[upper.X ⩵ c]
Out[158]=
757 292 543
x1 → , x2 → , x3 →
2018 1009 2018
5
In[159]:=
ClearAll
Out[159]=
ClearAll
In[4]:=
2 x1 + x2 - 3 x3 = 0;
5 x1 + 8 x3 + x3 = 14;
4 x1 + 13 x2 + 11 x3 = 25;
In[17]:=
In[19]:=
In[25]:=
In[30]:=
In[30]:= upper.X ⩵ c
Out[30]=
False
7
In[31]:= Solve[upper.X ⩵ c]
Out[31]=
{}
In[71]:=
ClearAll
Out[71]=
ClearAll
In[104]:=
10 x1 + x2 + x3 = 12;
2 x1 + 10 x2 + x3 = 13;
x1 + x2 + 5 x3 = 7;
In[140]:=
aug // MatrixForm
Out[141]//MatrixForm=
10 1 1 12
2 10 1 13
1 1 5 7
8
In[142]:=
In[144]:=
In[146]:=
Out[147]//MatrixForm=
1 - 8 - 44 - 51
0 8 -9 -1
0 9 49 58
In[148]:=
In[151]:=
In[150]:=
c // MatrixForm
Out[150]//MatrixForm=
0
14
3
-
2
9
In[155]:=
upper.X ⩵ c
Out[155]=
473 x3 473
x1 - 8 x2 - 44 x3, 8 x2 - 9 x3, ⩵ {- 51}, {- 1},
8 8
In[156]:=
Solve[upper.X ⩵ c]
Out[156]=
{{x1 → 1, x2 → 1, x3 → 1}}