Chapter 11 Gaussian Elimination (I)

Slides:



Advertisements
Similar presentations
Chapter 2 Section 2. Lemma Let i=1 and j=2, then.
Advertisements

4.3 Matrix Approach to Solving Linear Systems 1 Linear systems were solved using substitution and elimination in the two previous section. This section.
Chapter 2 Simultaneous Linear Equations
4/22/ LU Decomposition Electrical Engineering Majors Authors: Autar Kaw Transforming.
4/26/ LU Decomposition Civil Engineering Majors Authors: Autar Kaw Transforming.
Chapter 4 Systems of Linear Equations; Matrices Section 2 Systems of Linear Equations and Augmented Matrics.
LU - Factorizations Matrix Factorization into Triangular Matrices.
MATH 685/ CSI 700/ OR 682 Lecture Notes
Chapter 8 Numerical Technique 大葉大學 資訊工程系 黃鈴玲 Linear Algebra.
Lecture 7 Intersection of Hyperplanes and Matrix Inverse Shang-Hua Teng.
LU Factorization LU-factorization Matrix factorization Forward substitution Back substitution.
Major: All Engineering Majors Authors: Autar Kaw
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.
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.
Lecture 6 Matrix Operations and Gaussian Elimination for Solving Linear Systems Shang-Hua Teng.
Lecture 11 - LU Decomposition
1cs542g-term Notes  Assignment 1 will be out later today (look on the web)
Chapter 15 C-implementation PA = LU Speaker: Lung-Sheng Chien.
Chapter 2 Section 1 Solving a System of Linear Equations (using Matrices)
Mujahed AlDhaifallah (Term 342) Read Chapter 9 of the textbook
Chapter 12 Gaussian Elimination (II) Speaker: Lung-Sheng Chien Reference book: David Kincaid, Numerical Analysis Reference lecture note: Wen-wei Lin, chapter.
Methods for Dummies FIL January Jon Machtynger & Jen Marchant
Solving System of Linear Equations. 1. Diagonal Form of a System of Equations 2. Elementary Row Operations 3. Elementary Row Operation 1 4. Elementary.
1 1.1 © 2012 Pearson Education, Inc. Linear Equations in Linear Algebra SYSTEMS OF LINEAR EQUATIONS.
Elementary Linear Algebra
Scientific Computing Linear Systems – LU Factorization.
1.2 Matrices Vectors and Gauss – Jordan elimination (This is such an interesting topic that it was made into a movie)
Square n-by-n Matrix.
AN INTRODUCTION TO ELEMENTARY ROW OPERATIONS Tools to Solve Matrices.
Math 201 for Management Students
Using LU Decomposition to Optimize the modconcen.m Routine Matt Tornowske April 1, 2002.
Numerical Computation Lecture 7: Finding Inverses: Gauss-Jordan United International College.
Introduction to Numerical Analysis I MATH/CMPSC 455 PA=LU.
Yasser F. O. Mohammad Assiut University Egypt. Previously in NM Introduction to NM Solving single equation System of Linear Equations Vectors and Matrices.
MATLAB Harri Saarnisaari, Part of Simulations and Tools for Telecommunication Course.
Lecture 8 Matrix Inverse and LU Decomposition
Matrices and Systems of Equations
Matrices and Systems of Linear Equations
Matrices and Systems of Equations
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/18/ LU Decomposition Industrial Engineering Majors Authors: Autar Kaw Transforming.
4.8 Using matrices to solve systems! 2 variable systems – by hand 3 or more variables – using calculator!
Linear Systems Dinesh A.
 Recall that when you wanted to solve a system of equations, you used to use two different methods.  Substitution Method  Addition Method.
3/1/ LU Decomposition Computer Engineering Majors Authors: Autar Kaw Transforming.
Finishing up Chapter 5. Will this code enter the if statement? G=[30,55,10] if G
Slide Copyright © 2009 Pearson Education, Inc. 7.4 Solving Systems of Equations by Using Matrices.
Unit #1 Linear Systems Fall Dr. Jehad Al Dallal.
Autar Kaw Benjamin Rigsby Transforming Numerical Methods Education for STEM Undergraduates.
Multivariable linear systems.  The following system is said to be in row-echelon form, which means that it has a “stair-step” pattern with leading coefficients.
Gaussian Elimination Digital Lesson. Copyright © by Houghton Mifflin Company, Inc. All rights reserved. 2 Gaussian elimination with back-substitution.
1 Numerical Methods Solution of Systems of Linear Equations.
LU Decomposition ● In Gauss elimination; Forward elimination Backward substitution Major computational effort Low computational effort can be used for.
College Algebra Chapter 6 Matrices and Determinants and Applications
Linear Equations in Linear Algebra
Chapter 4 Systems of Linear Equations; Matrices
Chapter 8 Numerical Technique
Spring Dr. Jehad Al Dallal
Linear Equations.
Chapter 8: Lesson 8.1 Matrices & Systems of Equations
Chapter 10: Solving Linear Systems of Equations
RECORD. RECORD Gaussian Elimination: derived system back-substitution.
Linear Equations in Linear Algebra
Major: All Engineering Majors Authors: Autar Kaw
Lecture 8 Matrix Inverse and LU Decomposition
Matrices are identified by their size.
Linear Systems of Equations: solution and applications
Presentation transcript:

Chapter 11 Gaussian Elimination (I) Speaker: Lung-Sheng Chien Reference book: David Kincaid, Numerical Analysis

OutLine Basic operation of matrix - representation - three elementary matrices Example of Gaussian Elimination (GE) Formal description of GE MATLAB usage

Matrix notation in MATLAB 6 -2 2 4 12 -8 6 10 3 -13 9 3 -6 4 1 -18

Matrix-vector product Inner-product based 6 -2 2 4 x1 6 x1 + (-2) x2 + 2 x3 + 4 x4 12 -8 6 10 x2 12 x1 + (-8) x2 + 6 x3 + 10 x4 3 -13 9 3 x3 3 x1 + (-13) x2 + 9 x3 + 3 x4 -6 4 1 -18 x4 (-6) x1 + 4 x2 + 1 x3 + (-18) x4 outer-product based 6 -2 2 4 x1 6 -2 2 4 12 -8 6 10 x2 12 -8 6 10 x1 x2 x3 x4 3 -13 9 3 x3 3 -13 9 3 -6 4 1 -18 x4 -6 4 1 -18

Matrix-vector product: MATLAB implementation matvec.m Inner-product based outer-product based Question: which one is better

Column-major nature in MATLAB physical index : 1D 6 1 12 2 3 3 Question: how does column-major affect inner-product based matrix-vector product and outer-product based matrix-vector product? -6 4 Logical index : 2D -2 5 -8 6 6 -2 2 4 -13 7 12 -8 6 10 4 8 3 -13 9 3 2 9 -6 4 1 -18 6 10 9 11 1 12 4 13 10 14 3 15 -18 16

Matrix representation: outer-product where is outer-product representation

Elementary matrix [1] (1) The interchange of two rows in A: Define permutation matrix How to explain? Question 1: why Question 2: how to easily obtain

Concatenation of permutation matrices such that such that Question: implies Direct calculation

Elementary matrix [2] (2) Multiplying one row by a nonzero constant: Define scaling matrix How to explain? since

Elementary matrix [3] (3) Adding to one row a multiple of another: Define GE (Gaussian Elimination) matrix How to explain? outer-product representation

Use MATLAB notation

Concatenation of GE matrices such that Suppose such that Question:

OutLine Basic operation of matrix Example of Gaussian Elimination (GE) - forward elimination to upper triangle form - backward substitution Formal description of GE MATLAB usage

6 -2 2 4 x1 12 12 -8 6 10 x2 34 3 -13 9 3 x3 27 -6 4 1 -18 x4 -38 12 -8 6 10 34 6 -2 2 4 x1 12 -4 2 2 x2 10 6 -2 2 4 12 3 -13 9 3 x3 27 -6 4 1 -18 x4 -38 -4 2 2 10 3 -13 9 3 27 6 -2 2 4 x1 12 -4 2 2 x2 10 6 -2 2 4 12 -12 8 1 x3 21 -6 4 1 -18 x4 -38 -12 8 1 21

-6 4 1 -18 -38 6 -2 2 4 x1 12 -4 2 2 x2 10 6 -2 2 4 12 -12 8 1 x3 21 2 3 -14 x4 -26 2 3 -14 -26 6 -2 2 4 x1 12 First row does not change thereafter -4 2 2 x2 10 -12 8 1 x3 21 2 3 -14 x4 -26 -12 8 1 21 6 -2 2 4 x1 12 -4 2 2 x2 10 -4 2 2 10 2 -5 x3 -9 2 3 -14 x4 -26 2 -5 -9

2 3 -14 -26 6 -2 2 4 x1 12 -4 2 2 x2 10 -4 2 2 10 2 -5 x3 -9 4 -13 x4 -21 4 -13 -21 6 -2 2 4 x1 12 -4 2 2 x2 10 2 -5 x3 -9 4 -13 x4 -21 4 -13 -21 6 -2 2 4 x1 12 -4 2 2 x2 10 2 -5 -9 2 -5 x3 -9 -3 -3 -3 x4 -3

Backward substitution: inner-product-based 6 -2 2 4 x1 12 6 -2 2 4 x1 12 -4 2 2 x2 10 -4 2 2 x2 10 2 -5 x3 -9 2 -5 x3 -9 -3 x4 -3 x4 6 -2 2 4 x1 12 6 -2 2 4 x1 12 -4 2 2 x2 10 x2 x3 x3 x4 x4

Backward substitution: outer-product-based 6 -2 2 4 x1 12 -4 2 2 x2 10 2 -5 x3 -9 -3 x4 -3 6 -2 2 x1 12 4 8 -4 2 x2 10 x4 2 8 2 x3 -9 -5 -4 6 -2 x1 8 2 12 x3 -4 x2 8 2 12 6 x1 12 x2 -2 6

OutLine Basic operation of matrix Example of Gaussian Elimination (GE) Formal description of GE - component-wise and column-wise representation - recursive structure MATLAB usage

6 -2 2 4 x1 12 12 -8 6 10 x2 34 3 -13 9 3 x3 27 -6 4 1 -18 x4 -38 6 -2 2 4 x1 12 -4 2 2 x2 10 3 -13 9 3 x3 27 -6 4 1 -18 x4 -38 6 -2 2 4 x1 12 6 -2 2 4 x1 12 12 -8 6 10 x2 34 12 -8 6 10 x2 34 -12 8 1 x3 21 3 -13 9 3 x3 27 -6 4 1 -18 x4 -38 2 3 -14 x4 -26

Eliminate first column: component-wise 6 -2 2 4 x1 12 6 -2 2 4 x1 12 12 -8 6 10 x2 34 -4 2 2 x2 10 3 -13 9 3 x3 27 -12 8 1 x3 21 -6 4 1 -18 x4 -38 2 3 -14 x4 -26 where Exercise: check by MATLAB

Eliminate first column: column-wise define and then Exercise: check by MATLAB Notation:

Eliminate second column: component-wise 6 -2 2 4 x1 12 -4 2 2 x2 10 -12 8 1 x3 21 2 3 -14 x4 -26 6 -2 2 4 x1 12 -4 2 2 x2 10 2 -5 x3 -9 2 3 -14 x4 -26 6 -2 2 4 x1 12 -4 2 2 x2 10 2 -5 x3 -9 4 -13 x4 -21

Eliminate second column: column-wise define Exercise: check Exercise: check , why? Give a simple explanation. Notation:

Eliminate third column: component-wise 6 -2 2 4 x1 12 -4 2 2 x2 10 2 -5 x3 -9 4 -13 x4 -21 6 -2 2 4 x1 12 -4 2 2 x2 10 define 2 -5 x3 -9 -3 x4 -3 then

LU-decomposition Notation: LU-decomposition Exercise: check Question: Do you have any effective method to write down matrix Question: why don’t we care about right hand side vector

Problems about LU-decomposition Question 1: what condition does LU-decomposition fail? Question 2: does any invertible matrix has LU-decomposition? Question 3: How to measure “goodness of LU-decomposition“? Question 4: what is order of performance of LU-decomposition (operation count)? Question 5: How to parallelize LU-decomposition? Question 6: How to implement LU-decomposition with help of GPU?

OutLine Basic operation of matrix Example of Gaussian Elimination (GE) Formal description of GE MATLAB usage - website resource - “help” command - M-file

MATLAB website http://www.mathworks.com/access/helpdesk/help/techdoc/matlab.html

MATLAB: create matrix

MATLAB: LU-factorization

Start MATLAB 2008

Command “help” : documentation != in C

Loop in MATLAB

Decision-making in MATLAB

IO in MATLAB

LU-factorization in MATLAB

M-file in MATLAB matvec.m Description of function matvec, write specificaiton of input parameter Consistency check Inner-product based

Move to working directory M-file

Execute M-file Construct matrix Execute M-file, like function call in C-language

Exercise: forward / backward substitution Forward substitution since backward substitution since Write MATLAB code to do forward substitution and backward substitution

Exercise: LU-decomposition You should find recursive structure of the decomposition