MATH 685/ CSI 700/ OR 682 Lecture Notes

Slides:



Advertisements
Similar presentations
Rules of Matrix Arithmetic
Advertisements

Chapter 2 Solutions of Systems of Linear Equations / Matrix Inversion
Chapter: 3c System of Linear Equations
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...
Linear Systems LU Factorization CSE 541 Roger Crawfis.
Scientific Computing Linear Systems – Gaussian Elimination.
Solving Linear Systems (Numerical Recipes, Chap 2)
Lecture 7 Intersection of Hyperplanes and Matrix Inverse Shang-Hua Teng.
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.
Scientific Computing Chapter 3 - Linear Least squares
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.
Numerical Algorithms Matrix multiplication
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.
1cs542g-term Notes  Assignment 1 will be out later today (look on the web)
1cs542g-term Notes  Assignment 1 is out (questions?)
Linear Algebraic Equations
Goldstein/Schnieder/Lay: Finite Math & Its Applications, 9e 1 of 86 Chapter 2 Matrices.
Analysis of Triangular Factorization Lecture #8 EEE 574 Dr. Dan Tylavsky.
ECIV 520 Structural Analysis II Review of Matrix Algebra.
Math for CSLecture 31 LU Decomposition Pivoting Diagonalization Gram-Shcmidt Orthogonalization Lecture 3.
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.
Mujahed AlDhaifallah (Term 342) Read Chapter 9 of the textbook
Math for CSLecture 31 LU Decomposition Pivoting Diagonalization Gram-Shcmidt Orthogonalization Lecture 3.
Systems of Linear Equations
Finite Mathematics & Its Applications, 10/e by Goldstein/Schneider/SiegelCopyright © 2010 Pearson Education, Inc. 1 of 86 Chapter 2 Matrices.
1 1.1 © 2012 Pearson Education, Inc. Linear Equations in Linear Algebra SYSTEMS OF LINEAR EQUATIONS.
Eigenvalue Problems Solving linear systems Ax = b is one part of numerical linear algebra, and involves manipulating the rows of a matrix. The second main.
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.
Using LU Decomposition to Optimize the modconcen.m Routine Matt Tornowske April 1, 2002.
MATH 250 Linear Equations and Matrices
ΑΡΙΘΜΗΤΙΚΕΣ ΜΕΘΟΔΟΙ ΜΟΝΤΕΛΟΠΟΙΗΣΗΣ 4. Αριθμητική Επίλυση Συστημάτων Γραμμικών Εξισώσεων Gaussian elimination Gauss - Jordan 1.
Chapter 3 Solution of Algebraic Equations 1 ChE 401: Computational Techniques for Chemical Engineers Fall 2009/2010 DRAFT SLIDES.
 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.
MATH 685/ CSI 700/ OR 682 Lecture Notes Lecture 4. Least squares.
Matrices and Systems of Equations
Matrices and Systems of Equations
Direct Methods for Linear Systems Lecture 3 Alessandra Nardi Thanks to Prof. Jacob White, Suvranu De, Deepak Ramaswamy, Michal Rewienski, and Karen Veroy.
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.
1 Chapter 7 Numerical Methods for the Solution of Systems of Equations.
Lecture 6 - Single Variable Problems & Systems of Equations CVEN 302 June 14, 2002.
Linear Systems Dinesh A.
Gaoal of Chapter 2 To develop direct or iterative methods to solve linear systems Useful Words upper/lower triangular; back/forward substitution; coefficient;
Unit #1 Linear Systems Fall Dr. Jehad Al Dallal.
Lecture 9 Numerical Analysis. Solution of Linear System of Equations Chapter 3.
1 Numerical Methods Solution of Systems of Linear Equations.
Chapter: 3c System 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.
Simultaneous Linear Equations
Spring Dr. Jehad Al Dallal
Linear Equations.
Linear Systems, Mainly LU Decomposition
Chapter 8: Lesson 8.1 Matrices & Systems of Equations
Numerical Analysis Lecture14.
Numerical Analysis Lecture10.
Lecture 13 Simultaneous Linear Equations – Gaussian Elimination (2) Partial Pivoting Dr .Qi Ying.
Lecture 8 Matrix Inverse and LU Decomposition
Presentation transcript:

MATH 685/ CSI 700/ OR 682 Lecture Notes Math 685/CSI 700 Spring 08 MATH 685/ CSI 700/ OR 682 Lecture Notes Lecture 3. Solving linear systems George Mason University, Department of Mathematical Sciences

Solving linear systems Math 685/CSI 700 Spring 08 Solving linear systems To solve linear system, transform it into one whose solution is same but easier to compute What type of transformation of linear system leaves solution unchanged? We can premultiply (from left) both sides of linear system Ax = b by any nonsingular matrix M without affecting solution Solution to MAx =Mb is given by George Mason University, Department of Mathematical Sciences

Permutation matrices Math 685/CSI 700 Spring 08 George Mason University, Department of Mathematical Sciences

Scaling Math 685/CSI 700 Spring 08 George Mason University, Department of Mathematical Sciences

Triangular form What type of linear system is easy to solve? Math 685/CSI 700 Spring 08 Triangular form What type of linear system is easy to solve? If one equation in system involves only one component of solution (i.e., only one entry in that row of matrix is nonzero), then that component can be computed by division If another equation in system involves only one additional solution component, then by substituting one known component into it, we can solve for other component If this pattern continues, with only one new solution component per equation, then all components of solution can be computed in succession. System with this property is called triangular George Mason University, Department of Mathematical Sciences

Triangular form Math 685/CSI 700 Spring 08 George Mason University, Department of Mathematical Sciences

Gaussian elimination Math 685/CSI 700 Spring 08 George Mason University, Department of Mathematical Sciences

Gaussian elimination Math 685/CSI 700 Spring 08 George Mason University, Department of Mathematical Sciences

Example Math 685/CSI 700 Spring 08 George Mason University, Department of Mathematical Sciences

Elimination Math 685/CSI 700 Spring 08 George Mason University, Department of Mathematical Sciences

Elimination matrices Math 685/CSI 700 Spring 08 George Mason University, Department of Mathematical Sciences

Elimination matrices Math 685/CSI 700 Spring 08 George Mason University, Department of Mathematical Sciences

Example Math 685/CSI 700 Spring 08 George Mason University, Department of Mathematical Sciences

Example Math 685/CSI 700 Spring 08 George Mason University, Department of Mathematical Sciences

Gaussian elimination Math 685/CSI 700 Spring 08 George Mason University, Department of Mathematical Sciences

Gaussian elimination Math 685/CSI 700 Spring 08 George Mason University, Department of Mathematical Sciences

LU decomposition Math 685/CSI 700 Spring 08 George Mason University, Department of Mathematical Sciences

LU decomposition Math 685/CSI 700 Spring 08 George Mason University, Department of Mathematical Sciences

Example Math 685/CSI 700 Spring 08 George Mason University, Department of Mathematical Sciences

Example Math 685/CSI 700 Spring 08 George Mason University, Department of Mathematical Sciences

Example Math 685/CSI 700 Spring 08 George Mason University, Department of Mathematical Sciences

Example Math 685/CSI 700 Spring 08 George Mason University, Department of Mathematical Sciences

Math 685/CSI 700 Spring 08 Row interchanges Gaussian elimination breaks down if leading diagonal entry of remaining unreduced matrix is zero at any stage Easy fix: if diagonal entry in column k is zero, then interchange row k with some subsequent row having nonzero entry in column k and then proceed as usual If there is no nonzero on or below diagonal in column k, then there is nothing to do at this stage, so skip to next column Zero on diagonal causes resulting upper triangular matrix U to be singular, but LU factorization can still be completed Subsequent back-substitution will fail, however, as it should for singular matrix George Mason University, Department of Mathematical Sciences

Math 685/CSI 700 Spring 08 Partial pivoting In principle, any nonzero value will do as pivot, but in practice pivot should be chosen to minimize error propagation To avoid amplifying previous rounding errors when multiplying remaining portion of matrix by elementary elimination matrix, multipliers should not exceed 1 in magnitude This can be accomplished by choosing entry of largest magnitude on or below diagonal as pivot at each stage Such partial pivoting is essential in practice for numerically stable implementation of Gaussian elimination for general linear systems George Mason University, Department of Mathematical Sciences

LU with pivoting Math 685/CSI 700 Spring 08 George Mason University, Department of Mathematical Sciences

Complete pivoting Math 685/CSI 700 Spring 08 George Mason University, Department of Mathematical Sciences

Example Math 685/CSI 700 Spring 08 George Mason University, Department of Mathematical Sciences

Small pivots Math 685/CSI 700 Spring 08 George Mason University, Department of Mathematical Sciences

Small pivots Math 685/CSI 700 Spring 08 George Mason University, Department of Mathematical Sciences

Pivoting not required sometimes Math 685/CSI 700 Spring 08 Pivoting not required sometimes George Mason University, Department of Mathematical Sciences

Residual Math 685/CSI 700 Spring 08 George Mason University, Department of Mathematical Sciences

Residual Math 685/CSI 700 Spring 08 George Mason University, Department of Mathematical Sciences

Example Math 685/CSI 700 Spring 08 George Mason University, Department of Mathematical Sciences

Example Math 685/CSI 700 Spring 08 George Mason University, Department of Mathematical Sciences

Implementing Gaussian elimination Math 685/CSI 700 Spring 08 Implementing Gaussian elimination George Mason University, Department of Mathematical Sciences

Complexity Math 685/CSI 700 Spring 08 George Mason University, Department of Mathematical Sciences

Inversion vs. Factorization Math 685/CSI 700 Spring 08 Inversion vs. Factorization George Mason University, Department of Mathematical Sciences

Math 685/CSI 700 Spring 08 Modified systems If right-hand side of linear system changes but matrix does not, then LU factorization need not be repeated to solve new system Only forward- and back-substitution need be repeated for new right-hand side This is substantial savings in work, since additional triangular solutions cost only O(n2) work, in contrast to O(n3) cost of factorization George Mason University, Department of Mathematical Sciences

Rank-one update Math 685/CSI 700 Spring 08 George Mason University, Department of Mathematical Sciences

Rank-one update Math 685/CSI 700 Spring 08 George Mason University, Department of Mathematical Sciences

Example Math 685/CSI 700 Spring 08 George Mason University, Department of Mathematical Sciences

Example Math 685/CSI 700 Spring 08 George Mason University, Department of Mathematical Sciences

Math 685/CSI 700 Spring 08 Scaling In principle, solution to linear system is unaffected by diagonal scaling of matrix and right-hand-side vector In practice, scaling affects both conditioning of matrix and selection of pivots in Gaussian elimination, which in turn affect numerical accuracy in finite-precision arithmetic It is usually best if all entries (or uncertainties in entries) of matrix have about same size Sometimes it may be obvious how to accomplish this by choice of measurement units for variables, but there is no foolproof method for doing so in general Scaling can introduce rounding errors if not done carefully George Mason University, Department of Mathematical Sciences

Scaling Math 685/CSI 700 Spring 08 George Mason University, Department of Mathematical Sciences

Iterative refinement Math 685/CSI 700 Spring 08 George Mason University, Department of Mathematical Sciences

Math 685/CSI 700 Spring 08 Iterative refinement Iterative refinement requires double storage, since both original matrix and its LU factorization are required Due to cancellation, residual usually must be computed with higher precision for iterative refinement to produce meaningful improvement For these reasons, iterative improvement is often impractical to use routinely, but it can still be useful in some circumstances For example, iterative refinement can sometimes stabilize otherwise unstable algorithm George Mason University, Department of Mathematical Sciences

SPD matrices Math 685/CSI 700 Spring 08 George Mason University, Department of Mathematical Sciences

Cholesky decomposition Math 685/CSI 700 Spring 08 Cholesky decomposition Features of Cholesky algorithm for symmetric positive definite matrices All n square roots are of positive numbers, so algorithm is well defined No pivoting is required to maintain numerical stability Only lower triangle of A is accessed, and hence upper triangular portion need not be stored Only n3/6 multiplications and similar number of additions are required Thus, Cholesky factorization requires only about half work and half storage compared with LU factorization of general matrix by Gaussian elimination, and also avoids need for pivoting George Mason University, Department of Mathematical Sciences

Math 685/CSI 700 Spring 08 Banded matrices Gaussian elimination for band matrices differs little from general case — only ranges of loops change Typically matrix is stored in array by diagonals to avoid storing zero entries If pivoting is required for numerical stability, bandwidth can grow (but no more than double) General purpose solver for arbitrary bandwidth is similar to code for Gaussian elimination for general matrices For fixed small bandwidth, band solver can be extremely simple, especially if pivoting is not required for stability George Mason University, Department of Mathematical Sciences

Iterative vs. direct methods Math 685/CSI 700 Spring 08 Iterative vs. direct methods Gaussian elimination is direct method for solving linear system, producing exact solution in finite number of steps (in exact arithmetic) Iterative methods begin with initial guess for solution and successively improve it until desired accuracy attained In theory, it might take infinite number of iterations to converge to exact solution, but in practice iterations are terminated when residual is as small as desired For some types of problems, iterative methods have significant advantages over direct methods George Mason University, Department of Mathematical Sciences