Direct Methods for Linear Systems Lecture 3 Alessandra Nardi Thanks to Prof. Jacob White, Suvranu De, Deepak Ramaswamy, Michal Rewienski, and Karen Veroy.

Slides:



Advertisements
Similar presentations
Chapter 2 Solutions of Systems of Linear Equations / Matrix Inversion
Advertisements

Linear Algebra Applications in Matlab ME 303. Special Characters and Matlab Functions.
Algebraic, transcendental (i.e., involving trigonometric and exponential functions), ordinary differential equations, or partial differential equations...
Modified Newton Methods Lecture 9 Alessandra Nardi Thanks to Prof. Jacob White, Jaime Peraire, Michal Rewienski, and Karen Veroy.
MATH 685/ CSI 700/ OR 682 Lecture Notes
Scientific Computing Linear Systems – Gaussian Elimination.
Solving Linear Systems (Numerical Recipes, Chap 2)
1.5 Elementary Matrices and a Method for Finding
Lecture 7 Intersection of Hyperplanes and Matrix Inverse Shang-Hua Teng.
SOLVING SYSTEMS OF LINEAR EQUATIONS. Overview A matrix consists of a rectangular array of elements represented by a single symbol (example: [A]). An individual.
CISE301_Topic3KFUPM1 SE301: Numerical Methods Topic 3: Solution of Systems of Linear Equations Lectures 12-17: KFUPM Read Chapter 9 of the textbook.
Lecture 9: Introduction to Matrix Inversion Gaussian Elimination Sections 2.4, 2.5, 2.6 Sections 2.2.3, 2.3.
Iterative Methods and QR Factorization Lecture 5 Alessandra Nardi Thanks to Prof. Jacob White, Suvranu De, Deepak Ramaswamy, Michal Rewienski, and Karen.
Linear Systems Pivoting in Gaussian Elim. CSE 541 Roger Crawfis.
Lecture 6 Matrix Operations and Gaussian Elimination for Solving Linear Systems Shang-Hua Teng.
Solution of linear system of equations
Chapter 9 Gauss Elimination The Islamic University of Gaza
1 EE 616 Computer Aided Analysis of Electronic Networks Lecture 3 Instructor: Dr. J. A. Starzyk, Professor School of EECS Ohio University Athens, OH,
Major: All Engineering Majors Author(s): Autar Kaw
1cs542g-term Notes  Assignment 1 will be out later today (look on the web)
Linear Algebraic Equations
QR Factorization –Direct Method to solve linear systems Problems that generate Singular matrices –Modified Gram-Schmidt Algorithm –QR Pivoting Matrix must.
Solutions for Nonlinear Equations
Mujahed AlDhaifallah (Term 342) Read Chapter 9 of the textbook
Systems of Linear Equations
Major: All Engineering Majors Author(s): Autar Kaw
Computational Methods in Physics PHYS 3437 Dr Rob Thacker Dept of Astronomy & Physics (MM-301C)
Scientific Computing Linear Systems – LU Factorization.
Advanced Computer Graphics Spring 2014 K. H. Ko School of Mechatronics Gwangju Institute of Science and Technology.
Square n-by-n Matrix.
MA2213 Lecture 5 Linear Equations (Direct Solvers)
Linear Systems Gaussian Elimination CSE 541 Roger Crawfis.
MATH 250 Linear Equations and Matrices
ΑΡΙΘΜΗΤΙΚΕΣ ΜΕΘΟΔΟΙ ΜΟΝΤΕΛΟΠΟΙΗΣΗΣ 4. Αριθμητική Επίλυση Συστημάτων Γραμμικών Εξισώσεων Gaussian elimination Gauss - Jordan 1.
MA/CS 375 Fall MA/CS 375 Fall 2003 Lecture 19.
Chapter 3 Solution of Algebraic Equations 1 ChE 401: Computational Techniques for Chemical Engineers Fall 2009/2010 DRAFT SLIDES.
Chemical Engineering Majors Author(s): Autar Kaw
 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
Lecture 7 - Systems of Equations CVEN 302 June 17, 2002.
Gaussian Elimination Electrical Engineering Majors Author(s): Autar Kaw Transforming Numerical Methods Education for.
Direct Methods for Sparse Linear Systems Lecture 4 Alessandra Nardi Thanks to Prof. Jacob White, Suvranu De, Deepak Ramaswamy, Michal Rewienski, and Karen.
Chapter 9 Gauss Elimination The Islamic University of Gaza
ECE 530 – Analysis Techniques for Large-Scale Electrical Systems Prof. Hao Zhu Dept. of Electrical and Computer Engineering University of Illinois at Urbana-Champaign.
Gaussian Elimination Industrial Engineering Majors Author(s): Autar Kaw Transforming Numerical Methods Education for.
Gaussian Elimination Mechanical Engineering Majors Author(s): Autar Kaw Transforming Numerical Methods Education for.
1 Chapter 7 Numerical Methods for the Solution of Systems of Equations.
Linear Systems Dinesh A.
Krylov-Subspace Methods - I Lecture 6 Alessandra Nardi Thanks to Prof. Jacob White, Deepak Ramaswamy, Michal Rewienski, and Karen Veroy.
Gaoal of Chapter 2 To develop direct or iterative methods to solve linear systems Useful Words upper/lower triangular; back/forward substitution; coefficient;
Gaussian Elimination Civil Engineering Majors Author(s): Autar Kaw Transforming Numerical Methods Education for STEM.
Unit #1 Linear Systems Fall Dr. Jehad Al Dallal.
Autar Kaw Benjamin Rigsby Transforming Numerical Methods Education for STEM Undergraduates.
Solution of Sparse Linear Systems Numerical Simulation CSE245 Thanks to: Kin Sou, Deepak Ramaswamy, Michal Rewienski, Jacob White, Shihhsien Kuo and Karen.
Numerical Computation Lecture 6: Linear Systems – part II United International College.
1 Numerical Methods Solution of Systems of Linear Equations.
PIVOTING The pivot or pivot element is the element of a matrix, or an array, which is selected first by an algorithm (e.g. Gaussian elimination, simplex.
Direct Methods for Sparse Linear Systems
Simultaneous Linear Equations
Spring Dr. Jehad Al Dallal
Gaussian Elimination.
Linear Equations.
Linear Algebra Lecture 15.
Chapter 10: Solving Linear Systems of Equations
Major: All Engineering Majors Author(s): Autar Kaw
Numerical Analysis Lecture10.
Lecture 13 Simultaneous Linear Equations – Gaussian Elimination (2) Partial Pivoting Dr .Qi Ying.
Lecture 8 Matrix Inverse and LU Decomposition
Ax = b Methods for Solution of the System of Equations (ReCap):
Presentation transcript:

Direct Methods for Linear Systems Lecture 3 Alessandra Nardi Thanks to Prof. Jacob White, Suvranu De, Deepak Ramaswamy, Michal Rewienski, and Karen Veroy

Last lecture review Formulation of circuit equations –Conservation laws (KCL, KVL) –Branch constitutive equations (BCE) –KCL, KVL, BCE combined in different ways: STA MNA

Outline Systems of linear equations –Existence and uniqueness review –Gaussian Elimination basics LU factorization Pivoting

Systems of linear equations Problem to solve: M x = b Given M x = b : –Is there a solution? –Is the solution unique?

Systems of linear equations Find a set of weights x so that the weighted sum of the columns of the matrix M is equal to the right hand side b

Systems of linear equations - Existence A solution exists when b is in the span of the columns of M A solution exists if: There exist weights, x 1, …., x N, such that:

Systems of linear equations - Uniqueness A solution is unique only if the columns of M are linearly independent. Then: Mx = b  Mx + My= b  M(x+y) = b Suppose there exist weights, y 1, …., y N, not all zero, such that:

Systems of linear equations Square matrices Given Mx = b, where M is square – If a solution exists for any b, then the solution for a specific b is unique. For a solution to exist for any b, the columns of M must span all N-length vectors. Since there are only N columns of the matrix M to span this space, these vectors must be linearly independent. A square matrix with linearly independent columns is said to be nonsingular.

Application Problems Matrix is n x n Often symmetric and diagonally dominant Nonsingular of real numbers

Methods for solving linear equations Direct methods: find the exact solution in a finite number of steps Iterative methods: produce a sequence a sequence of approximate solutions hopefully converging to the exact solution

Gaussian Elimination Basics Gaussian Elimination Method for Solving M x = b A “Direct” Method Finite Termination for exact result (ignoring roundoff) Produces accurate results for a broad range of matrices Computationally Expensive

Gaussian Elimination Basics Reminder by 3x3 example

Gaussian Elimination Basics – Key idea Use Eqn 1 to Eliminate x 1 from Eqn 2 and 3

GE Basics – Key idea in the matrix MULTIPLIERSPivot Remove x1 from eqn 2 and eqn 3

GE Basics – Key idea in the matrix Pivot Multiplier Remove x2 from eqn 3

GE Basics – Simplify the notation Remove x1 from eqn 2 and eqn 3

Pivot Multiplier GE Basics – Simplify the notation Remove x2 from eqn 3

GE Basics – GE yields triangular system Altered During GE ~ ~

GE Basics – Backward substitution

GE Basics – RHS updates

GE basics: summary (1) M x = b U x = yEquivalent system U: upper trg (2)Noticed that: Ly = bL: unit lower trg (3)U x = y LU x = b  M x = b GE  Efficient way of implementing GE: LU factorization

Solve M x = b Step 1 Step 2 Forward Elimination Solve L y = b Step 3 Backward Substitution Solve U x = y = M = L U Gaussian Elimination Basics Note: Changing RHS does not imply to recompute LU factorization

GE Basics – Fitting the pieces together

LU factorization Basics – Picture

LU Basics Source-row oriented approach algorithm For i = 1 to n-1 { “For each source row” For j = i+1 to n { “For each target row below the source” For k = i+1 to n { “For each row element beyond Pivot” } Pivot Multiplier

LU Basics Target-row oriented approach algorithm For i = 2 to n { “For each target row” For j = 1 to i-1 { “For each source row above the target” For k = j+1 to n { “For each row element beyond Pivot” } Pivot Multiplier

LU – Source-row and Target-row Multipliers Factored Portion Active Set k k Factored Portion Mult Active Set k k Source-Row oriented approach Target-Row oriented approach

For i = 1 to n-1 { “For each Row” For j = i+1 to n { “For each target Row below the source” For k = i+1 to n { “For each Row element beyond Pivot” } Pivot Multiplier multipliers Multiply-adds LU Basics – Computational Complexity

LU Basics – Limitations of the naïve approach Zero Pivots Small Pivots (Round-off error)  both can be solved with partial pivoting

At Step i Multipliers Factored Portion (L) Row i Row j What if Cannot form Simple Fix (Partial Pivoting) If Find Swap Row j with i LU Basics – Partial pivoting for zero pivots

Two Important Theorems 1) Partial pivoting (swapping rows) always succeeds if M is non singular 2) LU factorization applied to a diagonally dominant matrix will never produce a zero pivot LU Basics – Partial pivoting for zero pivots

LU Basics – Partial pivoting for small pivots GE

LU Basics – Partial pivoting for small pivots GE Rounded to 3 digits

64 bits 52 bits 11 bits sign Double precision number Basic Problem Avoid sum and subtraction of large and tiny numbers  Avoid big multipliers An Aside on Floating Point Arithmetic LU Basics – Partial pivoting for small pivots

Partial Pivoting for Roundoff reduction LU Basics – Partial pivoting for small pivots Small Multipliers

LU Basics – Partial pivoting for small pivots GE Rounded to 3 digits swap

Pivoting strategies Partial Pivoting: –Only row interchange Complete Pivoting –Row and Column interchange Threshold Pivoting –Only if prospective pivot is found to be smaller than a certain threshold k k k k

Summary Existence and uniqueness review Gaussian elimination basics –GE basics –LU factorization –Pivoting