Solving Systems of Equations with Matrices

A system of equations, is any set of equations that share some variables such as the set of three equations shown below.

A system of linear equations
The set of equations above is an example of a system of linear equations.

In courses such as statics and dynamics we will often end up with a system of linear equations and be asked to solve for the unknowns in those equations. When we have just a few equations in our system, this can easily be done with algebraic methods such as substitution or elimination though addition or subtraction. For larger systems of equations however, the easiest way to solve for the unknowns is to convert the system of equations into a single matrix equation, and then use computer tools to solve the matrix equation.

This method will only work with systems of linear equations. This means that we can only multiply the variables in the equations by a constant. We cannot do things such as raise the variables to a power, have the variables as an exponent, take the log of the variables, or multiply variables together. Any of these operations would make the system of equations non-linear, and will prevent us from converting them to a matrix equation.

Additionally, to have a solvable matrix equation we will need have the same number of equations as unknown variables. For example, above we have a system of equations with three equations and three unknown variables. If these numbers do not match we will not be able to solve the matrix equation later on.

Converting a System of Equations to a Matrix Equation:

The first step in converting a system of equations into a matrix equation is to rearrange the equations into a consistent format. Generally we will put all the variables with their coefficients on one side of the equation and the constants on the other side of the equation. Additionally, it is best to list the variables in the same order in each equation. This process of rearranging the equations will make conversion later on easier.

The matrix conversion process
To convert a system of equations into single matrix equation, we will first rearrange the equations for a consistent order, then we will write out the coefficient (A), variable (X), and constant (B) matrices.

Next we will begin the process of writing out the three matrices that make up the matrix equation. These three matrices are the coefficient matrix (often referred to as the A matrix), the variable matrix (often referred to as the X matrix), and the constant matrix (often referred to as the B matrix).

Once we have the three matrices set up we are ready to solve for the unknowns in the variable matrix.

Solving the Matrix Equation:

Starting with our A, X, and B matrices in the matrix equation below, we are looking to solve for for values of the unknown variables that are contained in our X matrix.

The matrix equation

For a scalar equation, we would simply do this by dividing both sides by A, where the value for X would be B/A. With matrix equation we will instead need to multiple both sides of the equation by the inverse of the A matrix. This will cancel out the A matrix on the left side, leaving only the X matrix that you are looking for. This means that multiplying the inverse of the A matrix times the B matrix will give you a 1 x N matrix containing the solution for all the variables. The value each row of the solution will correspond to the variable listed in the same row of the X matrix.

Solving the matrix equation

It is possible to find the inverse of the A matrix by hand and to multiply this by hand with the B matrix, but using computer tools such as MATLAB or the Matrix Equation Solver in the panel on the left will make these calculations far easier.

Worked Problems:

Question 1:

The equilibrium equations for the body shown below are listed on the right. Convert the system of equations into a single matrix equation and solve for the unknowns.

Problem 1 Diagram