Suppose that you need to solve a system of linear equations of the following form:
1) X 1 + x 2 + x 4 = 0;
2) -X2-H3-5H4 = 0;
3) -4H2-H3-7H4 = 0;
4) 3H2-3H3-2H4 = 0;
As you can see, there are four variables that must be found.There are several ways to do this.
To start, you need to write down the equations of the system in the form of a matrix.In this case, it will have three columns and four rows:
X1 X2 X4
-X2 X3 X3 5x4
3x2 -3H3 -2H4
The first and most simple way to deal with a variable substitution of a single equation systemmore.Thus, it is possible to ensure that all variables except one are eliminated and there will be only one equation.
For example, you can display and substitute the variable X 2 of the second row in the first.This pr
ocedure may be performed for other lines.As a result, the first column will exclude all variables except one. then Gaussian elimination must be similarly applied to the second column.Further, the same method can proceed with the rest of the rows.
Thus, all rows of the matrix become triangular form as a result of these actions:
0 X1 0
0 X2 0
0 0 0
X3 0 X4
exception Jordan-Gaussa includes an additional step.With it eliminated all the variables, except for four, and the matrix becomes almost perfect diagonal:
0 0 0 0 X2 X3
0 0 0 0
Then you can look for these variables.In this case, x1 = -1, x2 = 2, and so on. mandatory reserve replacement is decided for each variable separately, as in the substitution of the Gaussian, so all unwanted items will be eliminated.
Additional operations in the elimination of Gauss-Jordan play the role of substitution variables in the matrix diagonal form.It triples the amount of computation required, even in comparison with the operations of the reserve replacement Gauss.However, it helps to find the values of the unknown with greater precision and helps to better calculate the deviation.
Advanced Gauss-Jordan method increases the likelihood of error and increase the time needed for computation.A drawback of both is that they require a correct algorithm.If the sequence goes astray, the result can also be wrong.
That is why these methods are not often used for the calculations on paper, and for computer programs.Realize they can be almost any way and all programming languages: from Basic to C