Matrix method for solving a system of linear algebraic equations. Matrix method online

Purpose of the service. Using this online calculator, unknowns (x 1, x 2, ..., x n) are calculated in a system of equations. The decision is carried out inverse matrix method. Wherein:
  • the determinant of the matrix A is calculated;
  • through algebraic additions the inverse matrix A -1 is found;
  • a solution template is created in Excel;
The decision is carried out directly on the website (online) and is free. The calculation results are presented in a Word report (see sample format).

Instructions. To obtain a solution using the inverse matrix method, you need to specify the dimension of the matrix. Next, in a new dialog box, fill in the matrix A and the vector of results B.

Number of variables 2 3 4 5 6 7 8 9 10
See also Solving matrix equations.

Solution algorithm

  1. The determinant of the matrix A is calculated. If the determinant is zero, then the solution is over. The system has an infinite number of solutions.
  2. When the determinant is different from zero, the inverse matrix A -1 is found through algebraic additions.
  3. The solution vector X =(x 1, x 2, ..., x n) is obtained by multiplying the inverse matrix by the result vector B.
Example. Find a solution to the system matrix method. Let's write the matrix in the form:
Algebraic additions.
A 1,1 = (-1) 1+1
1 2
0 -2
∆ 1,1 = (1 (-2)-0 2) = -2

A 1,2 = (-1) 1+2
3 2
1 -2
∆ 1,2 = -(3 (-2)-1 2) = 8

A 1.3 = (-1) 1+3
3 1
1 0
∆ 1,3 = (3 0-1 1) = -1

A 2,1 = (-1) 2+1
-2 1
0 -2
∆ 2,1 = -(-2 (-2)-0 1) = -4

A 2,2 = (-1) 2+2
2 1
1 -2
∆ 2,2 = (2 (-2)-1 1) = -5

A 2,3 = (-1) 2+3
2 -2
1 0
∆ 2,3 = -(2 0-1 (-2)) = -2

A 3.1 = (-1) 3+1
-2 1
1 2
∆ 3,1 = (-2 2-1 1) = -5

·
3
-2
-1

X T = (1,0,1)
x 1 = -21 / -21 = 1
x 2 = 0 / -21 = 0
x 3 = -21 / -21 = 1
Examination:
2 1+3 0+1 1 = 3
-2 1+1 0+0 1 = -2
1 1+2 0+-2 1 = -1

The online calculator solves the system linear equations matrix method. It is given very detailed solution. To solve a system of linear equations, select the number of variables. Choose a method for calculating the inverse matrix. Then enter the data in the cells and click on the "Calculate" button.

×

Warning

Clear all cells?

Close Clear

Data entry instructions. Numbers are entered as integers (examples: 487, 5, -7623, etc.), decimals (ex. 67., 102.54, etc.) or fractions. The fraction must be entered in the form a/b, where a and b are integers or decimals. Examples 45/5, 6.6/76.4, -7/6.7, etc.

Matrix method for solving systems of linear equations

Consider the following system of linear equations:

Given the definition of an inverse matrix, we have A −1 A=E, Where E- identity matrix. Therefore (4) can be written as follows:

Thus, to solve the system of linear equations (1) (or (2)), it is enough to multiply the inverse of A matrix per constraint vector b.

Examples of solving a system of linear equations using the matrix method

Example 1. Solve the following system of linear equations using the matrix method:

Let's find the inverse of matrix A using the Jordan-Gauss method. On the right side of the matrix A Let's write the identity matrix:

Let's exclude the elements of the 1st column of the matrix below the main diagonal. To do this, add lines 2,3 with line 1, multiplied by -1/3, -1/3, respectively:

Let's exclude the elements of the 2nd column of the matrix below the main diagonal. To do this, add line 3 with line 2 multiplied by -24/51:

Let's exclude the elements of the 2nd column of the matrix above the main diagonal. To do this, add line 1 with line 2 multiplied by -3/17:

Separate right side matrices. The resulting matrix is inverse matrix To A :

Matrix form of writing a system of linear equations: Ax=b, Where

Let's calculate all algebraic complements of the matrix A:

,
,
,
,
,
,
,
,
.

The inverse matrix is ​​calculated from the following expression.

Consider a system of linear equations with many variables:

where aij are coefficients for unknown xi; bi-free members;

indices: i = 1,2,3...m - determine the number of the equation and j = 1,2,3...n - the number of the unknown.

Definition: The solution to the system of equations (5) is a set of n numbers (x10, x20,....xn0), upon substitution of which into the system all equations turn into correct numerical identities.

Definition: A system of equations is called consistent if it has at least one solution. A joint system is called definite if it has a unique solution (x10, x20,....xn0), and indefinite if there are several such solutions.

Definition: A system is called inconsistent if it has no solution.

Definition: Tables composed of numerical coefficients (aij) and free terms (bi) of the system of equations (5) are called the system matrix (A) and the extended matrix (A1), which are denoted as:

Definition: A matrix of system A, having an unequal number of rows and columns (n? m), is called rectangular. If the number of rows and columns is the same (n=m), then the matrix is ​​called square.

If the number of unknowns in a system is equal to the number of equations (n=m), then the system has a square matrix of the nth order.

Let us select k-arbitrary rows and k-arbitrary columns (km, kn) in matrix A.

Definition: The k-order determinant, composed of elements of matrix A located at the intersection of selected rows and columns, is called the k-order minor of matrix A.

Let's consider all possible minors of matrix A. If all minors of (k+1)-order are equal to zero, and at least one of the minors of k-order is not equal to zero, then the matrix is ​​said to have rank equal to k.

Definition: The rank of a matrix A is the highest order of the non-zero minor of this matrix. The rank of a matrix is ​​denoted by r(A).

Definition: Any non-zero minor of a matrix whose order is equal to rank matrix is ​​called basic.

Definition: If for two matrices A and B their ranks coincide r(A) = r(B), then these matrices are called equivalent and are denoted A B.

The rank of the matrix will not change from elementary, equivalent transformations, which include:

  • 1. Replacing rows with columns, and columns with corresponding rows;
  • 2. Rearranging rows or columns;
  • 3. Crossing out rows or columns whose elements are all zero;
  • 4. Multiplying or dividing a row or column by a number other than zero;
  • 5. Adding or subtracting elements of one row or column from another, multiplied by any number.

When determining the rank of a matrix, equivalent transformations are used, with the help of which the original matrix is ​​reduced to a step (triangular) matrix.

In a step matrix, under the main diagonal there are zero elements, and the first non-zero element of each row, starting from the second, is located to the right of the first non-zero element of the previous row.

Note that the rank of a matrix is ​​equal to the number of non-zero rows of the echelon matrix.

For example, the matrix A= is of a stepped form and its rank is equal to the number of non-zero rows of the matrix r(A)=3. Indeed, all 4th order minors with zero elements of the 4th row are equal to zero, and 3rd order minors are nonzero. To check, we calculate the determinant of the minor of the first 3 rows and 3 columns:

Any matrix can be reduced to a step matrix by zeroing the matrix elements under the main diagonal using elementary actions.

Let's return to the study and solution of the system of linear equations (5).

The Kronecker-Kapeli Theorem plays an important role in the study of systems of linear equations. Let us formulate this theorem.

Kronecker-Kapeli theorem: A system of linear equations is consistent if and only if the rank of the system matrix A is equal to the rank of the extended matrix A1, i.e. r(A)=r(A1). In the case of consistency, the system is definite if the rank of the system matrix is ​​equal to the number of unknowns, i.e. r(A)=r(A1)=n and undefined if this rank is less than the number of unknowns, i.e. r(A)= r(A1)

Example. Explore a system of linear equations:

Let us determine the ranks of the system matrix A and the extended matrix A1. To do this, we will compose an extended matrix A1 and reduce it to a stepwise form.

When reducing the matrix, we perform the following actions:

  • 2) subtract from lines 3 and 4 the 1st line multiplied by 4;
  • 3) multiply the 4th line by (-1) and swap places with the 2nd line;
  • 4) add 3 and 4 lines with the 2nd line, multiplied by 5 and 4, respectively;
  • 5) subtract the 3rd from the 4th line and cross out the 4th line with zero elements.

As a result of the performed actions, we obtained a step matrix with three non-zero rows both in the system matrix (up to the line) and in the extended matrix. This shows that the rank of the system matrix is ​​equal to the rank of the extended matrix and is equal to 3, but less than the number of unknowns (n=4).

Answer: because r(A)=r(A1)=3

Due to the fact that it is convenient to determine the rank of matrices by reducing them to stepwise form, we will consider a method for solving a system of linear equations using the Gaussian method.

Gaussian method

The essence of the Gauss method is the sequential elimination of unknowns by reducing the extended matrix A1 to a stepwise form, which includes the matrix of the system A up to the line. In this case, the ranks of the matrices A, A1 are simultaneously determined and the system is studied using the Kronecker-Kapeli theorem. At the last stage, a system of stepwise equations is solved, making substitutions from bottom to top of the found values ​​of the unknowns.

Let us consider the application of the Gauss method and the Kronecker-Kapeli theorem using an example.

Example. Solve the system using the Gaussian method:

Let us determine the ranks of the system matrix A and the extended matrix A1. To do this, we will compile an extended matrix A1 and reduce it to a stepwise form. When casting, perform the following actions:

  • 1) subtract the 1st line from the 2nd line;
  • 2) subtract from the 3rd line the 1st line multiplied by 2;
  • 3) divide the 2nd line by (-2), and multiply the 3rd line by (-1) and swap them.

We have obtained a step matrix in which the number of rows is 3, and the system matrix (up to the line) also has no zero entries. Consequently, the ranks of the system matrix and the extended matrix are equal to 3 and equal to the number of unknowns, i.e. r(A)=r(A1)=n=3.. According to the Kronecker-Kapeli theorem, the system is consistent and defined, and has a unique solution.

As a result of transforming matrix A1, zeroing out the coefficients of the unknowns, we successively excluded them from the equations and obtained a stepwise (triangular) system of equations:

Moving sequentially from bottom to top, substituting the solution (x3=1) from the third equation into the second, and the solutions (x2=1, x3=1) from the second and third equations into the first, we obtain a solution to the system of equations: x1=1, x2=1, x3=1.

Check: -(!) Answer: (x1=1, x2=1, x3=1).

Jordano-Gauss method

This system can be solved by the improved Jordano-Gauss method, which consists in the fact that the matrix of the system A in the extended matrix (up to the line) is reduced to the identity matrix: E= with unit diagonal and zero non-diagonal elements and immediately obtain a solution to the system without additional substitutions.

Let us solve the system considered above using the Jordano-Gauss method. To do this, we transform the resulting step matrix into a unit matrix by performing the following steps:

  • 1) subtract the 2nd line from the 1st line;
  • 2) add the 3rd line to the 1st line, multiplied by 3;
  • 3) subtract from the 2nd line the 3rd line, multiplied by 4.

The original system of equations has been reduced to the system:, which determines the solution.

basic operations with matrices

Let two matrices be given: A= B=.

  • 1. Matrices are equal A=B if their elements of the same name are equal:aij=bij
  • 2. The sum (difference) of matrices (A ± B) is a matrix defined by the equality:

When summing (subtracting) matrices, their elements of the same name are added (subtracted).

3. The product of the number k and the matrix A is the matrix defined by the equality:

When a matrix is ​​multiplied by a number, all elements of the matrix are multiplied by that number.

4. The product of matrices AB is a matrix defined by the equality:

When multiplying matrices, the elements of the rows of the first matrix are multiplied by the elements of the columns of the second matrix and summed, and the element of the product matrix in the i-th row and j-th column is equal to the sum of the products of the corresponding elements of the i-th row of the first matrix and the j-th column second matrix.

When multiplying matrices in the general case, the commutative law does not apply, i.e. AB?VA.

5. Transposing matrix A is an action that results in replacing rows with columns and columns with corresponding rows.

The matrix AT= is called the transposed matrix for the matrix A=.

If the determinant of matrix A is not equal to zero (D?0), then such a matrix is ​​called non-singular. For any non-singular matrix A, there is an inverse matrix A-1, for which the equality holds: A-1 A= A A-1=E, where E= is the identity matrix.

6. Inversion of matrix A is such actions that result in the inverse matrix A-1

When inverting matrix A, the following actions are performed.

Equations in general, linear algebraic equations and their systems, as well as methods for solving them, occupy a special place in mathematics, both theoretical and applied.

This is due to the fact that the vast majority of physical, economic, technical and even pedagogical problems can be described and solved using a variety of equations and their systems. Recently, mathematical modeling has gained particular popularity among researchers, scientists and practitioners in almost all subject areas, which is explained by its obvious advantages over other well-known and proven methods for studying objects of various natures, in particular, the so-called complex systems. There is a great variety of different definitions of a mathematical model given by scientists at different times, but in our opinion, the most successful is the following statement. A mathematical model is an idea expressed by an equation. Thus, the ability to compose and solve equations and their systems is an integral characteristic of a modern specialist.

To solve systems of linear algebraic equations, the most commonly used methods are Cramer, Jordan-Gauss and the matrix method.

Matrix solution method is a method for solving systems of linear algebraic equations with a nonzero determinant using an inverse matrix.

If we write out the coefficients for the unknown quantities xi in matrix A, collect the unknown quantities in the vector column X, and the free terms in the vector column B, then the system of linear algebraic equations can be written in the form of the following matrix equation A · X = B, which has a unique solution only when the determinant of matrix A is not equal to zero. In this case, the solution to the system of equations can be found in the following way X = A-1 · B, Where A-1 is the inverse matrix.

The matrix solution method is as follows.

Let us be given a system of linear equations with n unknown:

It can be rewritten in matrix form: AX = B, Where A- the main matrix of the system, B And X- columns of free terms and solutions of the system, respectively:

Let's multiply this matrix equation from the left by A-1 - matrix inverse of matrix A: A -1 (AX) = A -1 B

Because A -1 A = E, we get X=A -1 B. The right side of this equation will give the solution column of the original system. The condition for the applicability of this method (as well as the general existence of a solution to an inhomogeneous system of linear equations with the number of equations equal to the number of unknowns) is the nondegeneracy of the matrix A. A necessary and sufficient condition for this is that the determinant of the matrix is ​​not equal to zero A:det A≠ 0.

For a homogeneous system of linear equations, that is, when the vector B = 0 , the opposite rule is true: the system AX = 0 has a non-trivial (that is, non-zero) solution only if det A= 0. Such a connection between solutions of homogeneous and inhomogeneous systems of linear equations is called the Fredholm alternative.

Example solutions to an inhomogeneous system of linear algebraic equations.

Let us make sure that the determinant of the matrix, composed of the coefficients of the unknowns of the system of linear algebraic equations, is not equal to zero.

The next step is to calculate the algebraic complements for the elements of the matrix consisting of the coefficients of the unknowns. They will be needed to find the inverse matrix.



error: Content protected!!