You are on page 1of 15

Chapter 4: Direct Methods

for Solving Linear Equations


Systems

PEDRO FERNANDO QUIROGA


NOVOA

Escuela de Ingeniería de Petróleos

UNIVERSIDAD INDUSTRIAL DE
SANTANDER
Direct Methods for Solving 1. Background:

Linear Equations Systems

 Background.

 Simple Gauss

 Gauss-Jordan Elimination:

 LU Decomposition.  Symmetric Matrix: A matrix is symmetric, if is a


square matrix (m = n) anda ij=a ji , for all i, j =1, 2,
3 … n.
3 1 2
Example: A = 1 7 6
2 6 5
Note that the symmetry is about the main calculated using known simple rules. The
diagonal and that A is also the matrix transpose determinant of a matrix of order 2.
of itself: At = A . a11 a12
A=
( a21 a22 )
 Transposed matrix: Let A be a matrix with m det ( A )=| A|=a11 a22−a 12 a21
rows and n columns. The matrix transpose,
denoted by At is given by A determinant of order 3 is given by the
¿
Sarrus`s rule.
a11 a12 a 13
Example:
1 2
1 3 5
|a 21 a22 a 23 =¿
a31 a32 a 33 |
a 11 ( a22 a 33−a23 a32 )−a 12 ( a 21 a33−a23 a 31)
A = 3 4 At =2 4 6
5 6 +a 13 ( a 21 a32−a22 a31 )

 Determinant: The concept of determining or


Example:
targeted volume was introduced to study the
number of solutions of linear systems of 3 1 2

equations.
A = | |
1 7 6 ¿ 3 ( 35−36 )−1 ( 5−12 ) +2 ( 6−14 )=−12
2 6 5
The case of matrices of lower orders (order 2
or 3) is so simple that its determinant is
 Triangular matrix: A special kind of square
matrix whose elements above or below its
main diagonal are zero. . Because the systems
of linear equations in triangular matrices are
much easier to solve, the triangular matrices
are used in numerical analysis for solving
systems of linear equations, calculate inverse  Banded matrix: In mathematics, a matrix is
matrices and determinants. called matrix band or bands where a matrix is
non-zero values are confined in an
A square matrix of order n is said to be upper environment of the main diagonal, forming a
triangular if it is of the form: band of non-zero values which complement
the main diagonal of the matrix and more
diagonals in each of its sides.

Example: a 11 a 12 0 0

a 21 a22 a 23 0

0 a32 a3 3 a 34
Similarly, is said to be a lower triangular matrix
if it is of the form: 0 0 a 43 a44
The above matrix has a bandwidth of 3 and is represent the coefficients and constants of each
named special tridiagonal matrix. equation. Example:

 Augmented matrix: The matrix increased, or


expanded matrix, a matrix is obtained by x +2 y +3 z =0
combining two matrices {
3 x+ 4 y +7 z=2
6 x+5 y +9 z=11
Example: 1 2 3 0
A=3 4 7 B= 2
1 3 2 4
A=2 0 1 B=3 6 5 9 11
5 2 2 1 1 2 30
( A∨B)= 3 4 7 2
The augmented matrix (A | B) is represented as 6 5 9 11
follows
 Matrix multiplication: Given two matrices A
1 3 24
( A∨B)= 2 0 1 3
and B, such that the number of columns of the
5 2 21 matrix A equals the number of rows of the
This notation is useful for solving systems of matrix B, ie:
linear equations given by square matrices. In A=(a ij )m ×n y B=( aij )n × p

linear algebra, the augmented matrix is used to The multiplication of A by B, denoted A • B, A × B


or simply AB, is defined as:
AB=( c ij )m × p

( 1∗1+2∗4 ) ( 1∗2+ 2∗5 ) ( 1∗3+ 2∗6 )


Where each element c ij is defined by: AB=( 3∗1+ 4∗4 ) ( 3∗2+ 4∗5 ) ( 3∗3+ 4∗6 )
n ( 5∗1+6∗4 ) ( 5∗2+ 6∗5 ) ( 5∗3+ 6∗6 )
c ij =∑ a ir b rj
r =1 9 12 15
AB=19 26 33
29 40 51

2. Simple Gauss:
The Gauss`s method, also known as single-
elimination of Gauss`s method, to solve systems
of equations includes two phases:
Example:
1 2 • Elimination of the unknowns ahead
A=3 4 B= 1 2 3 • Back substitution.
4 5 6
5 6
It begins by removing the first unknown x1 from
the second equation to the nth. To this end, we
a21
multiply the first row of the matrix by a . This
11

equation is subtracted from the second row of


the matrix.
This process is repeated for the remaining rows of
the matrix. For example, to eliminate the first
unknown x1, the third equation of the system, it is
subtracted from the product of the first row of
a31
the matrix by a . Repeat with the remaining
11
The first phase aims to reduce the original system
equations of the system.
to upper triangular form. For example, for a
system of n equations in n unknowns to be In this first set of operations performed for the
represented by the following augmented matrix: two equations to n, we say that the first equation
of system is the pivotal equation and the
coefficient a11, is known as coefficient or pivot
element. It is common to refer to the process of
eliminating unknowns ahead with the name of
standardization of a system of equations.
Once the system has eliminated the first
unknown x1 from the second equation to the nth,
we proceed to eliminate the second unknown x2
from the third equation of the system to the nth,
thus making the system follows:

Difficulties:

• Division by zero:
The Gauss method is called simple because for
The second phase of Gaussian elimination, is that, the knockout stages and back substitution is
once it has obtained an upper triangular matrix likely to occur a division by zero. For example in
operations through standardization, perform the the system:
2 y +3 z=12
back substitution. This process begins clearing xn
3 x +4 y+ 7 z=2
of the last equation. 6 x +5 y+ 9 z=11
This result is replaced back into the equation n-1 In the normalization of the first line will be a
of the modified final. This procedure is repeated division between a 11=0
for the remaining x.  Rounding errors:
Errors can occur in system performance due to Example
the use of a few significant figures. If using 2 x+ 4 y +6 z=18
decimals instead of fractions the results would be 4 x+5 y +6 z=24
accurate. The problem of rounding errors is 3 x+ y−2 z=4
particularly important when it comes to solving a
large number of equations. Because each
outcome depends on the previous spread so
errors in each step. 2 4 6 18
[ 4 5 6 ⌈ 24 ¿¿
3 1 −2 4
Elimination of x in the second row
4
 ill-conditioned systems: [ 2 x +4 y+ 6 z=18 ]
2

Well conditioned systems are those in which a 4 x+ 8 y +12 z=36

small change in one or more coefficients leads to


a similarly small change in the solution. Ill- 4 x+5 y +6 z=24
conditioned systems are those in which small −( 4 x+ 8 y +12 z=36 )
changes in coefficients generate large changes in −3 y−6 z=−12
the solution, or when a wide range of results can
satisfy the equations approximately.
Elimination of x in the third row
3 −(−5 y−10 z=−20 )
[ 2 x + 4 y +6 z=18 ]
2 z=3
3 x+ 6 y+ 9 z=27

3 x+ y−2 z=4

−( 3 x+ 6 y+ 9 z=27 )

−5 y−11 z=−23 2 4 6 18 have

Obtained:
z=3
[
By back substitution
⌈ ¿¿
0 −3 −6 −12
0 0 −1 −3

−3 y−6 z=−12

y=−2

2 x+ 4 y +6 z=18

x=4
Elimination2 of4 6 y18 in

the third row [


0 −3 −6 ⌈ −12 ¿¿
0 −5 −11 −23

5
[ −3 y−6 z=−12 ] 3. Gauss-Jordan Elimination
3
−5 y−10 z=−20 The Gauss-Jordan is a variation of Gauss
elimination. The main difference is that when
−5 y−11 z=−23 one unknown is eliminated in the Gauss-
Jordan method, it is removed from all other
equations. All lines are normalized by dividing x 1term
is eliminated of row 2 and 3 minus row 1
by the pivot element, thereby generating an after being multiplied by a coefficient
identity matrix.
determined.
1 −0.0333 −0.0667 2.61667
Example:
Solve the system using the Gauss-Jordan method.
[ 0 7.0033 −0.2933−19.5617
0 −0.1900 10.020 70.6150 ]
3 x 1−0.1 x 2−0.2 x 3=7.85

0.1 x 1+7 x 2−0.3 x 3=−19.3 The second line is normalized by dividing by 7.0033

0.3 x 1−0.2 x2 +10 x 3=71.4 1 −0.0333 −0.0667 2.61667

3 −0.1 −0.2 7.85 [ 0 1


0 −0.1900
−0.04188 −2.7932
10.020 70.6150 ]
[ 0.1 7 −0.3 −19.3
0.3 −0.2 10 71.4 ] Reducing x 2terms of the first and third row has

Is normalized by obtaining the first line: 1 0 −0.06806 2.52356

1 −0.0333 −0.0667 2.61667


[ 0 1 −0.04188 −2.79320
0 0 10.0120 70.0843 ]
[ 0.1
0.3
7
−0.2
−0.3 −19.3
10 71.4 ]
The third line is normalized by dividing by 10.0120
The steps are:
1 0 −0.06806 2.52356  LU decomposition step. [A] is factored or broken
[ 0 1 −0.04188 −2.79320
0 0 1 7.00003 ] down into lower triangular matrices [L] and upper
[U].
 Substitution step. [L] and [U] are used to determine a
Finally x 3terms are eliminated in the first and second solution [X] for a right side [B]. First ecucion is used to
generate an intermediate vector [D] by replacement
row:
forward. Then the result is substituted into the
1 0 0 3.0000 equation [U] [X] - [D] = 0, which resolves back
[ 0 1 0 −2.50001
0 0 1 7.00003 ] substitution for [X].

Example:
4. LU Decomposition
Solving the system used LU decomposition
LU decomposition methods separate the time spent in 3 x 1−0.1 x 2−0.2 x 3=7.85
the eliminations for the matrix [A] of the operations on 0.1 x 1+7 x 2−0.3 x 3=−19.3
the right side [B]. The strategy for obtaining solutions of 0.3 x 1−0.2 x2 +10 x 3=71.4
a system based on the following equations:
3 −0.1 −0.2
[ A ] [ X ] −[ B ] =0 [ U ] [ X ] −[ D ] =0
[ L ] {[ U ][ X ] −[ D ] }=[ A ][ X ] −[ B ]
[ 0.1 7 −0.3
0.3 −0.2 10 ]
[ L ][ U ] =[ A ] [ L ][ D ] =[ B ] Making the forward elimination, we obtain the following
upper triangular matrix.
3 −0.1 −0.2 3 −0.1 −0.2

[
[ U ] = 0 7.0033 −0.2933
0 0 10.0120 ] [
[ L ][ U ] = 0.09999
0.3
7 −0.3
−0.2 9,9996 ]
The factors used to obtain the matrix [U] are placed in a With the forward elimination phase, we have:
lower triangular matrix [L]. The elements a_ (21), a_ (31)
and a 21 , a31 , y a,32 ,were eliminated using the following
factors: 3 −0.1 x1 7.85
]{ } {
−0.2
fa =
21
0.1
3
=0.03333 [ 0 7.0033 −0.2933 x2 = −19.5617
0 0 10.0120 x3 70.0843 }
0.3
fa = =0.10000
31
3
−0.19
fa =
, =−0.02713
32
7.0033
The forward substitution phase is:
1 0 0 d1 7.85

[
1
[ L ] = 0.03333
0
1
0
0
0.10000 −0.02713 1 ] [ 0.03333 1 0 d2
0.10000 −0.02713 1 d 3 ]{ } { }
= −19.3
71.4

[ A ] =[ L ] [ U ]

1 0 0 3 −0.1 −0.2 d 1=7.85

[
¿ 0.03333 1
][
0 0 7.0033 −0.2933
0.10000 −0.02713 1 0 0 10.0120 ] 0.03333 d 1 +d 2=−19.3

d 2=−19.5617
0.10000 d 1±0.02713 d 2+ d3 =71.4

d 3=70.0843

Replacing in equation [ U ] [ X ] =[ D ]

3 −0.1 x1 7.85
]{ } {
−0.2
[ 0 7.0033 −0.2933 x2
0 0 10.0120 x3
= −19.561 7
70.0843 }
By back substitution have
Bibliography

3  CHAPRA STEVEN, (2007) “Métodos numéricos para


{ }
[ X ] = −2.5
7.00003
ingeniería”. Chapter 9 and 10

 http://es.wikipedia.org/wiki/Matriz_transpuesta

 http://es.wikipedia.org/wiki/Determinante_(mate
mática)
 http://es.wikipedia.org/wiki/Matriz_triangular

 http://es.wikipedia.org/wiki/Matriz_banda

 http://es.wikipedia.org/wiki/Matriz_aumentada

 http://es.wikipedia.org/wiki/Multiplicación_de_m
atrices

You might also like