230 likes | 251 Views
Linear Algebra. Chapter 8 Numerical Technique. 大葉大學 資訊工程系 黃鈴玲. 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.
E N D
Linear Algebra Chapter 8Numerical Technique 大葉大學 資訊工程系 黃鈴玲
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 上面的數字不必為零
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 Example 1 Solving the following system of linear equations using the method of Gaussian elimination. Solution We have arrived at the echelon form.
We get Substitutingx4 = 2 and x3 = -5 into the first equation, Let x2 = r. The system has many solutions. The solutions are The corresponding system of equation is
We arrive at the echelon form as in the previous example. Echelon form Example 2 Solving the following system of linear equations using the method of Gaussian elimination, performing back substitution using matrices. Solution This marks the end of the forward elimination of variables from equations. We now commence the back substitution using matrices.
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, 2
8.2 The Method of LU Decomposition lower triangular matrix upper triangular matrix Ax=y A=LU …
1st equations gives 2nd equation gives 3rd equation gives The solution is Example 1 Solving the following system of equations, which has a triangular matrix of coefficients. Solution By forward substitution:
3rd equation gives 1st equations gives 2nd equation gives The solution is Example 2 Solving the following system of equations, which has an upper triangular matrix of coefficients. Solution By back substitution:
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.)
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
R2 R3 5R2 R2+ 2R1 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 Elementary Matrices(複習第二章) 一個矩陣做 elementary row operation,相當於在左邊乘一個對應的 elementary matrix。
Note that (E1)12= -(E2)12. Elementary matrices(複習第二章) • Each elementary matrix is invertible. Example
How to decompose A=LU? (利用elementary matrix)A…U (upper triangular) U = Ek E1 A A = (E1)-1 (Ek)-1UIf 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)-1is a lower triangular matrix.Let L=(E1)-1 (Ek)-1 then A=LU.
Let us transform the matrix of coefficients A into upper triangular form U by creating zeros below the main diagonal as follows. A U Example 3 Solving the following system of equations using LU decomposition. Solution
The inverse of these matrices are We get Thus The elementary matrices that correspond to these row operations are
This lower triangular system has solution The upper triangular system has solution The solution to the given system is We now solve the given system LUX = B by solving the two subsystems LY = B and UX = Y. We get
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.
These row operations lead to the following LU decomposition of A. L21= -1 L31= 4 L32= 2 Example 4 Solve the following system if equations using LU decomposition. Solution
This lower triangular system has solution y1 = 12, y2 = 0, y3 = 10. We again solve the given system LUX = B by solving the two subsystems LY = B and UX = Y. 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.
Homework • Exercise 8.27(a), 9, 20