Linear Systems LU Factorization CSE 541 Roger Crawfis.

Slides:



Advertisements
Similar presentations
LU Factorization.
Advertisements

1 Linear Triangular System L – lower triangular matrix, nonsingular Lx=b L: nxn nonsingular lower triangular b: known vector b(1) = b(1)/L(1,1) For i=2:n.
MATH 685/ CSI 700/ OR 682 Lecture Notes
Scientific Computing Linear Systems – Gaussian Elimination.
Linear Systems of Equations
Chapter 8 Numerical Technique 大葉大學 資訊工程系 黃鈴玲 Linear Algebra.
Lecture 7 Intersection of Hyperplanes and Matrix Inverse Shang-Hua Teng.
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.
Lecture 9: Introduction to Matrix Inversion Gaussian Elimination Sections 2.4, 2.5, 2.6 Sections 2.2.3, 2.3.
Chapter 9.1 = LU Decomposition MATH 264 Linear Algebra.
Linear Systems Pivoting in Gaussian Elim. CSE 541 Roger Crawfis.
Lecture 6 Matrix Operations and Gaussian Elimination for Solving Linear Systems Shang-Hua Teng.
Solution of linear system of equations
1cs542g-term Notes  Assignment 1 will be out later today (look on the web)
1cs542g-term Notes  Assignment 1 is out (questions?)
Matrices and Systems of Equations
Mujahed AlDhaifallah (Term 342) Read Chapter 9 of the textbook
Gauss-Jordan Matrix Elimination Brought to you by Tutorial Services – The Math Center.
Solving a System of Equations by ELIMINATION. Elimination Solving systems by Elimination: 1.Line up like terms in standard form x + y = # (you may have.
LU Decomposition 1. Introduction Another way of solving a system of equations is by using a factorization technique for matrices called LU decomposition.
Scientific Computing Linear Systems – LU Factorization.
2.1 Operations with Matrices 2.2 Properties of Matrix Operations
Square n-by-n Matrix.
Matrix Algebra. Quick Review Quick Review Solutions.
Linear Systems Gaussian Elimination CSE 541 Roger Crawfis.
Chap. 2 Matrices 2.1 Operations with Matrices
Using LU Decomposition to Optimize the modconcen.m Routine Matt Tornowske April 1, 2002.
MATH 250 Linear Equations and Matrices
G AUSSIAN E LIMINATION Presented by: Max Le Max Le Justin Lavorgna Data Structures II: Algorithm Design & Analysis Algorithm Design & Analysis.
Introduction to Numerical Analysis I MATH/CMPSC 455 LU Factorization.
CHAPTER 2 MATRICES 2.1 Operations with Matrices Matrix
Lecture 8 Matrix Inverse and LU Decomposition
Section 7-3 Solving 3 x 3 systems of equations. Solving 3 x 3 Systems  substitution (triangular form)  Gaussian elimination  using an augmented matrix.
Section 8.6 Elimination using Matrices. Matrix Method The method computers use. The equations need to be in standard form. The coefficients and constants.
Matrices and Systems of Equations
Elimination Method: Solve the linear system. -8x + 3y=12 8x - 9y=12.
ECE 530 – Analysis Techniques for Large-Scale Electrical Systems Prof. Hao Zhu Dept. of Electrical and Computer Engineering University of Illinois at Urbana-Champaign.
1/18/ LU Decomposition Industrial Engineering Majors Authors: Autar Kaw Transforming.
 Recall that when you wanted to solve a system of equations, you used to use two different methods.  Substitution Method  Addition Method.
3/1/ LU Decomposition Computer Engineering Majors Authors: Autar Kaw Transforming.
Gaoal of Chapter 2 To develop direct or iterative methods to solve linear systems Useful Words upper/lower triangular; back/forward substitution; coefficient;
Unit #1 Linear Systems Fall Dr. Jehad Al Dallal.
Autar Kaw Benjamin Rigsby Transforming Numerical Methods Education for STEM Undergraduates.
2 - 1 Chapter 2A Matrices 2A.1 Definition, and Operations of Matrices: 1 Sums and Scalar Products; 2 Matrix Multiplication 2A.2 Properties of Matrix Operations;
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.
Solving a System of Equations by ELIMINATION. Elimination Solving systems by Elimination: 1.Line up like terms in standard form x + y = # (you may have.
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 8 Numerical Technique
Lecture 2 Matrices Lat Time - Course Overview
Spring Dr. Jehad Al Dallal
Linear Equations.
Linear Algebra Lecture 15.
6-3 Solving Systems Using Elimination
Elementary Matrix Methid For find Inverse
Matrix Solutions to Linear Systems
Numerical Computation and Optimization
Numerical Analysis Lecture10.
Linear Systems Numerical Methods.
Gaussian Elimination.
Major: All Engineering Majors Authors: Autar Kaw
Solve the linear system.
Lecture 8 Matrix Inverse and LU Decomposition
Linear Systems of Equations: solution and applications
Ax = b Methods for Solution of the System of Equations (ReCap):
Presentation transcript:

Linear Systems LU Factorization CSE 541 Roger Crawfis

Gaussian Elimination We are going to look at the algorithm for Gaussian Elimination as a sequence of matrix operations (multiplies). Not really how you want to implement it, but gives a better framework for the theory, and our next topic: LU-factorization.

Permutations A permutation matrix P is a re-ordering of the identity matrix I. It can be used to: Interchange the order of the equations Interchange the rows of A and b Interchange the order of the variables This technique changes the order of the solution variables. Hence a reordering is required after the solution is found.

Permutation Matrix Properties of a Permutation matrix: |P| = 1 => non-singular P -1 = P P T = P Switches equations 1 and 3.

Permutation Matrix Order is important! Switches variables 1 and 3.

Permutation Matrix Apply a permutation to a linear system: Changes the order of the equations (need to include b), whereas: Permutes the order of the variables (b’s stay the same).

Adding Two Equations What matrix operation allows us to add two rows together? Consider MA, where: Leaves this equation alone Adds equations 2 and 3

Undoing the Operation Note that the inverse of this operation is to simply subtract the unchanged equation 2 from the new equation 3.

Gaussian Elimination The first set of multiply and add operations in Gaussian Elimination can thus be represented as:

Gaussian Elimination Note, the scale factors in the second step use the new set of equations (a`)!

Gaussian Elimination The composite of all of these matrices reduce A to a triangular form: Can rewrite this: Ux = y where U=MA Mb = y or M -1 y = b

Gaussian Elimination What is M -1 ? Just add the scaled row back in!

Gaussian Elimination These are all lower triangular matrices. The product of lower triangular matrices is another lower triangular matrix. These are even simpler! Just keep track of the scale factors!!!

LU Factorization Let L = M -1 and U = MA L is a lower triangular matrix with 1’s on the diagonal. U is an upper triangular matrix: Given these, we can trivially solve (in O(n 2 ) time): Ly = b – forward substitution Ux = y – backward substitution

LU Factorization Note, L and U are only dependent on A. A = LU – a factorization of A Hence, Ax=b implies LUx = b or Ly = b where Ux = y Find y and then we can solve for x. Both operations in O(n 2 ) time.

LU Factorization Problem: How do we compute the LU factorization? Answer: Gaussian Elimination Which is O(n 3 ) time, so no free lunch!

LU Factorization In many cases, the matrix A defines the structure of the problem, while the vector b defines the current state or initial conditions. The structure remains fixed! Hence, we need to solve a set or sequence of problems:

LU Factorization LU Factorization works great for these problems: If we have M problems or time steps, we have O(n 3 +Mn 2 ) versus O(Mn 3 ) time complexity. In many situations, M > n

C# Implementation // Factor A into LU in-place A->LU for (int k=0; k<n-1; k++) { try { for (int i=k+1; i<n; i++) { a[i,k] = a[i,k] / a[k,k]; for(int j=k+1; j<n; j++) a[i,j] -= a[k,j] * a[i,k]; } catch (DivideByZeroException e) { Console.WriteLine(e.Message); } This used to be a local variable s, for scale factor Now we transform A into U, but store the lower triangular L in the bottom part of A. We do not store the diagonal of L.