Chapter 10 LU Decomposition.

Slides:



Advertisements
Similar presentations
Chapter: 3c System of Linear Equations
Advertisements

4/22/ LU Decomposition Electrical Engineering Majors Authors: Autar Kaw Transforming.
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...
Linear Systems LU Factorization CSE 541 Roger Crawfis.
Linear Systems COS 323. Linear Systems Solve Ax=b, where A is an n  n matrix and b is an n  1 column vectorSolve Ax=b, where A is an n  n matrix and.
MATH 685/ CSI 700/ OR 682 Lecture Notes
Scientific Computing Linear Systems – Gaussian Elimination.
Numerical Analysis – Linear Equations(I) Hanyang University Jong-Il Park.
LU Factorization LU-factorization Matrix factorization Forward substitution Back substitution.
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.
CISE301_Topic3KFUPM1 SE301: Numerical Methods Topic 3: Solution of Systems of Linear Equations Lectures 12-17: KFUPM Read Chapter 9 of the textbook.
Chapter 9.1 = LU Decomposition MATH 264 Linear Algebra.
Linear Systems Pivoting in Gaussian Elim. CSE 541 Roger Crawfis.
Solution of linear system of equations
Lecture 11 - LU Decomposition
Chapter 9 Gauss Elimination.
Part 3 Chapter 10 LU Factorization PowerPoints organized by Dr. Michael R. Gustafson II, Duke University All images copyright © The McGraw-Hill Companies,
LU method 1) factor (decompose) A into L and U 2) given b, determine d 3) using Ux=d and backsubstitution, solve for x Advantage: Once you have L and U,
ECIV 301 Programming & Graphics Numerical Methods for Engineers Lecture 17 Solution of Systems of Equations.
ECIV 520 Structural Analysis II Review of Matrix Algebra.
Dr. Jie Zou PHY Chapter 3 Solution of Simultaneous Linear Algebraic Equations: Lecture (III) Note: Besides the main textbook, also see Ref: Applied.
Ordinary least squares regression (OLS)
1 Systems of Linear Equations (Optional) Special Matrices.
Thomas algorithm to solve tridiagonal matrices
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.
Mujahed AlDhaifallah (Term 342) Read Chapter 9 of the textbook
17 Jul 2007 KKKQ 3013 PENGIRAAN BERANGKA Week 2 – Systems of Linear Equations 17 July am – 9.00 am.
ECIV 301 Programming & Graphics Numerical Methods for Engineers Lecture 18 LU Decomposition and Matrix Inversion.
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.
Advanced Computer Graphics Spring 2014 K. H. Ko School of Mechatronics Gwangju Institute of Science and Technology.
Using LU Decomposition to Optimize the modconcen.m Routine Matt Tornowske April 1, 2002.
Introduction to Numerical Analysis I MATH/CMPSC 455 PA=LU.
6. LU Factorization Kim Hong Soo Kim Jin Soo
Yasser F. O. Mohammad Assiut University Egypt. Previously in NM Introduction to NM Solving single equation System of Linear Equations Vectors and Matrices.
Chapter 3 Solution of Algebraic Equations 1 ChE 401: Computational Techniques for Chemical Engineers Fall 2009/2010 DRAFT SLIDES.
 6.2 Pivoting Strategies 1/17 Chapter 6 Direct Methods for Solving Linear Systems -- Pivoting Strategies Example: Solve the linear system using 4-digit.
Lecture 8 Matrix Inverse and LU Decomposition
Chapter 5 MATRIX ALGEBRA: DETEMINANT, REVERSE, EIGENVALUES.
Lesson 3 CSPP58001.
Lecture 10 - Nonlinear gradient techniques and LU Decomposition CVEN 302 June 24, 2002.
1/18/ LU Decomposition Industrial Engineering Majors Authors: Autar Kaw Transforming.
3/1/ LU Decomposition Computer Engineering Majors Authors: Autar Kaw Transforming.
Unit #1 Linear Systems Fall Dr. Jehad Al Dallal.
Autar Kaw Benjamin Rigsby Transforming Numerical Methods Education for STEM Undergraduates.
Sinwook Lee Digital Media Lab. HYU.  Linear Equations  To gain the appropriate solution, 1..n of equations are necessary.  The num of equations < n.
Numerical Methods.  LU Decomposition is another method to solve a set of simultaneous linear equations  For most non-singular matrix [A] that one could.
Numerical Computation Lecture 6: Linear Systems – part II United International College.
1 Numerical Methods Solution of Systems of Linear Equations.
LU Decomposition ● In Gauss elimination; Forward elimination Backward substitution Major computational effort Low computational effort can be used for.
Chapter: 3c System of Linear Equations
Simultaneous Linear Equations
Spring Dr. Jehad Al Dallal
Linear Equations.
Linear Algebra Lecture 15.
Chapter 10 and Matrix Inversion LU Decomposition
RECORD. RECORD Gaussian Elimination: derived system back-substitution.
Chemical Engineering Majors Authors: Autar Kaw
Numerical Computation and Optimization
Part 3 Chapter 10 LU Factorization
Numerical Analysis Lecture10.
Major: All Engineering Majors Authors: Autar Kaw
Lecture 8 Matrix Inverse and LU Decomposition
Linear Systems of Equations: solution and applications
The Gauss Jordan method
Ax = b Methods for Solution of the System of Equations:
Ax = b Methods for Solution of the System of Equations (ReCap):
Presentation transcript:

Chapter 10 LU Decomposition

L and U Matrices Lower Triangular Matrix Upper Triangular Matrix

LU Decomposition Another method for solving matrix equations Idea behind the LU Decomposition - start with We know (because we did it in Gauss Elimination) we can write

LU Decomposition Assume there exists [L] Such that This implies

The Steps of LU Decomposition

LU Decomposition LU Decomposition Decomposition Methods (not unique) * Based on Gauss elimination *More efficient Decomposition Methods (not unique) * Doolittle decomposition lii = 1 * Crout decomposition uii = 1 (omitted) * Cholesky decomposition (for symmetric matrices) uii = lii

LU Decomposition Three Basic Steps (1) Factor (decompose) [A] into [L] and [U] (2) given {b}, determine {d} from [L]{d} = {b} (3) using [U]{x} = {d} and back-substitution, solve for {x} Advantage: Once we have [L] and [U], we can use many different {b}’s without repeating the decomposition process

LU Decomposition LU decomposition / factorization [ A ] { x } = [ L ] [ U ] { x } = { b } Forward substitution [ L ] { d } = { b } Back substitution [ U ] { x } = { d } Forward substitutions are more efficient than elimination

Simple Truss F45 4 5 F35 F14 F24 F25 1 3 H1 F12 F23 2 V1 V2 W

Exampe: Forces in a Simple Truss [A] depends on geometry only; but {b} varies with applied load

LU Factorization [ A ] = [ L ] [ U ] Gauss elimination [A]{x}={b} elimination steps need to be repeated for each different {b} LU factorization / decomposition [ A ] = [ L ] [ U ] does not involve the RHS {b} !!!

Doolittle LU Decomposition Doolittle Algorithm Get 1’s on diagonal of [L] (lii =1) Operate on rows and columns sequentially, narrowing down to single element Identical to LU decomposition based on Gauss elimination (see pp238-239), but different approach

Doolittle LU Decomposition

Doolittle LU Decomposition

Doolittle LU Decomposition

Algorithm of Doolittle Decomposition

Very efficient for large matrices ! Forward Substitution Once [L] is formed, we can use forward substitution instead of forward elimination for different {b}’s Very efficient for large matrices !

Identical to Gauss elimination Back Substitution Identical to Gauss elimination

Forward Substitution Example:

Back-Substitution

Forward and Back Substitutions Forward-substitution Back-substitution (identical to Gauss elimination) Error in textbook (p. 165)

Forward and Back Substitutions

Example: Forward and Back Substitutions » [L,U] = LU_factor(A); L = 1.0000 0 0 0 -1.0000 1.0000 0 0 0 0.5000 1.0000 0 6.0000 1.0000 14.0000 1.0000 U = 1 0 2 3 0 2 4 0 0 0 -1 4 0 0 0 -70 » x=LU_solve(L,U,b) x = -0.1857 0.2286 -0.1143 0.4714 (without pivoting) MATLAB M-file LU_factor Forward and back substitution

Pivoting in LU Decomposition Still need pivoting in LU decomposition Messes up order of [L] What to do? Need to pivot both [L] and a permutation matrix [P] Initialize [P] as identity matrix and pivot when [A] is pivoted  Also pivot [L]

LU Decomposition with Pivoting Permutation matrix [ P ] - permutation of identity matrix [ I ] Permutation matrix performs “bookkeeping” associated with the row exchanges Permuted matrix [ P ] [ A ] LU factorization of the permuted matrix [ P ] [ A ] = [ L ] [ U ] Solution [ L ] [ U ] {x} = [ P ] {b}

Permutation Matrix Bookkeeping for row exchanges Example: [ P1] interchanges row 1 and 3 Multiple permutations [ P ]

LU Decomposition with Pivoting Start with No need to consider {b} in decomposition

Forward Elimination Gauss elimination of first column Interchange rows 1 & 4 Gauss elimination of first column Save fi1 in the first column of [L]

Forward Elimination Gauss elimination of second column No interchange required Gauss elimination of second column Save fi2 in the second column of [L]

Forward Elimination Partial pivoting for [L] and [P] Interchange rows 3 &4 Partial pivoting for [L] and [P]

Forward Elimination Gauss elimination of third column Save fi3 in third column of [L]

LU Decomposition with Pivoting Gauss elimination with partial pivoting

LU Decomposition with Pivoting Forward substitution Back substitution

LU Decomposition with Pivoting partial pivoting

LU Decomposition with Pivoting » A=[1 0 2 3; -1 2 2 -3; 0 1 1 4; 6 2 2 4]; » b=[1 -1 2 1]'; » [L,U,P]=LU_pivot(A); L = 1.0000 0 0 0 -0.1667 1.0000 0 0 0.1667 -0.1429 1.0000 0 0 0.4286 0 1.0000 U = 6.0000 2.0000 2.0000 4.0000 0 2.3333 2.3333 -2.3333 0 0 2.0000 2.0000 0 0 0 5.0000 T1 = 6 2 2 4 -1 2 2 -3 1 0 2 3 0 1 1 4 T2 = T1 = [L][U] T2 = [P][A] Verify T1= T2

LU Decomposition with Pivoting » A=[1 0 2 3; -1 2 2 -3; 0 1 1 4; 6 2 2 4]; » b=[1; -1; 2; 1]; » [L,U,P]=LU_pivot(A); » Pb=P*b Pb = 1 -1 2 » x=LU_Solve(L,U,Pb) d = 1.0000 -0.8333 0.7143 2.3571 x = -0.1143 0.4714 0.2286 -0.1857 LU Decomposition [L][U]{x} = [P]{b} Forward Substitution Back Substitution

MATLAB’s Methods LU factorization [L,U] = lu (A) -- returns [L] and [U] [L, U, P] = lu (A) -- returns also the permutation matrix [P] Cholesky factorization: R = chol(A) -- [A] = [R][R] Determinant: det (A)

Forward and Back Substitutions LU Decomposition without Pivoting MATLAB function lu » A=[1 0 2 3; -1 2 2 -3; 0 1 1 4; 6 2 2 4]; » b=[1; -1; 2; 1]; » [L,U]=lu(A) L = 0.1667 -0.1429 1.0000 0 -0.1667 1.0000 0 0 0 0.4286 0 1.0000 1.0000 0 0 0 U = 6.0000 2.0000 2.0000 4.0000 0 2.3333 2.3333 -2.3333 0 0 2.0000 2.0000 0 0 0 5.0000 » L*U ans = 1 0 2 3 -1 2 2 -3 0 1 1 4 6 2 2 4 » d=L\b d = 1.0000 -0.8333 0.7143 2.3571 » x=U\d x = -0.1857 0.2286 -0.1143 0.4714 Forward and Back Substitutions LU Decomposition without Pivoting

Cholesky LU Factorization If [A] is symmetric and positive definite, it is convenient to use Cholesky decomposition. [A] = [L][L]T= [U]T[U] Cholesky factorization can be used for either symmetric or non-symmetric matrices No pivoting or scaling needed if [A] is symmetric and positive definite (all eigenvalues are positive) If [A] is not positive definite, the procedure may encounter the square root of a negative number

Cholesky LU Factorization For a general non-symmetric matrix For symmetric and positive definite matrices

Cholesky LU Decomposition

Example: Cholesky LU

Cholesky LU Factorization [A] = [U]T[U] = [U] [U] Recurrence relations

Script file for Cholesky Decomposition Symmetric Matrix L = U Compute only the upper triangular elements

» A=[9 -6 12 -3; -6 5 -9 2; 12 -9 21 0; -3 2 0 6] A = 9 -6 12 -3 -6 5 -9 2 12 -9 21 0 -3 2 0 6 » [L,U] = Cholesky(A) L = 3 0 0 0 -2 1 0 0 4 -1 2 0 -1 0 2 1 U = 3 -2 4 -1 0 1 -1 0 0 0 2 2 0 0 0 1 Symmetric [L] = [U]

MATLAB Function: chol Forward substitution Back substitution » U = chol(A) U = 3 -2 4 -1 0 1 -1 0 0 0 2 2 0 0 0 1 » U'*U ans = 9 -6 12 -3 -6 5 -9 2 12 -9 21 0 -3 2 0 6 » d = U'\b d = 8 -3 3 » x = U\d x = 1 -2 Forward substitution Back substitution