The Islamic University of Gaza Faculty of Engineering Civil Engineering Department Numerical Analysis ECIV 3306 Chapter 10 LU Decomposition and Matrix.

Slides:



Advertisements
Similar presentations
Chapter 2 Solutions of Systems of Linear Equations / Matrix Inversion
Advertisements

4/26/ LU Decomposition Civil Engineering Majors Authors: Autar Kaw Transforming.
Algebraic, transcendental (i.e., involving trigonometric and exponential functions), ordinary differential equations, or partial differential equations...
Simultaneous Linear Equations
Major: All Engineering Majors Authors: Autar Kaw
SOLVING SYSTEMS OF LINEAR EQUATIONS. Overview A matrix consists of a rectangular array of elements represented by a single symbol (example: [A]). An individual.
Chapter 9.1 = LU Decomposition MATH 264 Linear Algebra.
Chapter 9 Gauss Elimination The Islamic University of Gaza
Major: All Engineering Majors Author(s): Autar Kaw
Linear Algebraic Equations
Special Matrices and Gauss-Siedel
ECIV 301 Programming & Graphics Numerical Methods for Engineers Lecture 17 Solution of Systems of Equations.
The Islamic University of Gaza Faculty of Engineering Civil Engineering Department Numerical Analysis ECIV 3306 Chapter 10 LU Decomposition and Matrix.
ECIV 301 Programming & Graphics Numerical Methods for Engineers Lecture 14 Elimination Methods.
Special Matrices and Gauss-Siedel
ECIV 301 Programming & Graphics Numerical Methods for Engineers Lecture 15 Solution of Systems of Equations.
ECIV 520 Structural Analysis II Review of Matrix Algebra.
Algorithm for Gauss elimination 1) first eliminate for each eq. j, j=1 to n-1 for all eq.s k greater than j a) multiply eq. j by a kj /a jj b) subtract.
ECIV 301 Programming & Graphics Numerical Methods for Engineers REVIEW II.
ECIV 301 Programming & Graphics Numerical Methods for Engineers Lecture 18 LU Decomposition and Matrix Inversion.
Systems of Linear Equations
1 Systems of Linear Equations Error Analysis and System Condition.
Major: All Engineering Majors Author(s): Autar Kaw
Chapter 8 Objectives Understanding matrix notation.
LU Decomposition 1. Introduction Another way of solving a system of equations is by using a factorization technique for matrices called LU decomposition.
Engineering Analysis ENG 3420 Fall 2009
Scientific Computing Linear Systems – LU Factorization.
Copyright © 2006 The McGraw-Hill Companies, Inc. Permission required for reproduction or display. by Lale Yurttas, Texas A&M University Part 31 Linear.
Advanced Computer Graphics Spring 2014 K. H. Ko School of Mechatronics Gwangju Institute of Science and Technology.
ΑΡΙΘΜΗΤΙΚΕΣ ΜΕΘΟΔΟΙ ΜΟΝΤΕΛΟΠΟΙΗΣΗΣ 4. Αριθμητική Επίλυση Συστημάτων Γραμμικών Εξισώσεων Gaussian elimination Gauss - Jordan 1.
Chemical Engineering Majors Author(s): Autar Kaw
Lecture 8 Matrix Inverse and LU Decomposition
Gaussian Elimination Electrical Engineering Majors Author(s): Autar Kaw Transforming Numerical Methods Education for.
Chapter 9 Gauss Elimination The Islamic University of Gaza
ECE 530 – Analysis Techniques for Large-Scale Electrical Systems Prof. Hao Zhu Dept. of Electrical and Computer Engineering University of Illinois at Urbana-Champaign.
Gaussian Elimination Industrial Engineering Majors Author(s): Autar Kaw Transforming Numerical Methods Education for.
Gaussian Elimination Mechanical Engineering Majors Author(s): Autar Kaw Transforming Numerical Methods Education for.
1/18/ LU Decomposition Industrial Engineering Majors Authors: Autar Kaw Transforming.
1 Chapter 7 Numerical Methods for the Solution of Systems of Equations.
3/1/ LU Decomposition Computer Engineering Majors Authors: Autar Kaw Transforming.
Gaussian Elimination Civil Engineering Majors Author(s): Autar Kaw Transforming Numerical Methods Education for STEM.
Unit #1 Linear Systems Fall Dr. Jehad Al Dallal.
Autar Kaw Benjamin Rigsby Transforming Numerical Methods Education for STEM Undergraduates.
Autar Kaw Benjamin Rigsby Transforming Numerical Methods Education for STEM Undergraduates.
Numerical Methods.  LU Decomposition is another method to solve a set of simultaneous linear equations  For most non-singular matrix [A] that one could.
Lecture 9 Numerical Analysis. Solution of Linear System of Equations Chapter 3.
Numerical Methods. Introduction Prof. S. M. Lutful Kabir, BRAC University2  One of the most popular techniques for solving simultaneous linear equations.
Numerical Computation Lecture 6: Linear Systems – part II United International College.
LU Decomposition ● In Gauss elimination; Forward elimination Backward substitution Major computational effort Low computational effort can be used for.
Simultaneous Linear Equations
Spring Dr. Jehad Al Dallal
Gaussian Elimination.
Linear Equations.
Chapter 10 and Matrix Inversion LU Decomposition
Naïve Gauss Elimination Pitfalls
Chapter 10.
Chemical Engineering Majors Authors: Autar Kaw
Simultaneous Linear Equations
Major: All Engineering Majors Author(s): Autar Kaw
Numerical Analysis Lecture14.
Numerical Computation and Optimization
Numerical Analysis Lecture10.
ARRAY DIVISION Identity matrix Islamic University of Gaza
Major: All Engineering Majors Authors: Autar Kaw
LU Decomposition.
Simultaneous Linear Equations Gaussian Elimination with Partial Pivoting
Lecture 8 Matrix Inverse and LU Decomposition
Naïve Gauss Elimination Pitfalls
Numerical Analysis Lecture11.
Ax = b Methods for Solution of the System of Equations (ReCap):
Presentation transcript:

The Islamic University of Gaza Faculty of Engineering Civil Engineering Department Numerical Analysis ECIV 3306 Chapter 10 LU Decomposition and Matrix Inversion

Introduction Gauss elimination solves [A] {x} ={B} It becomes insufficient when solving these equations for different values of {B} LU decomposition works on the matrix [A] and the vector {B} separately. LU decomposition is very useful when the vector of variables {x} is estimated for different parameter vectors {B} since the forward elimination process is not performed on {B}.

LU Decomposition If: L: lower triangular matrix U: upper triangular matrix Then, [A]{X}={B} can be decomposed into two matrices [L] and [U] such that: 1. [L][U] = [A]  ([L][U]){X} = {B}

LU Decomposition Consider: [U]{X} = {D} So, [L]{D} = {B} 2. [L]{D} = {B} is used to generate an intermediate vector {D} by forward substitution. 3. Then, [U]{X}={D} is used to get {X} by back substitution.

Summary of LU Decomposition

LU Decomposition As in Gauss elimination, LU decomposition must employ pivoting to avoid division by zero and to minimize round off errors. The pivoting is done immediately after computing each column.

LU Decomposition Step 1: Decomposition System of linear equations [A]{x}={B}

LU Decomposition Step 2: Generate an intermediate vector {D} by forward substitution Step 3: Get {X} by back substitution.

LU Decomposition-Example

LU Decomposition-Example (cont’d) Step 2: Find the intermediate vector {D} by forward substitution Use previous L and D matrices to solve the system:

LU Decomposition-Example (cont’d) Step 3: Get {X} by back substitution.

Decomposition Step % Decomposition Step for k=1:n-1 [a,o]= pivot(a,o,k,n); for i = k+1:n a(i,k) = a(i,k)/a(k,k); a(i,k+1:n)= a(i,k+1:n)-a(i,k)*a(k,k+1:n); end

Partial Pivoting %Partial Pivoting function [a,o] = pivot(a,o,k,n) [big piv]=max(abs(a(k:n,k))); piv=piv+(k-1); if piv ~= k temp = a(piv,:); a(piv,:)= a(k,:); a(k,:)=temp; temp = o(piv); o(piv)=o(k); o(k)=temp; end

Substitution Steps %Forward Substitution d(1)=bn(1); for i=2:n d(i)=bn(i)-a(i,1:i-1)*(d(1:i-1))'; end % Back Substitution x(n)=d(n)/a(n,n); for i=n-1:-1:1 x(i)=(d(i)-a(i,i+1:n)*x(i+1:n)')/a(i,i); end

Matrix Inverse Using the LU Decomposition LU decomposition can be used to obtain the inverse of the original coefficient matrix [A]. Each column j of the inverse is determined by using a unit vector (with 1 in the j th raw ).

Matrix Inverse: LU Decomposition 1 st column of [A] -1 2 nd column of [A] -1 3 rd column of [A] -1 [A] [A] -1 = [A] -1 [A] = I

Matrix inverse using LU decomposition Example 1A. [L]{d} 1 = {b} 1 1B. Then, [U]{X} 1 ={d} 1 1 st column of [A] -1

2A. [L]{d} 2 = {b} 2 Matrix inverse using LU decomposition Example (cont’d) 2B. Then, [U]{X} 2 ={d} 2 2 nd column of [A] -1

3A. [L]{d} 3 = {b} 3 Matrix inverse using LU decomposition Example (cont’d) 3B. Then, [U]{X} 3 ={d} 3 3 rd column of [A] -1

Matrix inverse using LU decomposition Example (cont’d)

Vector and Matrix Norms Norm is a real-valued function that provides a measure of size or “length” of vectors and matrices. Norms are useful in studying the error behavior of algorithms.

Vector and Matrix Norms (cont’d)

The length of this vector can be simply computed as Length or Euclidean norm of [F] For an n dimensional vector Frobenius norm

Vector and Matrix Norms (cont’d)

Uniform vector norm Uniform matrix norm (row sum Norm)

Vector and Matrix Norms (cont’d) Matrix Condition umber Defined as: For a matrix [A], this number will be greater than or equal to 1. If the coefficients of [A] are known to t-digit precision (rounding errors~10 -t ) and Cond [A]=10 c, the solution [X] may be valid to only t-c digits (rounding errors~10 c-t ).

Iterative Refinement Round-off errors can be reduced by the following procedure: Suppose an approximate solution vectors given by Substitute the result in the original system....(Eq.1)

Iterative Refinement (cont’d) Now, assume the exact solution is: Then: … …….(Eq.2)

Iterative Refinement (cont’d) Subtract Eq.2 from Eq.1, the result is a system of linear equations that can be solved to obtain the correction factors The factors then can be applied to improve the solution as specified by the equation:

Iterative Refinement- Example (cont’d) Solve: The exact solution is ……… 1- Solve the equations using [A] -1, such as {x}=[A] -1 {c}

Iterative Refinement - Example (cont’d) 2- Substitute the result in the original system [A]{x}={c} 

Iterative Refinement - Example (cont’d) 3- Solve the system of linear equations using [A] -1 to find the correction factors to yield