Theme 9. Matrix operations in Maple. Systems of linear equations
2. Systems of linear equations
Many tasks of engineering practice and computational mathematics are reduced to the solution of systems of linear equations. For example, from the field of mechanics, electrical engineering, economics, analytic geometry, interpolation and approximation problems are reduced to finding a solution of systems of linear equations.
Thus, the solution of a two-dimensional system of linear equations is necessary when finding the point of intersection of two straight lines, and the three-dimensional system - when finding the point of intersection of three planes.
A system of linear algebraic equations with variables x1, x2, ... xn is written in the general form (1):
(1)
where: a ij - coefficients of the system; x j - variable; b i - free members; i is the line number, j is the column number.
It can be represented in a matrix form as:
matrix of free members;
desired matrix.
The coefficients of matrices A and B are values of real numbers. If matrix A is not degenerate:
det A¹0,
then such a system has a single solution.
The coefficients of matrices A and B are values of real numbers. If matrix A is not degenerate:
det A¹0,
then such a system has a single solution.
The solution of the system (1) n of equations with n variables is an ordered set of n numbers in a real set, which, when substituting into system (1) instead of x1, x2, ... xn, returns each linear equation of the system in equality. The number of elementary operations in the solution of systems with n variables is proportional to approximately.
Methods for solving the system of linear algebraic equations are divided into direct (exact) and iterative ( approximation). Direct methods are called such methods that allow for a certain number of actions to obtain an exact (in terms of algorithm) solution of the system. Iterative methods are based on the construction of the iterative computational sequence, which coincides with the desired solution. In this case, by performing a certain number of iterations and tearing the process, we can obtain an approximate solution of the system with a predetermined error e.
Methods of solving a system of linear algebraic equations
Direct (exact) |
Iterative (approximate) |
|
|
The most common method for solving systems of linear equations is the Cramer formula, which is used for a system of linear equations with a dimension no more than 4, otherwise the number of computational operations increases according to the law N = (n2-1) n! + N.
The method of sequential exclusion of the desired Gauss is one of the most effective and universal method for solving linear algebraic systems.
The choice of this or that method of solving the system of linear equations is determined by many factors: the peculiarities of the matrix [A], the order of the system n, the nature of the problem to be solved, etc. The table (below) shows the number of operations depending on the method and dimension of the system of equations.
Method |
Cramer |
Gauss |
n = 5 |
2885 |
65 |
n = 10 |
360 * 10 6 |
430 |
All algorithms for solving systems of linear equations are based on elementary operations over matrix elements, i:
- The multiplication of all elements of which is not a string of one and the same number.
- Adding or subtracting items between strings.
- Repositioning strings.
Cramer's Formula
- the system of linear equations of the form a ij x j = b i (i = 1, n; j = 1, n) for n <4;
- the determinant D of the matrix a ij (i = 1, n; j = 1, n) º (a ij ) n, n does not equal zero;
It is necessary to find the values of the matrix x i (i = 1, n) º (x i ) n.
The essence of the method . Determine determinants: D - main and D i - auxiliary. Auxiliary determinants are defined for matrices in which each j-column of the matrix (a ij ) n, n is replaced by a matrix - a column (b i ) of n free members. If the headline is zero, then the system is special - the solution may have many options or not have one. If the main determinant is not equal to zero then the coefficients of the sought matrix x i ( i = 1, n) º (x i ) n will be determined by the formula: x i = D i / D, (i = 1, n).
Sequence of calculation:
- Determine the key determinant. If the value of the main determinant is zero, then the "end of the calculation", otherwise go to paragraph 2.
- Identify auxiliary determinants D i and go to step 3.
- Determine the roots of the system of linear equations by the formula: x i = D i / D, (i = 1, n) and proceed to clause 4.
- Output the root value of x i .
Gauss method (sequential exclusion)
Output :
- a system of linear equations of the form Ax = b;
- the determinant of the matrix [A] does not equal zero.
You need to find the value of x i .
The essence of the method . The method of sequential exclusion of the required variables x i (i = 1, n) is one of the most effective and universal methods for solving systems of linear equations. It relates to direct methods and there are several of its schemes, for example, Jordana, one division.
The Gauss solution process consists of two steps. In the first stage (direct motion) system (1) is reduced to a triangular type, and on the second (reverse) - a consistent determination of the desired values of this triangular system is performed.
Matrix method for solving systems of linear equations
A system of linear algebraic equations can be presented in the matrix form:
A • X = B.
If matrix A is not special (| A | ≠ 0), then there exists a matrix A ^ (-1) that is inverse to it. Multiply the matrix equation on the inverse matrix:
A ^ (- 1) · A · X = A ^ (- 1) · B ,
where:
E · X = A ^ (- 1) · B,
or else:
X = A ^ (- 1) · B.
Thus, in order to find the roots of the system of linear equations, we need to calculate the inverse matrix A ^ (- 1) and perform its multiplication by the vector of free coefficients B.
Font Face
Font Size
Text Colour
Background Colour
Font Kerning
Image Visibility
Letter Spacing
Line Height
Link Highlight