Solving Linear Systems Ax=b

Slides:



Advertisements
Similar presentations
MATH 685/ CSI 700/ OR 682 Lecture Notes
Advertisements

Linear Systems of Equations
Solving Linear Systems (Numerical Recipes, Chap 2)
1.5 Elementary Matrices and a Method for Finding
Rayan Alsemmeri Amseena Mansoor. LINEAR SYSTEMS Jacobi method is used to solve linear systems of the form Ax=b, where A is the square and invertible.
Iterative methods TexPoint fonts used in EMF. Read the TexPoint manual before you delete this box.: AAA A A A A A A A.
Numerical Algorithms Matrix multiplication
Modern iterative methods For basic iterative methods, converge linearly Modern iterative methods, converge faster –Krylov subspace method Steepest descent.
Solution of linear system of equations
Linear Algebraic Equations
CS 584. Review n Systems of equations and finite element methods are related.
Special Matrices and Gauss-Siedel
Special Matrices and Gauss-Siedel
Maverick Woo Iterative Methods and Combinatorial Preconditioners.
CS240A: Conjugate Gradients and the Model Problem.
Partial differential equations Function depends on two or more independent variables This is a very simple one - there are many more complicated ones.
Numerical Analysis 1 EE, NCKU Tien-Hao Chang (Darby Chang)
Domain decomposition in parallel computing Ashok Srinivasan Florida State University COT 5410 – Spring 2004.
Advanced Computer Graphics Spring 2014 K. H. Ko School of Mechatronics Gwangju Institute of Science and Technology.
Square n-by-n Matrix.
MATH 250 Linear Equations and Matrices
Scientific Computing Partial Differential Equations Poisson Equation.
CS 219: Sparse Matrix Algorithms
Linear Systems Iterative Solutions CSE 541 Roger Crawfis.
Linear algebra: matrix Eigen-value Problems Eng. Hassan S. Migdadi Part 1.
Chapter 5 MATRIX ALGEBRA: DETEMINANT, REVERSE, EIGENVALUES.
Elliptic PDEs and the Finite Difference Method
CSE 589 Part VI. Reading Skiena, Sections 5.5 and 6.8 CLR, chapter 37.
CSE 245: Computer Aided Circuit Simulation and Verification Matrix Computations: Iterative Methods I Chung-Kuan Cheng.
Solution of Sparse Linear Systems
CS240A: Conjugate Gradients and the Model Problem.
Linear Systems – Iterative methods
Case Study in Computational Science & Engineering - Lecture 5 1 Iterative Solution of Linear Systems Jacobi Method while not converged do { }
Direct Methods for Linear Systems Lecture 3 Alessandra Nardi Thanks to Prof. Jacob White, Suvranu De, Deepak Ramaswamy, Michal Rewienski, and Karen Veroy.
ECE 530 – Analysis Techniques for Large-Scale Electrical Systems Prof. Hao Zhu Dept. of Electrical and Computer Engineering University of Illinois at Urbana-Champaign.
Domain decomposition in parallel computing Ashok Srinivasan Florida State University.
CS 290H Administrivia: May 14, 2008 Course project progress reports due next Wed 21 May. Reading in Saad (second edition): Sections
CS 290H Lecture 15 GESP concluded Final presentations for survey projects next Tue and Thu 20-minute talk with at least 5 min for questions and discussion.
Linear Systems Dinesh A.
Krylov-Subspace Methods - I Lecture 6 Alessandra Nardi Thanks to Prof. Jacob White, Deepak Ramaswamy, Michal Rewienski, and Karen Veroy.
Searching a Linear Subspace Lecture VI. Deriving Subspaces There are several ways to derive the nullspace matrix (or kernel matrix). ◦ The methodology.
Symmetric-pattern multifrontal factorization T(A) G(A)
Linear Algebra Engineering Mathematics-I. Linear Systems in Two Unknowns Engineering Mathematics-I.
Conjugate gradient iteration One matrix-vector multiplication per iteration Two vector dot products per iteration Four n-vectors of working storage x 0.
Laplacian Matrices of Graphs: Algorithms and Applications ICML, June 21, 2016 Daniel A. Spielman.
Iterative Solution Methods
MAT 322: LINEAR ALGEBRA.
Krylov-Subspace Methods - I
Gauss-Siedel Method.
Numerical Analysis Lecture12.
Iterative Methods Good for sparse matrices Jacobi Iteration
Finite Element Method To be added later 9/18/2018 ELEN 689.
Systems of First Order Linear Equations
CSE 245: Computer Aided Circuit Simulation and Verification
Autar Kaw Benjamin Rigsby
Degree and Eigenvector Centrality
RECORD. RECORD Gaussian Elimination: derived system back-substitution.
Iterative Aggregation Disaggregation
CSE 245: Computer Aided Circuit Simulation and Verification
Matrix Methods Summary
Numerical Analysis Lecture14.
Numerical Analysis Lecture13.
Numerical Analysis Lecture10.
Linear Systems Numerical Methods.
Numerical Linear Algebra
Solving Linear Systems: Iterative Methods and Sparse Systems
Iterative Methods and Combinatorial Preconditioners
Numerical Analysis Lecture11.
Ax = b Methods for Solution of the System of Equations:
Ax = b Methods for Solution of the System of Equations (ReCap):
Presentation transcript:

Solving Linear Systems Ax=b 7/3/2018

Linear Systems n by n matrix n by 1 vector A x = b known unknown

Linear Systems in The Real World

Circuit Voltage Problem Given a resistive network and the net current flow at each terminal, find the voltage at each node. 2A 2A A node with an external connection is a terminal. Otherwise it’s a junction. 3S 2S 1S Conductance is the reciprocal of resistance. Its unit is siemens (S). 1S 4A

Kirchoff’s Law of Current At each node, net current flow = 0. Consider v1. We have which after regrouping yields 2A 2A 2 + 3 ( v ¡ 1 ) = ; 3S v2 2S v1 v4 3 ( v 1 ¡ 2 ) + = : 1S 1S I=VC 4A v3

Summing Up 2A 2A Here A represents conductances, v represents voltages at nodes, and Av is the net current flow at each node. 3S v2 2S v1 v4 1S 1S 4A v3

Solving 2A 2A Here A represents conductances, v represents voltages at nodes, and Av is the net current flow at each node. 3S 2S 2V 2V 3V 1S 1S 4A 0V

Sparse Matrix An n by n matrix is sparse when there are O(n) nonzeros. A reasonably-sized power grid has way more junctions and each junction has only a couple of neighbors. 3 v2 2 v1 v4 1 1 v3

Sparse Matrix Representation A simple scheme An array of columns, where each column Aj is a linked-list of tuples (i, x).

Modeling a Physical System Let G(x, y) and g(x, y) be continuous functions defined in R and S respectively, where R and S are respectively the region and the boundary of the unit square (as in the figure). R S 1

Modeling a Physical System We seek a function u(x, y) that satisfies Poisson’s equation in R and the boundary condition in S. @ 2 u x + y = G ( ; ) u ( x ; y ) = g R S 1 Example: g(x, y) specifies fixed temperature at each point on the boundary, G(x, y)=0, u(x, y) is the temperature at each interior point.

Example Temperature on three sides of a square plate is 0 and on one side is . http://www.math.uiuc.edu/~jlebl/286-dirich.pdf

Discretization Imagine a uniform grid with a small spacing h. h 1

Finite Difference Method Replace the partial derivatives by difference quotients Poisson’s equation now becomes @ 2 u = x s [ ( + h ; y ) ¡ ] @ 2 u = y s [ ( x ; + h ) ¡ ] 4 u ( x ; y ) ¡ + h = 2 G Exercise: Derive the 5-pt diff. eqt. from first principle (limit).

For each point in R The total number of equations is 4 u ( x ; y ) ¡ + h = 2 G The total number of equations is Now write them in the matrix form, we’ve got one BIG linear system to solve! ( 1 h ¡ ) 2 4 u ( x ; y ) ¡ + h = 2 G

An Example Consider u3,1, we have which can be rearranged as 4 u ( x ; y ) ¡ + h = 2 G Consider u3,1, we have which can be rearranged as 4 4 u ( 3 ; 1 ) ¡ 2 = G u32 u21 u31 u41 4 u ( 3 ; 1 ) ¡ 2 = G + u30 4

An Example Each row and column can have a maximum of 5 nonzeros. 4 u ( ; y ) ¡ + h = 2 G Each row and column can have a maximum of 5 nonzeros.

A b x = How to Solve? Find A-1 Direct Method: Gaussian Elimination Iterative Method: Guess x repeatedly until we guess a solution

Inverse Of Sparse Matrices …are not necessarily sparse! A A-1

Direct Methods

Solution by LU Decomposition

Transform A to U through Gaussian Elimination

L Specified by Multiples of pivots

Pivoting Creates Fill

Reordering rows and columns doesn’t change solution

… but might reduce fill

Graph Model of Matrix

Graph View of Partitioning

Disclaimer

Min-Degree Heuristic Alternatively, eliminate vertex with smallest fill.

Separators

Nested Dissection

Nested Dissection Example

Analysis of Nested Dissection

Results Concerning Fill Finding an elimination order with minimal fill is hopeless Garey and Johnson-GT46, Yannakakis SIAM JADM 1981 O(log n) Approximation Sudipto Guha, FOCS 2000 Nested Graph Dissection and Approximation Algorithms (n log n) lower bound on fill (Maverick still has not dug up the paper…)

Iterative Methods

Algorithms Apply to Laplacians Given a positively weighted, undirected graph G = (V, E), we can represent it as a Laplacian matrix. 3 v2 2 v1 v4 1 1 v3

Laplacians Laplacians have many interesting properties, such as Diagonals ¸ 0 denotes total incident weights Off-diagonals < 0 denotes individual edge weights Row sum = 0, column sum = 0 Symmetric 3 v2 2 v1 v4 1 1 v3

Laplacian??? Earlier I showed you a system that is not quite Laplacian. Boundary points don’t have 4 neighbors

Making It Laplacian We add a dummy variable and force it to zero.

The Basic Idea Start off with a guess x (0). Use x (i ) to compute x (i+1) until convergence. We hope the process converges in a small number of iterations each iteration is efficient

The RF Method [Richardson, 1910] Residual x ( i + 1 ) = ¡ A b Domain A Range x x(i) b Test x(i+1) Ax(i) Correct Units are all wrong! x(i) is voltage, residual is current!

Why should it converge at all? x ( i + 1 ) = ¡ A b Domain Range x x(i) b Test x(i+1) Ax(i) Correct

It only converges when… x ( i + 1 ) = ¡ A b Theorem A first-order stationary iterative method converges iff x ( i + 1 ) = G k ½ ( G ) < 1 . (A) is the maximum absolute eigenvalue of G

Fate? A x = b Once we are given the system, we do not have any control on A and b. How do we guarantee even convergence?

Instead of dealing with A and b, we now deal with B-1A and B-1b. Preconditioning B - 1 A x = b Instead of dealing with A and b, we now deal with B-1A and B-1b. The word “preconditioning” originated with Turing in 1948, but his idea was slightly different.

Preconditioned RF x = ¡ B A b ( i + 1 ) = ¡ B - A b Since we may precompute B-1b by solving By = b, each iteration is dominated by computing B-1Ax(i), which is a multiplication step Ax(i) and a direct-solve step Bz = Ax(i). Hence a preconditioned iterative method is in fact a hybrid.

The Art of Preconditioning We have a lot of flexibility in choosing B. Solving Bz = Ax(i) must be fast B should approximate A well for a low iteration count I A Trivial What’s the point? B

Classics x = ¡ B A b Jacobi ( i + 1 ) = ¡ B - A b Jacobi Let D be the diagonal sub-matrix of A. Pick B = D. Gauss-Seidel Let L be the lower triangular part of A w/ zero diagonals Pick B = L + D. Conjugate gradient Move in an orthogonal direction in each iteration