Presentation is loading. Please wait.

Presentation is loading. Please wait.

Chapter 8 Numerical Technique

Similar presentations


Presentation on theme: "Chapter 8 Numerical Technique"— Presentation transcript:

1 Chapter 8 Numerical Technique
Linear Algebra Chapter 8 Numerical Technique 大葉大學 資訊工程系 黃鈴玲

2 8.1 Gaussian Elimination Definition A matrix is in echelon form if
Any rows consisting entirely of zeros are grouped at the bottom of the matrix. The first nonzero element of each row is 1. This element is called a leading 1. The leading 1 of each row after the first is positioned to the right of the leading 1 of the previous row. (This implies that all the elements below a leading 1 are zero.) Reduced echelon form與echelon from的差異: echelon form 的 leading 1 上面的數字不必為零

3 Example 1 Solving the following system of linear equations using the method of Gaussian elimination. Solution Starting with the augmented matrix, create zeros below the pivot in the first column. At this stage, we create a zero only below the pivot. Echelon form We have arrived at the echelon form.

4 The corresponding system of equation is
We get Substituting x4 = 2 and x3 = -5 into the first equation, Let x2 = r. The system has many solutions. The solutions are

5 Example 2 Solving the following system of linear equations using the method of Gaussian elimination, performing back substitution using matrices. Solution We arrive at the echelon form as in the previous example. Echelon form This marks the end of the forward elimination of variables from equations. We now commence the back substitution using matrices.

6 2 3 This matrix is the reduced echelon form of the original augmented matrix. The corresponding system of equations is Let x2 = r. We get same solution as previously,

7 Comparison of Gauss-Jordan and Gaussian Elimination
Count of Operations for n  n system with Unique Solution Number of Multiplications Number of Additions Gauss-Jordan Gaussian elimination

8 8.2 The Method of LU Decomposition
lower triangular matrix upper triangular matrix Ax=y  A=LU …

9 Example 1 Solving the following system of equations, which has a triangular matrix of coefficients. Solution By forward substitution: 1st equations gives 2nd equation gives 3rd equation gives The solution is

10 Example 2 Solving the following system of equations, which has an upper triangular matrix of coefficients. Solution By back substitution: 3rd equation gives 2nd equation gives 1st equations gives The solution is

11 Definition Let A be a square matrix that can be factored into the form A = LU, where L is a lower triangular matrix and U is an upper triangular matrix, This factoring is called an LU decomposition of A. (Not every matrix has an LU decomposition, and when it exists, it is not unique.)

12 Method of LU Decomposition
Let AX = B be a system of n equations in n variables, where A has LU decomposition A = LU.  LUX = B  two subsystems: UX = Y (upper triangular) and LY = B (lower triangular) Solution of AX = B Find the LU decomposition of A. (If A has no LU decomposition, the method is not applicable.) Solve LY = B by forward substitution. Solve UX = Y by back substitution. How to decompose A=LU? 利用elementary matrices

13 Elementary Matrices(複習第二章)
Definition An elementary matrix is one that can be obtained from the identity matrix In through a single elementary row operation. Example R2  R3 5R2 R2+ 2R1

14 Elementary Matrices(複習第二章)
一個矩陣做 elementary row operation, 相當於在左邊乘一個對應的 elementary matrix。 R2  R3 5R2 R2+ 2R1

15 Elementary matrices(複習第二章)
Each elementary matrix is invertible. Example Note that (E1)12 = -(E2)12.

16 How to decompose A=LU? (利用elementary matrix) A … U (upper triangular)  U = Ek  E1 A  A = (E1)-1  (Ek)-1 U If each such elementary matrix Ei is a lower triangular matrices, it can be proved that (E1)-1, , (Ek)-1 are lower triangular, and (E1)-1  (Ek)-1 is a lower triangular matrix. Let L=(E1)-1  (Ek)-1 then A=LU.

17 Example 3 Solving the following system of equations using LU decomposition. Solution Let us transform the matrix of coefficients A into upper triangular form U by creating zeros below the main diagonal as follows. A U

18 The elementary matrices that correspond to these row operations are
The inverse of these matrices are We get Thus

19 We now solve the given system LUX = B by solving the two subsystems LY = B and UX = Y. We get
This lower triangular system has solution The upper triangular system has solution The solution to the given system is

20 Construction of a LU decomposition of a Matrix A
Use row operations to arrive at U. (The operations must involve adding multiples of rows to rows. In general, if row interchanges are required to arrive at U, an LU form does not exists.) The diagonal element of L are ls. The nonzero elements of L corresponding to row operations. The row operation Ri + cRj implies that lij = -c.

21 Example 4 Solve the following system if equations using LU decomposition. Solution L21= -1 L32= 2 These row operations lead to the following LU decomposition of A. L31= 4

22 We again solve the given system LUX = B by solving the two subsystems LY = B and UX = Y.
This lower triangular system has solution y1 = 12, y2 = 0, y3 = 10. This upper triangular system has solution x1 = 1, x2 = -1, x3 = 2. The solution to the given system is x1 = 1, x2 = -1, x3 = 2.

23 Homework Exercise 8.2 7(a), 9, 20


Download ppt "Chapter 8 Numerical Technique"

Similar presentations


Ads by Google