LU Decomposition Greg Beckham, Michael Sedivy. Overview.

Slides:



Advertisements
Similar presentations
§ 3.4 Matrix Solutions to Linear Systems.
Advertisements

Chapter: 3c System of Linear Equations
Algebraic, transcendental (i.e., involving trigonometric and exponential functions), ordinary differential equations, or partial differential equations...
Linear Systems LU Factorization CSE 541 Roger Crawfis.
Chapter 4 Systems of Linear Equations; Matrices Section 2 Systems of Linear Equations and Augmented Matrics.
MATH 685/ CSI 700/ OR 682 Lecture Notes
Systems of Linear Equations
SOLVING SYSTEMS OF LINEAR EQUATIONS. Overview A matrix consists of a rectangular array of elements represented by a single symbol (example: [A]). An individual.
Solution of linear system of equations
Chapter 9 Gauss Elimination The Islamic University of Gaza
Lecture 11 - LU Decomposition
Chapter 2, Linear Systems, Mainly LU Decomposition.
Solving Systems of Linear Equations Part Pivot a Matrix 2. Gaussian Elimination Method 3. Infinitely Many Solutions 4. Inconsistent System 5. Geometric.
Linear Algebraic Equations
Goldstein/Schnieder/Lay: Finite Math & Its Applications, 9e 1 of 86 Chapter 2 Matrices.
1 Systems of Linear Equations Iterative Methods. 2 B. Iterative Methods 1.Jacobi method and Gauss Seidel 2.Relaxation method for iterative methods.
1 Systems of Linear Equations Iterative Methods. 2 B. Direct Methods 1.Jacobi method and Gauss Seidel 2.Relaxation method for iterative methods.
ECIV 301 Programming & Graphics Numerical Methods for Engineers Lecture 17 Solution of Systems of Equations.
ECIV 301 Programming & Graphics Numerical Methods for Engineers Lecture 14 Elimination Methods.
ECIV 520 Structural Analysis II Review of Matrix Algebra.
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.
Chapter 1 Systems of Linear Equations
Systems of Linear Equations
10.1 Gaussian Elimination Method
1 Systems of Linear Equations Gauss-Jordan Elimination and LU Decomposition.
Chapter 5 Determinants.
Arithmetic Operations on Matrices. 1. Definition of Matrix 2. Column, Row and Square Matrix 3. Addition and Subtraction of Matrices 4. Multiplying Row.
CE 311 K - Introduction to Computer Methods Daene C. McKinney
Matrix Solution of Linear Systems The Gauss-Jordan Method Special Systems.
Compiled By Raj G. Tiwari
Scientific Computing Linear Systems – LU Factorization.
Using LU Decomposition to Optimize the modconcen.m Routine Matt Tornowske April 1, 2002.
Introduction to Numerical Analysis I MATH/CMPSC 455 PA=LU.
MIT and James Orlin © –Developed by James Orlin, MIT Animation of the Gauss-Jordan Elimination Algorithm.
CMPS 1371 Introduction to Computing for Engineers MATRICES.
EE616 Dr. Janusz Starzyk Computer Aided Analysis of Electronic Circuits Innovations in numerical techniques had profound import on CAD: –Sparse matrix.
DP (not Daniel Park's dance party). Dynamic programming Can speed up many problems. Basically, it's like magic. :D Overlapping subproblems o Number of.
 6.2 Pivoting Strategies 1/17 Chapter 6 Direct Methods for Solving Linear Systems -- Pivoting Strategies Example: Solve the linear system using 4-digit.
Slides for Parallel Programming Techniques & Applications Using Networked Workstations & Parallel Computers 2nd ed., by B. Wilkinson & M
Lecture 8 Matrix Inverse and LU Decomposition
Lecture 7 - Systems of Equations CVEN 302 June 17, 2002.
Chapter 5 MATRIX ALGEBRA: DETEMINANT, REVERSE, EIGENVALUES.
Section 4Chapter 4. 1 Copyright © 2012, 2008, 2004 Pearson Education, Inc. Objectives Solving Systems of Linear Equations by Matrix Methods Define.
10.3 Systems of Linear Equations: Matrices. A matrix is defined as a rectangular array of numbers, Column 1Column 2 Column jColumn n Row 1 Row 2 Row 3.
Chapter 9 Gauss Elimination The Islamic University of Gaza
3.6 Solving Systems Using Matrices You can use a matrix to represent and solve a system of equations without writing the variables. A matrix is a rectangular.
ECE 530 – Analysis Techniques for Large-Scale Electrical Systems Prof. Hao Zhu Dept. of Electrical and Computer Engineering University of Illinois at Urbana-Champaign.
Chapter 1 Systems of Linear Equations Linear Algebra.
H.Melikian/12101 System of Linear Equations and Augmented Matrices Dr.Hayk Melikyan Departmen of Mathematics and CS
Linear Systems Dinesh A.
STROUD Worked examples and exercises are in the text Programme 5: Matrices MATRICES PROGRAMME 5.
Unit #1 Linear Systems Fall Dr. Jehad Al Dallal.
STROUD Worked examples and exercises are in the text PROGRAMME 5 MATRICES.
Matrices. Variety of engineering problems lead to the need to solve systems of linear equations matrixcolumn vectors.
1 SYSTEM OF LINEAR EQUATIONS BASE OF VECTOR SPACE.
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 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.
Chapter: 3c System of Linear Equations
Chapter 2, Linear Systems, Mainly LU Decomposition
Spring Dr. Jehad Al Dallal
Linear Equations.
MATLAB EXAMPLES Matrix Solution Methods
Metode Eliminasi Pertemuan – 4, 5, 6 Mata Kuliah : Analisis Numerik
Animation of the Gauss-Jordan Elimination Algorithm
Lecture 8 Matrix Inverse and LU Decomposition
The Gauss Jordan method
Chapter 2, Linear Systems, Mainly LU Decomposition
Ax = b Methods for Solution of the System of Equations (ReCap):
Presentation transcript:

LU Decomposition Greg Beckham, Michael Sedivy

Overview

Step 1 This is handled implicitly in the code by only calculating the diagonal for β

Step 2

Calculating β ij for(j = 0; j < n; j++) // This is the loop over columns of Crout's method { for(i = 0; i < j; i++) // Equation (2.3.12) except for i = j { sum = a[i][j]; for(k = 0; k < i; k++) sum -= a[i][k] * a[k][j]; a[i][j] = sum; } … }

Calculating α ij

for(j = 0; j < n; j++) // This is the loop over columns of Crout's method { … for(i = j; i < n; i++)// This is i=j of equation (2.3.12) and i=j+1 { // N-1 of equation (2.3.13) sum = a[i][j]; for(k = 0; k < j; k++) sum -= a[i][k] * a[k][j]; a[i][j] = sum; … } … if(j != n - 1) // Divide by the pivot element { dum = 1.0/(a[j][j]); for(i = j + 1; i < n; i++) a[i][j] *= dum; } … }

Pivoting Initially finds largest element in each row Used as a “scaling factor”, not sure of use other than to rollover for(i = 0; i < n; i++) // Loop over the rows to get implicit scaling { // information big = 0.0; for(j = 0; j < n; j++) { if((temp = fabs(a[i][j])) > big) big = temp; } if (big == 0.0) { printf("ERROR: Singular matrix\n"); } // non-zero largest element. vv[i] = 1.0/big; // Save the scaling }

Pivoting if((dum = vv[i] * fabs(sum)) >= big) { // Is the figure of merit for the pivot better than the best so far? big = dum; imax = i; } Finds maximum

Pivoting if(j != imax) // Do we need to interchange rows? { for(k = 0; k < n; k++) // Interchange rows { dum = a[imax][k]; a[imax][k] = a[j][k]; a[j][k] = dum; } d = -d; // change the parity of d vv[imax] = vv[j]; // interchange scale factor } indx[j] = imax; Performs row interchanges

Related Questions What is the advantage of LU(P) solver over GJ(P) solver? (Complexity) – Both are O(N 3 ) – After LU(P) is solved, more solutions supposed to be found in O (N 2 ) Are you keeping L and U in the same matrix, or separate? Advantage/disadvantage? – LU are being created in place in the same matrix. – The advantage to this strategy is lower memory usage – The disadvantage is that the original matrix is lost I am somewhat confused with extraction of P in decomposition, and how it is then used in eq solving. Can you elaborate more?

Related Questions Cormen et al., p 824, used a single array instead of P. Needs careful explanation. – From Cormen et al “we dynamically maintain the permutation matrix P as an array π, where π[i] = j means that the ith row of P contains a 1 in column j |2| | | π = |3| => P | | |1| | |

Related Questions How complex equations are solved? (in Text) – If only the right hand side vector is complex then the operation can be performed by solving for the real part, then the imaginary – If the matrix itself is complex then Rewrite the algorithm for complex values Split the real and imaginary parts into separate real number and solve using existing algorithm – A * x – C * y = b – C * x + A * y = b

GJ vs. LUP: we found lup faster than gj, but…

GJ vs. LUP: lup not faster amortized

GJ vs. LUP Average Difference is Average Difference is