Solving Scale Linear Systems (Example system continued) Lecture 14 MA/CS 471 Fall 2003.

Slides:



Advertisements
Similar presentations
LU Factorization.
Advertisements

5.1 Real Vector Spaces.
Block LU Factorization Lecture 24 MA471 Fall 2003.
Lecture 4.
1D MODELS Logan; chapter 2.
ECE 552 Numerical Circuit Analysis Chapter Four SPARSE MATRIX SOLUTION TECHNIQUES Copyright © I. Hajj 2012 All rights reserved.
Computational Methods for Management and Economics Carla Gomes Module 8b The transportation simplex method.
1 Systems of Linear Equations & Matrices Sections 4.2 & 4.3 After today’s lesson, you will be able to Use terms associated with matrices. Set up and solve.
MA/CS 375 Fall MA/CS 375 Fall 2002 Lecture 18 Sit in your groups.
LU - Factorizations Matrix Factorization into Triangular Matrices.
MATH 685/ CSI 700/ OR 682 Lecture Notes
Sparse Matrices in Matlab John R. Gilbert Xerox Palo Alto Research Center with Cleve Moler (MathWorks) and Rob Schreiber (HP Labs)
1.7 Diagonal, Triangular, and Symmetric Matrices.
Systems of Linear Equations
1cs542g-term Notes  Assignment 1 will be out later today (look on the web)
1cs542g-term Notes  Assignment 1 is out (questions?)
1cs542g-term Notes  Assignment 1 is out (due October 5)  Matrix storage: usually column-major.
1cs542g-term Notes  Simpler right-looking derivation (sorry):
1cs542g-term Notes  r 2 log r is technically not defined at r=0 but can be smoothly continued to =0 there  Question (not required in assignment):
Lecture 19 Quadratic Shapes and Symmetric Positive Definite Matrices Shang-Hua Teng.
1cs542g-term Notes  Note that r 2 log(r) is NaN at r=0: instead smoothly extend to be 0 at r=0  Schedule a make-up lecture?
ECIV 301 Programming & Graphics Numerical Methods for Engineers Lecture 17 Solution of Systems of Equations.
How to use Matrix Market matrices in Matlab The Matrix Market is an interesting collection of matrices from a variety of applications.
Lecture 7 Sept 19, 11 Goals: two-dimensional arrays (continued) matrix operations circuit analysis using Matlab image processing – simple examples Chapter.
Sparse Matrix Methods Day 1: Overview Matlab and examples Data structures Ax=b Sparse matrices and graphs Fill-reducing matrix permutations Matching and.
Lecture 6 Sept 15, 09 Goals: two-dimensional arrays matrix operations circuit analysis using Matlab image processing – simple examples.
MA/CS 375 Fall MA/CS 375 Fall 2002 Lecture 32.
Matrix table of values
Arithmetic Operations on Matrices. 1. Definition of Matrix 2. Column, Row and Square Matrix 3. Addition and Subtraction of Matrices 4. Multiplying Row.
1.7 Diagonal, Triangular, and Symmetric Matrices 1.
1 Systems of Linear Equations & Matrices Sections 4.2 & 4.3 After today’s lesson, you will be able to Use terms associated with matrices. Set up and solve.
Linear Algebra With Applications by Otto Bretscher. Page The Determinant of any diagonal nxn matrix is the product of its diagonal entries. True.
CS 290H Lecture 12 Column intersection graphs, Ordering for sparsity in LU with partial pivoting Read “Computing the block triangular form of a sparse.
Solving Scale Linear Systems (Example system) Lecture 13 MA/CS 471 Fall 2003.
Systems and Matrices (Chapter5)
Solving Scalar Linear Systems Iterative approach Lecture 15 MA/CS 471 Fall 2003.
Using LU Decomposition to Optimize the modconcen.m Routine Matt Tornowske April 1, 2002.
Numerical Methods Part: Cholesky and Decomposition
MA/CS 375 Fall MA/CS 375 Fall 2003 Lecture 19.
Chapter Content Real Vector Spaces Subspaces Linear Independence
ECE 530 – Analysis Techniques for Large-Scale Electrical Systems Prof. Hao Zhu Dept. of Electrical and Computer Engineering University of Illinois at Urbana-Champaign.
Lecture 7 Matrices CSCI – 1900 Mathematics for Computer Science Fall 2014 Bill Pine.
 6.2 Pivoting Strategies 1/17 Chapter 6 Direct Methods for Solving Linear Systems -- Pivoting Strategies Example: Solve the linear system using 4-digit.
MA/CS 375 Fall MA/CS 375 Fall 2002 Lecture 21.
Lecture 8 Matrix Inverse and LU Decomposition
Solving Linear Systems of Equations
Lesson 3 CSPP58001.
Solution of Sparse Linear Systems
Elementary Linear Algebra Anton & Rorres, 9 th Edition Lecture Set – 07 Chapter 7: Eigenvalues, Eigenvectors.
Eigenvalues The eigenvalue problem is to determine the nontrivial solutions of the equation Ax= x where A is an n-by-n matrix, x is a length n column.
Meeting 18 Matrix Operations. Matrix If A is an m x n matrix - that is, a matrix with m rows and n columns – then the scalar entry in the i th row and.
1 Pattern Recognition: Statistical and Neural Lonnie C. Ludeman Lecture 29 Nov 11, 2005 Nanjing University of Science & Technology.
Direct Methods for Sparse Linear Systems Lecture 4 Alessandra Nardi Thanks to Prof. Jacob White, Suvranu De, Deepak Ramaswamy, Michal Rewienski, and Karen.
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.
Cramer’s Rule for Matrices You can use properties of matrix determinants for a variety of applications. Today: – Solving 3 variable systems of equations.
1 Spring 2003 Prof. Tim Warburton MA557/MA578/CS557 Lecture 34.
ECE 530 – Analysis Techniques for Large-Scale Electrical Systems Prof. Hao Zhu Dept. of Electrical and Computer Engineering University of Illinois at Urbana-Champaign.
ECE 530 – Analysis Techniques for Large-Scale Electrical Systems Prof. Hao Zhu Dept. of Electrical and Computer Engineering University of Illinois at Urbana-Champaign.
Unit #1 Linear Systems Fall Dr. Jehad Al Dallal.
Solution of Sparse Linear Systems Numerical Simulation CSE245 Thanks to: Kin Sou, Deepak Ramaswamy, Michal Rewienski, Jacob White, Shihhsien Kuo and Karen.
This represents the most probable value of the measured variable. The more readings you take, the more accurate result you will get.
Matrices. Variety of engineering problems lead to the need to solve systems of linear equations matrixcolumn vectors.
Direct Methods for Sparse Linear Systems
MA/CS 375 Fall 2002 Lecture 9 MA/CS375 Fall 2002.
MA/CS 375 Spring 2002 Lecture 19 MA/CS 375 Fall 2002.
Numerical Methods Part: Cholesky and Decomposition
ECEN 615 Methods of Electric Power Systems Analysis
Lecture 7 System of Linear Differential Equations fall semester
Lecture 8 Matrix Inverse and LU Decomposition
Ax = b Methods for Solution of the System of Equations:
Presentation transcript:

Solving Scale Linear Systems (Example system continued) Lecture 14 MA/CS 471 Fall 2003

Today We will discuss direct methods for a slightly larger loop current problem as introduced last time. Then we will look at a much larger problem and examine the memory/work requirements for direct methods.

Note It is important that at least one loop has a resistor that lies only on that loop (i.e. at least one resistor lying on a wire not shared by two loops). Otherwise the entire circuit will short circuit around the boundary of the entire circuit.. For example: 44 33 22 11 66 77 1 4 33 22 11 66 77 1

Circuit Problem Enlarged Problem: Find the current running through each closed loop 11 44 33 22 11 55 66 77 30V 1 44 33 22 11 55 66 77 20V 1 44 33 22 11 55 66 77 10V 2 11

Shortcut to Loop Current Matrix To obtain the n’th row of the Matrix: 1)The diagonal entry is equal to the sum of the resistances on the n’th loop 2)There is an off diagonal entry for each neighbor of the loop which is equal to: a) –sum(resistances) on shared wire if loop currents are in opposite direction b) sum(resistances) on shared wire if loop currents are in the same direction 11 44 33 22 11 55 66 77 30V 1 44 33 22 11 55 66 77 20V 1 44 33 22 11 55 66 77 10V 2 11

11 44 33 22 11 55 66 77 1 44 33 22 11 55 66 77 1 44 33 22 11 55 66 77 2 11

Using Sparse Matrices in Matlab

Run bigcircuit 1)Create the list of non-zeros 2)Convert the list to Matlab’s sparse matrix format 3)Convert the sparse matrix to a full matrix (just for viewing)

Counting the Non-Zeros with nnz We can use Matlab’s built in nnz function to find the number of non-zeros: i.e. there are only 58 non-zero entries out of 17x17=289 possible

Now We LU Factorize The Sparse Matrix Since there are only a few degrees of freedom we will use a direct method to factorize and solve the system. We can use the built in LU factorization of the matrix… i.e. find two matrices L & U such that A=LU where L is logically lower triangle and U is logically upper triangle..

LU Factorization of Loop Current Matrix

Solving The System Now we have factorized the system into A=LU we can solve in three stages. 1)Build the source vector, v 2)Solve y = L\v 3)Solve for the currents I = U\y

11 44 33 22 11 55 66 77 1 44 33 22 11 55 66 77 1 44 33 22 11 55 66 77 2 11 V 20V 10V Solving for the loop currents using an LU factorization

11 44 33 22 11 55 66 77 1 44 33 22 11 55 66 77 1 44 33 22 11 55 66 77 2 11 V 20V 10V Solving for the loop currents using an LU factorization

Let’s Renumber Matlab has a built in routine symrcm which takes a symmetric matrix and returns a permutation array so that if we use this to permute the unknowns (by column and row swaps) the bandwidth of the matrix may be reduced…

Renumbering with symrcm

How Were The Loops Renumbered We can examine the permutation matrix: i.e. the old 13 cell becomes the new 1 cell 6->2, 14->3…

11 44 33 22 11 55 66 77 1 44 33 22 11 55 66 77 1 44 33 22 11 55 66 77 2 11 1 44 33 22 11 55 66 77 1 44 33 22 11 55 66 77 1 44 33 22 11 55 66 77 2 11

Let’s Figure Out the Sequence of Shells in symrcm 11 44 33 22 11 55 66 77 1 44 33 22 11 55 66 77 1 44 33 22 11 55 66 77 2 11 Level 1 Level 2 Level 3 Level 4 Level 5 Level 6

Let’s Try LU Factorization of the Reordered Matrix

Effect of Reordering Before After

Notes We could have also used Cholesky factorization (since the loop current matrix is symmetric). Just by reordering unknowns we have changed the amount of fill in the L,U factors of the matrix. Changing the ordering of cells will not change the answer (beyond round off). However, we have reduced the amount of work required in the backsolves.

Solving The Reordered System

Comparing The Results We can compare the results from solving using the original matrix and using the reordered matrix: No reorderingWith reordering

OK – Let’s Get Serious And Look At A Large Circuit Case We can construct a random circuit:

The Sparsity Pattern of a Loop Circuit Matrix for a Random Circuit (with 1000 closed loops)

Notes For a more realistic circuit (i.e. with less random interconnects) the fill in the L & U matrices will be reduced more after reordering using RCM

Lab Task Construct a more realistic “random” circuit for an arbitrary N (i.e. design a process which randomly grows a circuit). Use an interconnect of say 4 per cell on average. Time how long the LU factorization takes for N=10,100,1000,1e4,1e5,1e6,1e7,1e8 and plot a graph of time v. N Calculate the number of non-zeros (i.e. how much memory is taken by the L & U matrices). Plot this as a function of N. Solve with a random source vector for N=10,100,…,1e6 and time how long the backsolves take and plot a graph of time v. N Perform a polynomial fit of the timings (estimate the polynomial growth rate with N)… USE SPARSE MATRICES!. You can use Cholesky if you wish.