Linear Systems Dinesh A Solving triangular systems v

  • Slides: 28
Download presentation
Linear Systems Dinesh A

Linear Systems Dinesh A

Solving triangular systems v Forward substitution - For solving Lower triangular systems Consider a

Solving triangular systems v Forward substitution - For solving Lower triangular systems Consider a system described by the following equation If then the unknowns can be determined sequentially This is 2 -by-2 version of an algorithm known as forward substitution. The general procedure is obtained by solving the ith equation Lx=b for xi v Back Substitution – For Solving Upper triangular systems (Ux=b)

Column oriented versions v Forward substitution Algorithm If the matrix is lower triangular and

Column oriented versions v Forward substitution Algorithm If the matrix is lower triangular and then this algorithm overwrites b with the solution to Lx=b where L is non singular v Back substitution Algorithm If the matrix is upper triangular and then this algorithm overwrites b with the solution Ux=b where U is non-singular

Multiple Right-hand sides v Problem - Computing a solution is lower triangular and v

Multiple Right-hand sides v Problem - Computing a solution is lower triangular and v Approach - The computation is blocked in such a way that the resulting algorithm is rich in matrix multiplication, assuming that q and n are large enough. It is sufficient to consider just the lower triangular case as the derivation of block back substitution is entirely analogous. We start by partitioning the equation LX = B as follows: v. Assume that the diagonal blocks are square. Paralleling the development of algorithm discussed in column oriented version, we solve the system L 11 X 1 = B 1 for X 1 and then remove X 1 from block equations 2 through N:

Properties of triangular matrices v A unit triangular matrix is a triangular matrix with

Properties of triangular matrices v A unit triangular matrix is a triangular matrix with 1's on the diagonal v The inverse of an upper (lower) triangular matrix is upper (lower) triangular v. The product of two upper (lower) triangular matrices is upper (lower) triangula v. The inverse of a unit upper (lower) triangular matrix is unit upper (lower) triangular. v The product of two unit upper (lower) triangular matrices is unit upper (lower) triangular.

LU Factorization v The LU factorization is a high-level algebraic description of Gaussian elimination

LU Factorization v The LU factorization is a high-level algebraic description of Gaussian elimination v Gaussian Elimination – Convert a given system Ax = b to an equivalent triangular system v The conversion is achieved by taking appropriate linear combinations of the equations v The algorithm computes a unit lower triangular matrix L and an upper triangular matrix U so that A = LU v The solution to the original Ax = b problem is then found by a two-step triangular solve process

Gauss Transformation v Matrix description of zeroing process: At n=2 level if then In

Gauss Transformation v Matrix description of zeroing process: At n=2 level if then In general, suppose with If and we define v A matrix of the form a Gauss transformation if the first k components of are zero

Applying Gauss transformation v If and is a Gauss transformation, then is an outer

Applying Gauss transformation v If and is a Gauss transformation, then is an outer product update v Since only is affected and the update C=Mk. C can be computed row by row as v This computation requires 2(n - k)r flops

Upper triangularization v Consider . The Gauss transformations M 1, M 2, …. .

Upper triangularization v Consider . The Gauss transformations M 1, M 2, …. . , Mn-1 can be found such that Mn-1 Mn-2…M 1 A = U is upper triangular. v The complete upper triangularization of A can be achieved in n-1 steps, whose algorithm is shown below v At the start of the kth step we have a matrix A (k-l) = Mk-l · · · M 1 A that is upper triangular in columns 1 through k - 1. v The multipliers in the kth Gauss transform Mk are based on A(k-l) (k + l: n, k) and akk (k-1) must be nonzero in order to proceed v The matrix entries must be nonzero and are called pivots

Existence criteria •

Existence criteria •

Outer product version •

Outer product version •

Gaxpy Algorithm •

Gaxpy Algorithm •

LU factorization of rectangular matrices •

LU factorization of rectangular matrices •

Block LU factorization v Recursive Algorithm v Non-recursive algorithm

Block LU factorization v Recursive Algorithm v Non-recursive algorithm

Round-off error in Gaussian elimination v Errors in LU factorization Theorem. Assume that A

Round-off error in Gaussian elimination v Errors in LU factorization Theorem. Assume that A is an n-by-n matrix of floating point numbers. If no zero pivots are encountered during the execution of outer product algorithm, then the computed triangular matrices and satisfy v Triangular Solving with Inexact Triangles Theorem. Let and be the computed LU factors obtained by outer product algorithm when it is applied to an n-by-n floating point matrix A. If the methods of triangular systems are used to produce the computed solution ỹ to Ĺy = b and the computed solution ẋ to Ūx=y, then (A + E) ẋ = b with

Pivoting v If a small pivot is encountered, then we can expect large numbers

Pivoting v If a small pivot is encountered, then we can expect large numbers to be in L and U v Gaussian elimination can give arbitrarily poor results, even for well conditioned problems v Pivoting is a technique to determine a permuted version of A that has a reasonably stable LU factorization v Partial Pivoting, Complete Pivoting and Rook Pivoting strategies will be discussed v Interchanging rows can be useful in overcoming the difficulty of small pivots. For example, consider Let P be a permutation given by, . Then, Here, we observe that triangular factors have modestly sized entries

Interchange Permutations •

Interchange Permutations •

Partial Pivoting v Interchange permutations are used in LU computations to guarantee that no

Partial Pivoting v Interchange permutations are used in LU computations to guarantee that no multiplier is greater than 1 in absolute value v Algorithm. v This particular row interchange strategy is called partial pivoting and upon completion, we have where U is Upper triangular matrix

Outer product algorithm v This algorithm computes the factorization PA = LU where P

Outer product algorithm v This algorithm computes the factorization PA = LU where P is a permutation matrix encoded by piv(1: n - 1), L is unit lower triangular with |lij|<1, and U is upper triangular v For i = 1: n, A(i, i: n) is overwritten by U(i, i: n) and A(i+1: n, i) is overwritten by L(i+1: n, i)

Gaxpy algorithm v. For i = 1: n, A(i, i: n) is overwritten by

Gaxpy algorithm v. For i = 1: n, A(i, i: n) is overwritten by U(i, i: n) and A(i+1: n, i) is overwritten by L(i+1: n, i). v. The permutation P is given by P = ∏n-1… ∏ 1 where ∏k is an interchange permutation obtained by swapping rows k and piv(k) of In.

Complete Pivoting v Complete pivoting has the property that the associated growth factor bound

Complete Pivoting v Complete pivoting has the property that the associated growth factor bound is considerably smaller than 2 n-1 v The growth factor measures how large the A-entries become during the process of elimination. The definition of growth factor is given by, where is the computed version of the matrix A(k) = v In complete pivoting, the largest entry in the current submatrix A(k: n, k: n) is permuted into the (k, k) position

Outer product LU with Complete Pivoting •

Outer product LU with Complete Pivoting •

Rook pivoting v Rook pivoting is an alternative to Partial and Complete pivoting v

Rook pivoting v Rook pivoting is an alternative to Partial and Complete pivoting v The algorithm is slightly modified from complete pivoting in a way that instead of choosing as pivot the largest value in |A(k: n, k: n)|, it searches for an element of that submatrix that is maximal in both its row and column v To implement rook pivoting, the scan and swap portion of complete pivoting algorithm is changed to

Undetermined Systems •

Undetermined Systems •

Residual Size vs Accuracy •

Residual Size vs Accuracy •

Condition estimation •

Condition estimation •

Algorithm for Condition Estimator

Algorithm for Condition Estimator

Parallel LU •

Parallel LU •