Vous êtes sur la page 1sur 34

TOPIC 2

Systems of Linear
Algebraic Equations

1
Copyright © 2006 The McGraw-Hill Companies, Inc. Permission required for reproduction or display.
• Problems are similar in spirit as to roots of
equations,
• Values that satisfy simultaneously a set of
linear algebraic equations,

Chapter 11 2
Copyright © 2006 The McGraw-Hill Companies, Inc. Permission required for reproduction or display.
Lesson Outcomes
Student will be able to:

• identify the different methods to solve


simultaneously set of linear algebraic
equations.
• Formulate set of equations that relate to the
problem.
• Apply and solve engineering problems.

3
Copyright © 2006 The McGraw-Hill Companies, Inc. Permission required for reproduction or display.
Linear Algebraic Equations
• An equation of the form ax+by+c=0 or equivalently
ax+by=-c is called a linear equation with x and y variables.
• ax+by+cz=d is a linear equation in three variables, x, y,
and z.
• Thus, a linear equation in n variables is
a1x1+a2x2+ … +anxn = b
• A solution of such an equation consists of real numbers
c 1 , c2 , c3 , … , c n .
• If need to work more than one linear equations, a system
of linear equations must be solved simultaneously.

Copyright © 2006 The McGraw-Hill Companies, Inc. Permission required for reproduction or display.
Non-computer Methods for
Solving Systems of Equations
• For small number of equations (n ≤ 3) linear
equations can be solved readily by simple
techniques such as “method of elimination.”
• Linear algebra provides the tools to solve such
systems of linear equations.
• Nowadays, easy access to computers makes
the solution of large sets of linear algebraic
equations possible and practical.

Copyright © 2006 The McGraw-Hill Companies, Inc. Permission required for reproduction or display.
Fig. pt3.5

Copyright © 2006 The McGraw-Hill Companies, Inc. Permission required for reproduction or display.
Gauss Elimination
Solving Small Numbers of Equations
• There are many ways to solve a system of
linear equations:
– Graphical method
– Cramer’s rule For n ≤ 3
– Method of elimination
– Computer methods

Copyright © 2006 The McGraw-Hill Companies, Inc. Permission required for reproduction or display.
Graphical Method
• For two equations:
a11 x1 a12 x2 b1
a21 x1 a22 x2 b2
• Solve both equations for x2:
a11 b1
x2 x1 x2 (slope)x1 intercept
a12 a12
a21 b2
x2 x1
a22 a22

Copyright © 2006 The McGraw-Hill Companies, Inc. Permission required for reproduction or display.
• Plot x2 vs. x1 Fig. 9.1

on rectilinear
paper, the
intersection
of the lines
present the
solution.

Copyright © 2006 The McGraw-Hill Companies, Inc. Permission required for reproduction or display.
Figure 9.2: Singular or Ill-conditioned systems;
(a) No solution, (b) infinite solution, (c) ill-conditioned; where slopes are
so close and not easily detected

10
Copyright © 2006 The McGraw-Hill Companies, Inc. Permission required for reproduction or display.
REVISION

Matrix of n by m
(row by column)
or i by j (aij )

11
Copyright © 2006 The McGraw-Hill Companies, Inc. Permission required for reproduction or display.
Revision

Copyright © 2006 The McGraw-Hill Companies, Inc. Permission required for reproduction or display.
Gauss Elimination
Consider a 3 set of equations of 3 unknowns:
a11 x1 + a12 x2 + a13 x3 = c1 …. Eqn1

a21 x1 + a22 x2 + a23 x3 = c2 …. Eqn 2


a x1 + a32 x2 + a33 x3 = c3
31 …. Eqn 3

In Matrix form:

13
Copyright © 2006 The McGraw-Hill Companies, Inc. Permission required for reproduction or display.
Naive Gauss Elimination Method

• Extension of method of elimination to large sets


of equations by developing a systematic scheme
or algorithm to eliminate unknowns and to back
substitute.
• As in the case of the solution of two equations,
the technique for n equations consists of two
phases:
– Forward elimination of unknowns
– Back substitution

Copyright © 2006 The McGraw-Hill Companies, Inc. Permission required for reproduction or display.
The equations are presented in terms of an
augmented matrix:
Row 1 (or R1)
…R2
…R3

Note : x1, x2, x3 are unknowns ~ they do not appear in


the augmented matrix.
aij, ci are the coefficients.
Augmentation: to add column (or columns) to the
original matrix so that we can perform the operations
on one single matrix instead on two individual
matrices.
15
Copyright © 2006 The McGraw-Hill Companies, Inc. Permission required for reproduction or display.
Phases of Gauss Elimination

1. R1 & R2,
R1 & R3
2. R2 & R3

Copyright © 2006 The McGraw-Hill Companies, Inc. Permission required for reproduction or display.
Objectives:
• To make matrix into an upper triangular type: i.e.
elements a21 = 0, a31 = 0 and a32 = 0.
• All elements in R1 will be the pivot elements.
• To make a21 = 0 (in R2), a11 in R1must be
factored and then eliminated from that element
a21. The easiest would be multiplying the
coefficient of a21 and dividing by coefficient a11.
This is Forward Elimination.

17
Copyright © 2006 The McGraw-Hill Companies, Inc. Permission required for reproduction or display.
1. Forward Elimination
• Reduce the set of equations to an UPPER
triangular system,
• Initial step: eliminate the 1st unknown x1
from the second set through the nth
equations.
To do this: Multiply Eqn. 1 by a21/a11 to
give:
a 21 a 21 a 21
a 21 x1 a12 x 2 ... a1n x n c1 Eqn 1a
a11 a11 a11

Copyright © 2006 The McGraw-Hill Companies, Inc. Permission required for reproduction or display.
Then, Subtract : *Eqn 2 – Eqn 1a

a 21 a 21 a 21
a 22 a12 x2 ... a1n x n c2 c1
a11 a11 a11

OR: a’22 x2 + ….+ a’2n xn = c’2

**Procedure is repeated for the remaining


equations, e.g. Eqn 1 multiplied by a31/a11 and
result is subtracted from third equation (Eqn 3)
Summary : Step 1: *R1 and R2; **R1 and R3
Step 2: R2 and R3 19
Copyright © 2006 The McGraw-Hill Companies, Inc. Permission required for reproduction or display.
2. Back Substitution
Once all equations have been eliminated, the
system will have been transformed to an UPPER
triangular system, finally
solve for xn: cn
n 1
xn
n 1
a nn

The result can be back-substituted into the (n-1)th


eqn. to solve for xn-1
n
cii 1
aiji 1
xj For i = n-1, n-2, … 1
j i 1
xi i 1
a ii

Copyright © 2006 The McGraw-Hill Companies, Inc. Permission required for reproduction or display.
Solution:
In augmented matrix:

3 – 0.1 - 0.2 : 7.85 …R1


0.1 7 - 0.3 : - 19.3 …R2
0.3 – 0.2 10 : 71.4 …R3
To make all these
elements as zeros 21
Copyright © 2006 The McGraw-Hill Companies, Inc. Permission required for reproduction or display.
For a21 = 0, R1 factored by a21/a11
R2 - (0.1/3)R1:
a21 = 0.1 – [(0.1/3)* 3] = 0
a22 = 7 – [(0.1/3) * (-0.1)] = 7.00333

Similarly, determine a32 and c2


To make a31 = 0 (in R3)
Again, use a11 in R1 as pivot element,
Thus, R3 – (0.3/3)*R1: Now R1 factored
by a31/a11
a31 = 0.3 – [(0.3/3)* 3] = 0
a32 = - 0.2 – [(0.3/3)* (-0.1)] = - 0.190000
a33 = 10 – [(0.3/3)*(-0.2)] = 10.020000
Determine for a33 and c3 22
Copyright © 2006 The McGraw-Hill Companies, Inc. Permission required for reproduction or display.
…R1’
...R2’
…R3’

Need to do another process


to make a32 = 0 in R3;
Use R2’ as pivot elements
…R1’’
...R2’’
…R3’’

From R3”,
10.0120 x3 = 70.0843
x3 = 70.0843/ 10.0120
= 7.0000
23
Copyright © 2006 The McGraw-Hill Companies, Inc. Permission required for reproduction or display.
Back substitution in R2” :

R1” :

24
Copyright © 2006 The McGraw-Hill Companies, Inc. Permission required for reproduction or display.
Pitfalls of Elimination Methods
1. Division by zero ~ it is possible that a
division by zero can occur. This gives a
technique of “pivoting”.
2. Round-off Errors ~ Use of significant
figures; important for very large numbers
of equations to be solved.
3. Ill-conditioned systems ~ Very small
changes in coefficients will result in large
changes in the solution.

Copyright © 2006 The McGraw-Hill Companies, Inc. Permission required for reproduction or display.
4. Singular systems. When two equations are
identical, one degree of freedom can be lost and
dealing with the impossible case of n-1 equations
for n unknowns. For large sets of equations, it
may not be obvious.
The determinant of a singular system is zero can
be used and tested by computer algorithm after
the elimination stage. If a zero diagonal element
is created, calculation is terminated.

Copyright © 2006 The McGraw-Hill Companies, Inc. Permission required for reproduction or display.
Techniques for Improving Solutions
• Use of more significant figures.
• Pivoting. If a pivot element is zero, normalization
step leads to division by zero. The same
problem may arise, when the pivot element is
close to zero. Problem can be avoided:
– Partial pivoting. Switching the rows so that the largest
element is the pivot element.
– Complete pivoting. Searching for the largest element
in all rows and columns then switching.

Copyright © 2006 The McGraw-Hill Companies, Inc. Permission required for reproduction or display.
With pivoting
To avoid division by zero;
~ determine the largest coefficient in the
column below the pivot (usually the a11)
element.
~ Rows can be switched, so that the largest
element is the PIVOT element (called
Partial pivoting)~ See Example 9.9
~ If involved both columns and rows, it is
called complete pivoting. (This is rare as it
may disturb the order of the x’s, i.e. x1 can
be interchange with x2 etc.).
Copyright © 2006 The McGraw-Hill Companies, Inc. Permission required for reproduction or display.
Gauss-Jordan Method
• It is a variation of Gauss elimination.
• Major differences are:
– When an unknown is eliminated, it is
eliminated from all other equations rather than
just the subsequent ones.
– All rows are normalized by dividing them by
their pivot elements.
– Elimination step results in an identity matrix.
– Consequently, it is not necessary to employ
back substitution to obtain solution.
29
Copyright © 2006 The McGraw-Hill Companies, Inc. Permission required for reproduction or display.
Identity
A x B matrix, thus
find unknown
x

a11 a12 a13 b1 1 0 0 x1


a21 a22 a23  b2 0 1 0  x2
a31 a32 a33 b3 0 0 1 x3

Useful in Simplex method

30
Copyright © 2006 The McGraw-Hill Companies, Inc. Permission required for reproduction or display.
31
Copyright © 2006 The McGraw-Hill Companies, Inc. Permission required for reproduction or display.
See example 9.12 (Text book)

Solution: using Gauss-Jordan method


In augmented matrix:

3 – 0.1 - 0.2 7.85 …R1


0.1 7 - 0.3 - 19.3 …R2
0.3 – 0.2 10 71.4 …R3

Normalise R1, i.e. R1’ = R1 a11,


then eliminate a21 and a31 (to make other elements in column 1 = 0)

R1’ = R1 3
R2’ = R2 – (0.1xR1’)
R3’ = R3 – (0.3xR1’)
32
Normalise R2’ by dividing it by 7.00333 (= a22’ )
Then eliminate a12’ and a32’ (to make other elements in column 2 = 0)

R1’’ = R1’ - (- 0.0333333 x R2” )


R2’’ = R2’ 7.00333
R3” = R3’ - (- 0.19 R2” )

Normalise R3” by dividing it by 10.0210 (= a33” )


Then eliminate a13’’ and a23” (to make other elements in column 3 = 0)

R1’’’ = R1” - (- 0.0680629 x R3’” )


R2’’’= R2” - (- 0.0418848 x R3”’ )
R3’” = R3” 10.0120

33
Copyright © 2006 The McGraw-Hill Companies, Inc. Permission required for reproduction or display.
EXERCISES

Do Problems 9.13, 9.19, 12.13 & 12.14

34
Copyright © 2006 The McGraw-Hill Companies, Inc. Permission required for reproduction or display.

Vous aimerez peut-être aussi