Documente Academic
Documente Profesional
Documente Cultură
9-2
C OURSE C ONTENT
9-3
PART 3
In Part Two, we determined the value x that satisfied a single equation f(x)=0. Now, we deal with finding x1, x2, ,xn that simultaneously satisfy a set of equations:
9-4
In Part Three, we deal with linear algebraic equations that are of the general form
PART 3
Where the as are constant coefficients, What do you have in mind when bs are constants and n is the number of you see these sets of equations? equations
9-5
Be able to solve problems involving linear algebraic equation Appreciate the usage of linear algebraic equations in any field of engineering Mastering several techniques and their reliability Nave Gauss elimination Gauss-Jordan elimination LU decomposition Gauss Siedel Be able to use a program to successfully solve systems of linear algebraic equations
PART 3
9-6
Overview Pt. 3
understand matrix notation identify the following types of matrices: identity, diagonal, symmetric, triangular, and tridiagonal perform matrix multiplication assess matrix multiplication when it is feasible represent a system of linear equations in matrix form solve linear algebraic equations with left division and matrix inversion in MATLAB
9-7
Overview Pt. 3
A matrix consists of a rectangular array of elements represented by a single symbol (example: [A]). An individual entry of a matrix is an element (example: amn where m=2, n=3)
1xn matrices are row vectors mx1 matrices are column vectors
9-8
Overview Pt. 3
Matrices where m=n are called square matrices. There are a number of special forms of square matrices:
9-9
Overview Pt. 3
Two matrices are considered equal if and only if every element in the first matrix is equal to every corresponding element in the second. This means the two matrices must be the same size. Matrix addition and subtraction are performed by adding or subtracting the corresponding elements. This requires that the two matrices be the same size. Scalar matrix multiplication is performed by multiplying each element by the same scalar:
9-10
Overview Pt. 3
The elements in the matrix [C] that results from multiplying matrices [A] and [B] are calculated using:
9-11
Overview Pt. 3
The inverse of a square, nonsingular matrix [A] is that matrix which, when multiplied by [A], yields the identity matrix. [A][A]-1 = [A]-1[A] = [I] The transpose of a matrix involves transforming its rows into columns and its columns into rows. (aij)T = aji
9-12
Overview Pt. 3
Matrices provide a concise notation for representing and solving simultaneous linear equations:
9-13
Overview Pt. 3
9-14
G AUSS E LIMINATION
Study Objectives: Able to solve small sets of linear equations with the graphical method and Cramers rule implement forward elimination and back substitution as in Gauss elimination count flops to evaluate the efficiency of an algorithm. understand the concepts of singularity and illcondition. understand how partial pivoting is implemented and how it differs from complete pivoting. recognize how the banded structure of a tridiagonal system can be exploited to obtain extremely efficient solutions.
CHAPTER 9
9-15
GAUSS ELIMINATION
9-16
GAUSS ELIMINATION
Graphing the equations can also show systems where: a) No solution exists b) Infinite solutions exist c) System is ill-conditioned
Extremely sensitive to round off error. The point of intersection is difficult to detect visually
(a)
(b)
(c)
9-17
GAUSS ELIMINATION
The determinant D=|A| of a matrix is formed from the coefficients of [A]. Determinants for small matrices are:
9-18
GAUSS ELIMINATION
The rule states that each unknown in a system of linear algebraic equations may be expressed as a fraction of two determinants with denominator D and with the numerator obtained from D by replacing the column of coefficients of the unknown in question by the constants b1, b2, , bn :
9-19
GAUSS ELIMINATION
9-20
GAUSS ELIMINATION
Divide
9-21
GAUSS ELIMINATION
subtract
9-22
GAUSS ELIMINATION
For larger systems, Cramers Rule can become unwieldy. Instead, a sequential process of removing unknowns from equations using forward elimination followed by backward substitution may be used - this is Gauss elimination. Nave Gauss elimination simply means the process does not check for potential problems resulting from division by zero no pivoting needed
9-23
GAUSS ELIMINATION
Back Substitution
unknown the equation could be solved directly and the result back-substituted into one of the original equations to solve the remaining unknown.
9-24
GAUSS ELIMINATION
a12 a13 ... a1n x1 b1 x b a22 a23 ... a2 n 2 2 a32 a33 ... a3n x 3 = b3 an 2 an 3 ... ann x n bn
9-25
GAUSS ELIMINATION
9-26
GAUSS ELIMINATION
row/eqn (1) is called the pivot equation, and a11 is called pivot element
a13 a23 a33 b1 - (1) b2 - (2) b3 - (3)
a11 a 21 a31
eqn (1) multiply with a21/a11 eqn (1a) eqn (2) minus eqn (1a) eqn (2) eqn (1) multiply with a31/a11 eqn (1b) eqn (3) minus eqn (1b) eqn (3) The prime indicates that the elements have been modified
9-27
GAUSS ELIMINATION
eqn (2) multiply with a32/a22 eqn (2a) eqn (3) minus eqn (2a) eqn (3)
a11 a12 a ' 22 a13 a ' 23 a ' '33 b1 - (1) b' 2 - (2' ) b' '3 - (3' ' )
The double prime indicates that the elements have been modified twice
9-28
GAUSS ELIMINATION
The result x3 can be back-substituted into eqn (2) and (1) to solve for x2 and x1
9-29
GAUSS ELIMINATION
9-30
GAUSS ELIMINATION
9-31
GAUSS ELIMINATION
Verification
9-32
GAUSS ELIMINATION
The execution of Gauss elimination depends on the amount of floating-point operations (or flops). The flop count for an n x n system is:
Conclusion As the system gets larger, the computation time increases greatly. Most of the effort is incurred in the elimination step.
9-33
GAUSS ELIMINATION
9-34
GAUSS ELIMINATION
If no partial pivoting
9-35
GAUSS ELIMINATION
The result very sensitive to the number of significant figures carried in the computation
9-36
GAUSS ELIMINATION
9-37
GAUSS ELIMINATION
9-38
QUIZ
Q1. Derive the truncating error as given below for the Forward Elimination, Backward Elimination.
GAUSS ELIMINATION
Q3. Write down the complete Taylor series expansion and the Remainder, Rn term.
9-39
GAUSS ELIMINATION
Another variation of Gauss Elimination method Major difference: When unknowns are eliminated, they are eliminated from all other equations All rows are normalized by dividing them by their pivot elements results in identity matrix No substitution is employed to obtain the solution
9-40
GAUSS ELIMINATION
eqn (1) multiply with 1/a11 eqn (1) eqn (1) multiply with a21 eqn (1a) eqn (2) minus eqn (1a) eqn (2) eqn (1) multiply with a31 eqn (1b) eqn (3) minus eqn (1b) eqn (3) The prime indicates that the elements have been modified
9-41
GAUSS ELIMINATION
b' '1 - (1' ' ) b' ' 2 - (2' ' ) b' ' 3 - (3' ' )
eqn (2) multiply with 1/a22 eqn (2) eqn (2) multiply with a12 eqn (2a) eqn (1) minus eqn (2a) eqn (1) eqn (2) multiply with a32 eqn (2b) eqn (3) minus eqn (2b) eqn (3) The prime indicates that the elements ave been modified
9-42
GAUSS ELIMINATION
1 0 0 b' ' '1 - (1' ' ' ) 0 1 0 b' ' ' - (2' ' ' ) 2 - (3' ' ' ) 0 0 1 b' ' ' 3
eqn (3) multiply with 1/a33 eqn (2) eqn (3) multiply with a13 eqn (3a) eqn (1) minus eqn (3a) eqn (1) eqn (3) multiply with a23 eqn (3b) eqn (2) minus eqn (3b) eqn (2) The triple prime indicates that the elements have been modified three times
9-43
GAUSS ELIMINATION
gives
9-44
GAUSS ELIMINATION
Solution:
9-45
GAUSS ELIMINATION
1 0.0333 0.0667 2.6167 - Eqn (1' ) - Eqn (2) 0.1 7 0 . 3 19 . 3 0.2 10 71.4 - Eqn (3) 0.3
Eqn (2) Eqn (1) x 0.1, and Eqn (3) Eqn (1) x 0.3
2.6167 - Eqn (1' ) 1 0.0333 0.0667 0 7.0033 0.2933 19.5617 - Eqn (2' ) - Eqn (3' ) 0 0.1900 10.0200 70.6150
9-46
GAUSS ELIMINATION
1 0.0333 0.0667 2.6167 - Eqn (1' ) - Eqn (2' ' ) 0 1 0 . 0419 2 . 7932 - Eqn (3' ) 0 0.1900 10.0200 70.6150 1 0 0.0681 2.5236 - Eqn (1' ' ) 0 1 0.0419 2.7932 - Eqn (2' ' ) - Eqn (3' ' ) 0 0 10.0120 70.0843
Eqn (3) - Eqn (2) x -0.19, and Eqn (1) Eqn (2) x -0.0333
9-47
GAUSS ELIMINATION