Solving Systems of Equations using Matrices

advertisement
Solving Systems of Equations using Matrices
A common application of statics is the analysis of structures, which generally involves computing a large number of forces or moments. For instance,
say we would like to determine the tensile or compressive force in each member of a truss (e.g. a railroad bridge). Applying the basic static equilibrium
P
P ~
equations ( F~ = 0,
M = 0) to each member or connection point yields
a set (or ”system”) of linear equations, which can usually be solved for each
of the unknown variables. A simple example will be used to illustrate the
matrix formulation and solution.
Figure 1: Simply Supported Beam
Figure 1 shows a simply supported beam with an applied force of 100 N
and two reaction forces R1 and R2 . Unknown are the two reaction forces.
Our goal will be to formulate the system equations, find the equivalent matrix
representation, and then solve for the unknowns using two different methods.
1
1
Formulate the System of Equations
The matrix solution is not magical – we still have to get from the problem
statement to a set of linear equations. This first requires identifying the
number of unknown quantities we want to solve for. Given n unknowns,
then, we must come up with n independent equations in order to solve for
everything.
Need n independent equations to solve for n unknowns
A set of n linear equations, each involving n unknowns is shown below
in Eq. 1. The coefficients (aij ) are scalar (as opposed to vector) values and
must be determined ahead of time (e.g. by applying equilibrium equations
to a structure). The unknowns (xi ) are what you’re trying to solve for. The
solutions (bi ) are either given in the problem statement or determined by
basic static analysis.
a11 x1 + a12 x2 + · · · + a1n xn = b1
a21 x1 + a22 x2 + · · · + a2n xn = b2
..
.
an1 x1 + an2 x2 + · · · + ann xn = bn
(1)
In our example there are two unknowns, namely the two reaction forces R1
and R2 . Therefore, we need to find two (independent) equations to solve for
both values. Summing forces in the positive y-direction (they’re all aligned
with the y-axis in this case), we arrive at the first equation:
R1 + R2 = 100
(2)
Summing moments about the left end of the beam, we arrive at the second
equation:
5 · R2 = 2 · 100
(3)
Eqs. 2 and 3 now represent a system of equations:
R1 + R2 = 100
5 · R2 = 200
Or, to be more general:
1 · R1 + 1 · R2 = 100
0 · R1 + 5 · R2 = 200
2
(4)
2
Find the Equivalent Matrix Representation
The system of equations in Eq. 1 can be represented by a matrix equation,
as shown in Eq. 5. The coefficients aij from Eq. 1 are placed in an n × n
matrix which is then multiplied by a n × 1 column vector of the unknowns
xi and set equal to a n × 1 vector of the answers bi .


 

a11 a12 · · · a1n
x1
b1
 a21 a22 · · · a2n   x2   b2 


 

(5)
 ..
..
..   ..  =  .. 
.
.
 .
.
.
.  .   . 
an1 an2 · · · ann
xn
bn
Eq. 5 can also be written as:
Ax = b
(6)
where



A = 




x = 




b = 

a11 a12 · · · a1n
a21 a22 · · · a2n
..
..
..
...
.
.
.
an1 an2 · · · ann

x1
x2 

.. 
. 
xn

b1
b2 

.. 
. 
bn





Eq. 6 is a simple matrix equation of dimension n. It can now be solved
directly for the unknown variables xi by any of a number of different methods.
In our example, we begin by rewriting the system of equations given by
Eq. 4:
1 · R1 + 1 · R2 = 100
0 · R1 + 5 · R2 = 200
3
First, the coefficients multiplying the unknowns are placed in to the matrix A as follows:
1 1
A=
0 5
Next, the unknowns are collected in the vector x:
R1
x=
R2
Finally, the solutions form the vector b:
100
b=
200
Then the equivalent matrix representation of Eq. 4 is given by:
1 1
R1
100
=
0 5
R2
200
3
3.1
(7)
Solve the Matrix Equation
Matrix Inversion
The most straightforward method of solving the matrix equation given by
Eq. 6 is to rearrange the equation so that the vector of unknowns (x) is left
on one side of the equals sign.
Starting from Eq. 6, Ax = b, we multiply both sides of the equals sign by
the inverse of A. It is important to realize that the inverse of a matrix cannot
(in general) be found by taking the reciprocal of each element – rather, it
is typically performed by a computer, especially for systems of 3 or more
equations.
A−1 Ax = A−1 b
(8)
Now this looks a little more complicated at first, except that the left hand
side of the equation can be simplified by noting that A−1 A = I, where I is
the identity matrix (ones down the diagonal and zeros everywhere else). The
identity matrix, which is basically the matrix equivalent of the number 1,
has the nice property that it doesn’t change a vector under multiplication.
That is, Ix = xI = x for all x. Therefore, Eq. 8 reduces to:
x = A−1 b
4
(9)
This can now be entered into a calculator and the solution will be a vector
of the n unknowns.
In the beam example, we begin with the matrix equation:
1 1
R1
100
=
0 5
R2
200
The inverse of A is found either by hand or by using a calculator:
1 −1/5
−1
A =
0 1/5
A−1 is then substituted into Eq. 9 and post-multiplied by b to obtain:
−1
x = A
b
1 −1/5
100
=
0 1/5
200
1 · 100 + (−1/5) · 200
=
0 · 100 + (1/5) · 200
60
=
40
Therefore, the reaction forces in the case of the simply supported beam
of Figure 1 are given by:
R1 = 60N
R2 = 40N
3.2
Row Reduction
The other method of finding the solution, x, is to systematically reduce the
equations until you’re left with a value for each variable. Doing this by hand
can be tedious for large matrices (anything bigger than 2x2, in my opinion). If
you reduce a large matrix by hand, it’s possible you’ll make a small algebraic
mistake due to the large number of calculations involved. Fortunately, we
have computers and calculators, which can reduce a matrix automatically,
sparing you the trouble.
The matrix reduction technique works as follows: We construct an augmented matrix consisting of the original A-matrix side by side with the col-
5
umn vector of answers, b:






a11 a12 · · · a1n b1
a21 a22 · · · a2n b2 

.. 
..
..
..
...
. 
.
.
.
an1 an2 · · · ann bn
(10)
This augmented matrix can be systematically reduced using the same
technique as you are used to doing by hand (i.e. adding or subtracting multiples of one row from another row to eliminate variables, until all variables
have been solved for). This is called Gaussian elimination. In the end, provided your equations are linearly independent, you should end up with a
matrix that looks like:


1 0 · · · 0 x1
 0 1 · · · 0 x2 


(11)
 .. .. . . .. .. 
 . .
. . . 
0 0 · · · 1 xn
where x1 , x2 , . . . xn is the solution set to your original set of equations.
Eq. 11 represents the augmented matrix in Row Reduced Echelon Form, or
RREF.
In the beam example, we begin by constructing the augmented (nonreduced) matrix:
1 1 100
0 5 200
Now we can reduce this matrix to RREF in only two operations. First,
we divide row 2 by 5 to yield a 1 in the lower diagonal position. This gives:
1 1 100
0 1 40
Then we subtract row 2 from row 1 to form the new row 1. This results
in:
1 0 60
(12)
0 1 40
Eq. 12 says that 1 times R1 equals 60, and 1 times R2 equals 40. In other
words, R1 = 60N and R2 = 40N , which is exactly what we found using the
matrix inversion approach.
6
4
Using a Calculator to Solve Systems of Equations
Most graphing calculators can solve systems of equations. This includes:
HP’s, TI-81, 82, 83, 85, 86, 89, 92. The syntax for each calculator is different, so I’ve provided links to websites which document how to find an inverse
of a matrix and compute row-reduced echelon form on several different kinds
of calculators.
Matrix Inversion:
• TI-81 and TI-82
• TI-83
• TI-85
• TI-86
• TI-89 and TI-92
• HP
Row Reduction:
• TI-81 and TI-82 (source code for program to do RREF)
• TI-83
• TI-85
• TI-86
• TI-89 and TI-92
• HP
7
Download