CS412: Lecture #17. Mridul Aanjaneya. March 19, 2015

Similar documents
Direct Methods for Solving Linear Systems. Matrix Factorization

2.1 Gaussian Elimination

Direct Methods for Solving Linear Systems. Simon Fraser University Surrey Campus MACM 316 Spring 2005 Instructor: Ha Le

1 Multiply Eq. E i by λ 0: (λe i ) (E i ) 2 Multiply Eq. E j by λ and add to Eq. E i : (E i + λe j ) (E i )

AMS526: Numerical Analysis I (Numerical Linear Algebra)

Gaussian Elimination and Back Substitution

Linear Algebra Section 2.6 : LU Decomposition Section 2.7 : Permutations and transposes Wednesday, February 13th Math 301 Week #4

ANALYTICAL MATHEMATICS FOR APPLICATIONS 2018 LECTURE NOTES 3

CS 323: Numerical Analysis and Computing

Numerical Linear Algebra

COURSE Numerical methods for solving linear systems. Practical solving of many problems eventually leads to solving linear systems.

MODULE 7. where A is an m n real (or complex) matrix. 2) Let K(t, s) be a function of two variables which is continuous on the square [0, 1] [0, 1].

LU Factorization. LU Decomposition. LU Decomposition. LU Decomposition: Motivation A = LU

MATH 3511 Lecture 1. Solving Linear Systems 1

Solution of Linear Equations

Lecture 12 (Tue, Mar 5) Gaussian elimination and LU factorization (II)

Pivoting. Reading: GV96 Section 3.4, Stew98 Chapter 3: 1.3

SOLVING LINEAR SYSTEMS

The System of Linear Equations. Direct Methods. Xiaozhou Li.

AMS 209, Fall 2015 Final Project Type A Numerical Linear Algebra: Gaussian Elimination with Pivoting for Solving Linear Systems

. =. a i1 x 1 + a i2 x 2 + a in x n = b i. a 11 a 12 a 1n a 21 a 22 a 1n. i1 a i2 a in

CHAPTER 6. Direct Methods for Solving Linear Systems

The Solution of Linear Systems AX = B

Linear Algebra and Matrix Inversion

Linear Equations and Matrix

MTH 464: Computational Linear Algebra

Computational Linear Algebra

Solving Linear Systems Using Gaussian Elimination. How can we solve

CME 302: NUMERICAL LINEAR ALGEBRA FALL 2005/06 LECTURE 6

MATRIX ALGEBRA AND SYSTEMS OF EQUATIONS. + + x 1 x 2. x n 8 (4) 3 4 2

Roundoff Analysis of Gaussian Elimination

CSE 160 Lecture 13. Numerical Linear Algebra

Computational Methods. Systems of Linear Equations

Solving Dense Linear Systems I

Linear Algebraic Equations

STAT 309: MATHEMATICAL COMPUTATIONS I FALL 2018 LECTURE 13

MH1200 Final 2014/2015

Introduction to PDEs and Numerical Methods Lecture 7. Solving linear systems

30.3. LU Decomposition. Introduction. Prerequisites. Learning Outcomes

Gaussian Elimination without/with Pivoting and Cholesky Decomposition

12/1/2015 LINEAR ALGEBRA PRE-MID ASSIGNMENT ASSIGNED BY: PROF. SULEMAN SUBMITTED BY: M. REHAN ASGHAR BSSE 4 ROLL NO: 15126

y b where U. matrix inverse A 1 ( L. 1 U 1. L 1 U 13 U 23 U 33 U 13 2 U 12 1

Example: Current in an Electrical Circuit. Solving Linear Systems:Direct Methods. Linear Systems of Equations. Solving Linear Systems: Direct Methods

Draft. Lecture 12 Gaussian Elimination and LU Factorization. MATH 562 Numerical Analysis II. Songting Luo

Determinants. Chia-Ping Chen. Linear Algebra. Professor Department of Computer Science and Engineering National Sun Yat-sen University 1/40

A Review of Matrix Analysis

CS475: Linear Equations Gaussian Elimination LU Decomposition Wim Bohm Colorado State University

Hani Mehrpouyan, California State University, Bakersfield. Signals and Systems

LINEAR SYSTEMS (11) Intensive Computation

Scientific Computing

MA2501 Numerical Methods Spring 2015

CS227-Scientific Computing. Lecture 4: A Crash Course in Linear Algebra

1.5 Gaussian Elimination With Partial Pivoting.

Review. Example 1. Elementary matrices in action: (a) a b c. d e f = g h i. d e f = a b c. a b c. (b) d e f. d e f.

MODEL ANSWERS TO THE THIRD HOMEWORK

1 GSW Sets of Systems

On the Stability of LU-Factorizations

Fundamentals of Engineering Analysis (650163)

DEN: Linear algebra numerical view (GEM: Gauss elimination method for reducing a full rank matrix to upper-triangular

Numerical Linear Algebra

Program Lecture 2. Numerical Linear Algebra. Gaussian elimination (2) Gaussian elimination. Decompositions, numerical aspects

Linear Analysis Lecture 16

Lecture 2 INF-MAT : , LU, symmetric LU, Positve (semi)definite, Cholesky, Semi-Cholesky

Introduction to Mathematical Programming

Matrix decompositions

LU Factorization. LU factorization is the most common way of solving linear systems! Ax = b LUx = b

Matrix decompositions

Today s class. Linear Algebraic Equations LU Decomposition. Numerical Methods, Fall 2011 Lecture 8. Prof. Jinbo Bi CSE, UConn

Systems of Linear Equations

Dense LU factorization and its error analysis

1.Chapter Objectives

14.2 QR Factorization with Column Pivoting

7. LU factorization. factor-solve method. LU factorization. solving Ax = b with A nonsingular. the inverse of a nonsingular matrix

LU Factorization a 11 a 1 a 1n A = a 1 a a n (b) a n1 a n a nn L = l l 1 l ln1 ln 1 75 U = u 11 u 1 u 1n 0 u u n 0 u n...

Numerical Linear Algebra

Basic Concepts in Linear Algebra

Linear Systems and LU

Matrices and systems of linear equations

Linear Algebra. Solving Linear Systems. Copyright 2005, W.R. Winfrey

4.2 Floating-Point Numbers

Applied Mathematics 205. Unit II: Numerical Linear Algebra. Lecturer: Dr. David Knezevic

April 26, Applied mathematics PhD candidate, physics MA UC Berkeley. Lecture 4/26/2013. Jed Duersch. Spd matrices. Cholesky decomposition

Chapter 4 No. 4.0 Answer True or False to the following. Give reasons for your answers.

Review of Basic Concepts in Linear Algebra

Matrix Factorization and Analysis

Solving linear equations with Gaussian Elimination (I)

This can be accomplished by left matrix multiplication as follows: I

MTH 215: Introduction to Linear Algebra

Numerical Methods I Solving Square Linear Systems: GEM and LU factorization

GAUSSIAN ELIMINATION AND LU DECOMPOSITION (SUPPLEMENT FOR MA511)

22A-2 SUMMER 2014 LECTURE 5

LU Factorization. Marco Chiarandini. DM559 Linear and Integer Programming. Department of Mathematics & Computer Science University of Southern Denmark

Hermite normal form: Computation and applications

Matrix decompositions

ECE133A Applied Numerical Computing Additional Lecture Notes

Process Model Formulation and Solution, 3E4

Chapter 1: Systems of linear equations and matrices. Section 1.1: Introduction to systems of linear equations

CS513, Spring 2007 Prof. Amos Ron Assignment #5 Solutions Prepared by Houssain Kettani. a mj i,j [2,n] a 11

Solving linear systems (6 lectures)

5 Solving Systems of Linear Equations

Transcription:

CS: Lecture #7 Mridul Aanjaneya March 9, 5 Solving linear systems of equations Consider a lower triangular matrix L: l l l L = l 3 l 3 l 33 l n l nn A procedure similar to that for upper triangular systems can be followed to solve Lx = b The overall complexity is again O(n ) Algorithm Forward substitution for Lx = b: : for j = n do : if l jj = then 3: return matrix is singular : end if 5: x j b j /l jj 6: for i = j + n do 7: b i b i l ij x j : end for 9: end for The forward and backward substitution processes can be used to solve a non-triangular system by virtue of the following factorization property Theorem If A is an n n matrix, it can be (generally) written as a product: A = LU where L is a lower triangular matrix and U is an upper triangular matrix Furthermore, it is possible to construct L such that all diagonal elements l ii =

Algorithm LU factorization by Gaussian Elimination : for k = n do : if a kk = then 3: return : end if 5: for i = k + n do 6: a ik a ik /a kk 7: end for : for j = k + n do 9: for i = k + n do : a ij a ij a ik a kj : end for : end for 3: end for Note that this algorithm executes in-place, ie, the matrix A is replaced by its LU factorization, in compact form More specifically, this algorithm produces a factorization A = LU, where: L = l O l 3 l 3 l l l 3 l n n n l n3 l n,n, U = u u u 3 u n u u 3 u n u 33 u 3n O un,n u nn After the in-place factorization algorithm completes, A is replaced by the following compacted encoding of L and U together: u u u 3 u n l u u 3 u n A = l 3 l 3 u 33 u 3n l n l n l n,n u nn Here is a slightly different algorithm for Gaussian Elimination via elimination matrices Define the basis vector e k as: e k =

where the is in the kth row and the length of e k is n In order to perform Gaussian Elimination on the kth column a k of A, we define the n n elimination matrix M k = I m k e T k where m k = a kk a k+,k a n,k M k adds multiples of row k to the rows > k in order to create s As an example, for a k = (,, ) T Similarly, M a k = = M a k = / = The inverse of an elimination matrix is defined as L k = M k = I + m k e T k For example, L = M =, and L = M = / The algorithm now proceeds as follows Consider the example: 9 3 3 7 x x x 3 = First, we eliminate the lower triangular portion of A one column at a time using M k to get U = M n M A Note that we also carry out the operations on b to get a new system of equations M M Ax = M M b or Ux = M M b which can be solved for via back substitution M A = 9 3 3 7 = 5 3

M b = = M M A = 5 = M M b = = Finally, solve the following system via back substitution x y z = Note that using the fact that the L matrices are inverses of the M matrices allows us to write LU = (L L n )(M n M A) = A where L = L L n can be formed trivially from the M k to obtain: L = L L = = And thus, although we never needed it to solve the equations, the LU factorization of A is A = 9 3 3 7 = = LU Existence/Uniqueness and pivoting When computing the LU factorization, the algorithm will halt if the diagonal element a kk = This can be avoided by swapping rows of A prior to computing the LU factorization This is done to always select the largest a kk from the equations that follow As an example, consider the matrix A and the action of the permutation matrix P on it

A = 5 3 6 3, P =, P A = 5 6 3 3 This is pivoting: the pivot a kk is selected to be non-zero In this process, we can guarantee uniqueness and existence of LU: Theorem If P is a permutation matrix such that all pivots in the Gaussian Elimination of P A are non-zero, and l ii =, then the LU factorization exists and is unique! P A = LU 5