Linear Systems Gaussian Elimination CSE 541 Roger Crawfis.

Slides:



Advertisements
Similar presentations
4.3 Matrix Approach to Solving Linear Systems 1 Linear systems were solved using substitution and elimination in the two previous section. This section.
Advertisements

Chapter 2 Simultaneous Linear Equations
Linear Systems LU Factorization CSE 541 Roger Crawfis.
Matrices: Inverse Matrix
MATH 685/ CSI 700/ OR 682 Lecture Notes
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.
Chapter 2 Matrices Finite Mathematics & Its Applications, 11/e by Goldstein/Schneider/Siegel Copyright © 2014 Pearson Education, Inc.
Linear Algebraic Equations
Goldstein/Schnieder/Lay: Finite Math & Its Applications, 9e 1 of 86 Chapter 2 Matrices.
Chapter 2 Section 1 Solving a System of Linear Equations (using Matrices)
Matrices and Systems of Equations
Mujahed AlDhaifallah (Term 342) Read Chapter 9 of the textbook
Finite Mathematics & Its Applications, 10/e by Goldstein/Schneider/SiegelCopyright © 2010 Pearson Education, Inc. 1 of 86 Chapter 2 Matrices.
Chapter 5 Determinants.
Arithmetic Operations on Matrices. 1. Definition of Matrix 2. Column, Row and Square Matrix 3. Addition and Subtraction of Matrices 4. Multiplying Row.
Copyright © Cengage Learning. All rights reserved. 7.6 The Inverse of a Square Matrix.
Solving System of Linear Equations. 1. Diagonal Form of a System of Equations 2. Elementary Row Operations 3. Elementary Row Operation 1 4. Elementary.
5  Systems of Linear Equations: ✦ An Introduction ✦ Unique Solutions ✦ Underdetermined and Overdetermined Systems  Matrices  Multiplication of Matrices.
1 1.1 © 2012 Pearson Education, Inc. Linear Equations in Linear Algebra SYSTEMS OF LINEAR EQUATIONS.
Chapter 10 Review: Matrix Algebra
Scientific Computing Linear Systems – LU Factorization.
Advanced Computer Graphics Spring 2014 K. H. Ko School of Mechatronics Gwangju Institute of Science and Technology.
 Row and Reduced Row Echelon  Elementary Matrices.
Barnett/Ziegler/Byleen Finite Mathematics 11e1 Review for Chapter 4 Important Terms, Symbols, Concepts 4.1. Systems of Linear Equations in Two Variables.
Square n-by-n Matrix.
Copyright © 2011 Pearson, Inc. 7.3 Multivariate Linear Systems and Row Operations.
Sec 3.1 Introduction to Linear System Sec 3.2 Matrices and Gaussian Elemination The graph is a line in xy-plane The graph is a line in xyz-plane.
Math 201 for Management Students
MATH 250 Linear Equations and Matrices
Row Reduction Method Lesson 6.4.
G AUSSIAN E LIMINATION Presented by: Max Le Max Le Justin Lavorgna Data Structures II: Algorithm Design & Analysis Algorithm Design & Analysis.
Engineering Analysis ENG 3420 Fall 2009 Dan C. Marinescu Office: HEC 439 B Office hours: Tu-Th 11:00-12:00.
Sec 3.2 Matrices and Gaussian Elemination Coefficient Matrix 3 x 3 Coefficient Matrix 3 x 3 Augmented Coefficient Matrix 3 x 4 Augmented Coefficient Matrix.
Lesson 13-1: Matrices & Systems Objective: Students will: State the dimensions of a matrix Solve systems using matrices.
Yasser F. O. Mohammad Assiut University Egypt. Previously in NM Introduction to NM Solving single equation System of Linear Equations Vectors and Matrices.
ΑΡΙΘΜΗΤΙΚΕΣ ΜΕΘΟΔΟΙ ΜΟΝΤΕΛΟΠΟΙΗΣΗΣ 4. Αριθμητική Επίλυση Συστημάτων Γραμμικών Εξισώσεων Gaussian elimination Gauss - Jordan 1.
8.1 Matrices & Systems of Equations
Matrices Addition & Subtraction Scalar Multiplication & Multiplication Determinants Inverses Solving Systems – 2x2 & 3x3 Cramer’s Rule.
Lecture 8 Matrix Inverse and LU Decomposition
Triangular Form and Gaussian Elimination Boldly on to Sec. 7.3a… HW: p odd.
Copyright © 2011 Pearson Education, Inc. Solving Linear Systems Using Matrices Section 6.1 Matrices and Determinants.
Matrices and Systems of Equations
Matrices and Systems of Equations
Meeting 19 System of Linear Equations. Linear Equations A solution of a linear equation in n variables is a sequence of n real numbers s 1, s 2,..., s.
Slide Copyright © 2008 Pearson Education, Inc. Publishing as Pearson Addison-Wesley A set of equations is called a system of equations. The solution.
ECE 530 – Analysis Techniques for Large-Scale Electrical Systems Prof. Hao Zhu Dept. of Electrical and Computer Engineering University of Illinois at Urbana-Champaign.
Slide Copyright © 2009 Pearson Education, Inc. 7.4 Solving Systems of Equations by Using Matrices.
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.
Numerical Computation Lecture 6: Linear Systems – part II United International College.
1 Numerical Methods Solution of Systems of Linear Equations.
Multivariable Linear Systems and Row Operations
Use Inverse Matrices to Solve Linear Systems
Linear Equations in Linear Algebra
Gaussian Elimination and Gauss-Jordan Elimination
Spring Dr. Jehad Al Dallal
5 Systems of Linear Equations and Matrices
Chapter 8: Lesson 8.1 Matrices & Systems of Equations
CHAPTER 9: GAUSSIAN ELIMINATION.
Chapter 4 Systems of Linear Equations; Matrices
Linear Equations in Linear Algebra
Lecture 13 Simultaneous Linear Equations – Gaussian Elimination (2) Partial Pivoting Dr .Qi Ying.
Chapter 4 Systems of Linear Equations; Matrices
Warm-up: Solve the system: 2x – 0.4y = -2 3x – 1 2 y = -2
Matrices and Linear Equations
Ax = b Methods for Solution of the System of Equations (ReCap):
Presentation transcript:

Linear Systems Gaussian Elimination CSE 541 Roger Crawfis

Solving Linear Systems Transform Ax = b into an equivalent but simpler system. Multiply on the left by a nonsingular matrix: MAx = Mb: Mathematically equivalent, but may change rounding errors

Gaussian Elimination Finding inverses of matrices is expensive Inverses are not necessary to solve a linear system. Some system are much easier to solve: Diagonal matrices Triangular matrices Gaussian Elimination transforms the problem into a triangular system

Gaussian Elimination Consists of 2 steps 1. Forward Elimination of Unknowns. 2. Back Substitution

Gaussian Elimination Systematically eliminate unknowns from the equations until only a equation with only one unknown is left. This is accomplished using three operations applied to the linear system of equations: A given equation can be multiplied by a non-zero constant and the result substituted for the original equation, A given equation can be added to a second equation, and the result substituted for the original equation, Two equations can be transposed in order.

Gaussian Elimination Uses these elementary row operations Adding a multiple of one row to another Doesn’t change the equality of the equation Hence the solution does not change. The sub-diagonal elements are zeroed- out through elementary row operations In a specific order (next slide)

Order of Elimination

Gaussian Elimination in 3D Using the first equation to eliminate x from the next two equations

Gaussian Elimination in 3D Using the second equation to eliminate y from the third equation

Gaussian Elimination in 3D Using the second equation to eliminate y from the third equation

Solving Triangular Systems We now have a triangular system which is easily solved using a technique called Backward-Substitution.

Solving Triangular Systems If A is upper triangular, we can solve Ax = b by:

Backward Substitution From the previous work, we have And substitute z in the first two equations

We can solve y Backward Substitution

Substitute to the first equation Backward Substitution

We can solve the first equation Backward Substitution

Robustness of Solution We can measure the precision or accuracy of our solution by calculating the residual: Calling our computed solution x*… Calculate the distance Ax* is from b |Ax* – b| Some matrices are ill-conditioned A tiny change in the input (the coefficients in A) drastically changes the output (x*)

C# Implementation //convert to upper triangular form for (int k=0; k<n-1; k++) { try { for (int i=k+1; i<n; i++) { float s = a[i,k] / a[k,k]; for(int j=k+1; j<n; j++) a[i,j] -= a[k,j] * s; b[i]=b[i]-b[k] * s; } catch ( DivideByZeroException e) { Console.WriteLine(e.Message); } // back substitution b[n-1]=b[n-1] / a[n-1,n-1]; for (int i=n-2; i>=0; i--) { sum = b[i]; for ( int j=i+1; j<n; j++) sum -= a[i,j] * x[j]; x[i] = sum / a[i,i]; }

Forward Elimination For i = 1 to n-1 { // for each equation For j = i+1 to n { // for each target equation below the current For k = i+1 to n { // for each element beyond pivot column } Computational Complexity divisions multiply-add’s O(n 3 )

Computational Complexity Backward Substitution For i = n-1 to 1 { // for each equation For j = n to i+1 { // for each known variable sum = sum – A ij * x j } multiply-add’s O(n 2 )