SOLVING SYSTEMS OF LINEAR EQUATIONS. Overview A matrix consists of a rectangular array of elements represented by a single symbol (example: [A]). An individual.

Slides:



Advertisements
Similar presentations
Numerical Solution of Linear Equations
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...
Simultaneous Linear Equations
Systems of Linear Equations
Lecture 9: Introduction to Matrix Inversion Gaussian Elimination Sections 2.4, 2.5, 2.6 Sections 2.2.3, 2.3.
Part 3 Chapter 9 Gauss Elimination
Solution of linear system of equations
Chapter 9 Gauss Elimination The Islamic University of Gaza
Major: All Engineering Majors Author(s): Autar Kaw
MF-852 Financial Econometrics
Linear Algebraic Equations
Part 3 Chapter 10 LU Factorization PowerPoints organized by Dr. Michael R. Gustafson II, Duke University All images copyright © The McGraw-Hill Companies,
ECIV 301 Programming & Graphics Numerical Methods for Engineers Lecture 12 System of Linear Equations.
ECIV 301 Programming & Graphics Numerical Methods for Engineers Lecture 14 Elimination Methods.
ECIV 520 Structural Analysis II Review of Matrix Algebra.
ECIV 301 Programming & Graphics Numerical Methods for Engineers REVIEW II.
MOHAMMAD IMRAN DEPARTMENT OF APPLIED SCIENCES JAHANGIRABAD EDUCATIONAL GROUP OF INSTITUTES.
Mujahed AlDhaifallah (Term 342) Read Chapter 9 of the textbook
Part 3 Chapter 8 Linear Algebraic Equations and Matrices PowerPoints organized by Dr. Michael R. Gustafson II, Duke University All images copyright © The.
Matrices and Determinants
Chapter 5 Determinants.
Lecture 7: Matrix-Vector Product; Matrix of a Linear Transformation; Matrix-Matrix Product Sections 2.1, 2.2.1,
Arithmetic Operations on Matrices. 1. Definition of Matrix 2. Column, Row and Square Matrix 3. Addition and Subtraction of Matrices 4. Multiplying Row.
Chapter 7 Matrix Mathematics Matrix Operations Copyright © The McGraw-Hill Companies, Inc. Permission required for reproduction or display.
Major: All Engineering Majors Author(s): Autar Kaw
Chapter 8 Objectives Understanding matrix notation.
LU Decomposition 1. Introduction Another way of solving a system of equations is by using a factorization technique for matrices called LU decomposition.
Compiled By Raj G. Tiwari
Engineering Analysis ENG 3420 Fall 2009
Scientific Computing Linear Systems – LU Factorization.
ECON 1150 Matrix Operations Special Matrices
Copyright © 2006 The McGraw-Hill Companies, Inc. Permission required for reproduction or display. by Lale Yurttas, Texas A&M University Part 31 Linear.
Advanced Computer Graphics Spring 2014 K. H. Ko School of Mechatronics Gwangju Institute of Science and Technology.
 Row and Reduced Row Echelon  Elementary Matrices.
Rev.S08 MAC 1140 Module 10 System of Equations and Inequalities II.
Matrix Algebra. Quick Review Quick Review Solutions.
Slide Chapter 7 Systems and Matrices 7.1 Solving Systems of Two Equations.
Copyright © 2007 Pearson Education, Inc. Publishing as Pearson Addison-Wesley Slide 7- 1.
Engineering Analysis ENG 3420 Fall 2009 Dan C. Marinescu Office: HEC 439 B Office hours: Tu-Th 11:00-12:00.
ΑΡΙΘΜΗΤΙΚΕΣ ΜΕΘΟΔΟΙ ΜΟΝΤΕΛΟΠΟΙΗΣΗΣ 4. Αριθμητική Επίλυση Συστημάτων Γραμμικών Εξισώσεων Gaussian elimination Gauss - Jordan 1.
Matrices Addition & Subtraction Scalar Multiplication & Multiplication Determinants Inverses Solving Systems – 2x2 & 3x3 Cramer’s Rule.
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
Linear algebra: matrix Eigen-value Problems Eng. Hassan S. Migdadi Part 1.
Copyright © The McGraw-Hill Companies, Inc. Permission required for reproduction or display. 1 Part 3 - Chapter 9 Linear Systems of Equations: Gauss Elimination.
Gaussian Elimination Electrical Engineering Majors Author(s): Autar Kaw Transforming Numerical Methods Education for.
ES 240: Scientific and Engineering Computation. Chapter 8 Chapter 8: Linear Algebraic Equations and Matrices Uchechukwu Ofoegbu Temple University.
ME 142 Engineering Computation I Matrix Operations in Excel.
Chapter 9 Gauss Elimination The Islamic University of Gaza
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.
Matrices and Matrix Operations. Matrices An m×n matrix A is a rectangular array of mn real numbers arranged in m horizontal rows and n vertical columns.
Part 3 Chapter 9 Gauss Elimination PowerPoints organized by Dr. Michael R. Gustafson II, Duke University All images copyright © The McGraw-Hill Companies,
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.
Matrices, Vectors, Determinants.
Numerical Methods.  LU Decomposition is another method to solve a set of simultaneous linear equations  For most non-singular matrix [A] that one could.
Numerical Computation Lecture 6: Linear Systems – part II United International College.
Engineering Analysis ENG 3420 Fall 2009 Dan C. Marinescu Office: HEC 439 B Office hours: Tu-Th 11:00-12:00.
ROOTS OF EQUATIONS. Graphical Methods A simple method for obtaining the estimate of the root of the equation f(x)=0 is to make a plot of the function.
Copyright © The McGraw-Hill Companies, Inc. Permission required for reproduction or display. 1 Part 3 - Chapter 9.
Part 3 Chapter 9 Gauss Elimination
Linear Algebraic Equations and Matrices
5 Systems of Linear Equations and Matrices
Linear Algebraic Equations and Matrices
Metode Eliminasi Pertemuan – 4, 5, 6 Mata Kuliah : Analisis Numerik
Part 3 Chapter 10 LU Factorization
Linear Systems Numerical Methods.
Presentation transcript:

SOLVING SYSTEMS OF LINEAR EQUATIONS

Overview A matrix consists of a rectangular array of elements represented by a single symbol (example: [A]). An individual entry of a matrix is an element (example: a 23 )

Overview (cont) A horizontal set of elements is called a row and a vertical set of elements is called a column. The first subscript of an element indicates the row while the second indicates the column. The size of a matrix is given as m rows by n columns, or simply m by n (or m x n). 1 x n matrices are row vectors. m x 1 matrices are column vectors.

Special Matrices Matrices where m=n are called square matrices. There are a number of special forms of square matrices:

Matrix Operations Two matrices are considered equal if and only if every element in the first matrix is equal to every corresponding element in the second. This means the two matrices must be the same size. Matrix addition and subtraction are performed by adding or subtracting the corresponding elements. This requires that the two matrices be the same size. Scalar matrix multiplication is performed by multiplying each element by the same scalar.

Matrix Multiplication The elements in the matrix [C] that results from multiplying matrices [A] and [B] are calculated using:

Matrix Inverse and Transpose The inverse of a square, nonsingular matrix [A] is that matrix which, when multiplied by [A], yields the identity matrix. – [A][A] -1 =[A] -1 [A]=[I] The transpose of a matrix involves transforming its rows into columns and its columns into rows. – (a ij ) T =a ji

Representing Linear Algebra Matrices provide a concise notation for representing and solving simultaneous linear equations:

Solving With MATLAB MATLAB provides two direct ways to solve systems of linear algebraic equations [A]{x}={b}: – Left-division x = A\b – Matrix inversion x = inv(A)*b The matrix inverse is less efficient than left- division and also only works for square, non- singular systems.

Graphical Method For small sets of simultaneous equations, graphing them and determining the location of the intercept provides a solution.

Graphical Method (cont) Graphing the equations can also show systems where: a)No solution exists b)Infinite solutions exist c)System is ill-conditioned

Determinants The determinant D=|A| of a matrix is formed from the coefficients of [A]. Determinants for small matrices are: Determinants for matrices larger than 3 x 3 can be very complicated.

Cramer’s Rule Cramer’s Rule states that each unknown in a system of linear algebraic equations may be expressed as a fraction of two determinants with denominator D and with the numerator obtained from D by replacing the column of coefficients of the unknown in question by the constants b 1, b 2, …, b n.

Cramer’s Rule Example Find x 2 in the following system of equations: Find the determinant D Find determinant D 2 by replacing D’s second column with b Divide

Naïve Gauss Elimination For larger systems, Cramer’s Rule can become unwieldy. Instead, a sequential process of removing unknowns from equations using forward elimination followed by back substitution may be used - this is Gauss elimination. “Naïve” Gauss elimination simply means the process does not check for potential problems resulting from division by zero.

Naïve Gauss Elimination (cont) Forward elimination – Starting with the first row, add or subtract multiples of that row to eliminate the first coefficient from the second row and beyond. – Continue this process with the second row to remove the second coefficient from the third row and beyond. – Stop when an upper triangular matrix remains. Back substitution – Starting with the last row, solve for the unknown, then substitute that value into the next highest row. – Because of the upper-triangular nature of the matrix, each row will contain only one more unknown.

Naïve Gauss Elimination Program

Pivoting Problems arise with naïve Gauss elimination if a coefficient along the diagonal is 0 (problem: division by 0) or close to 0 (problem: round-off error) One way to combat these issues is to determine the coefficient with the largest absolute value in the column below the pivot element. The rows can then be switched so that the largest element is the pivot element. This is called partial pivoting. If the rows to the right of the pivot element are also checked and columns switched, this is called complete pivoting.

LU Factorization LU factorization involves two steps: – Factorization to decompose the [A] matrix into a product of a lower triangular matrix [L] and an upper triangular matrix [U]. [L] has 1 for each entry on the diagonal. – Substitution to solve for {x} Gauss elimination can be implemented using LU factorization

Gauss Elimination as LU Factorization [A]{x}={b} can be rewritten as [L][U]{x}={b} using LU factorization. The LU factorization algorithm requires the same total flops as for Gauss elimination. The main advantage is once [A] is decomposed, the same [L] and [U] can be used for multiple {b} vectors. MATLAB’s lu function can be used to generate the [L] and [U] matrices: [L, U] = lu(A)

Gauss Elimination as LU Factorization (cont) To solve [A]{x}={b}, first decompose [A] to get [L][U]{x}={b} Set up and solve [L]{d}={b}, where {d} can be found using forward substitution. Set up and solve [U]{x}={d}, where {x} can be found using backward substitution. In MATLAB: [L, U] = lu(A) d = L\b x = U\d

Cholesky Factorization Symmetric systems occur commonly in both mathematical and engineering/science problem contexts, and there are special solution techniques available for such systems. The Cholesky factorization is one of the most popular of these techniques, and is based on the fact that a symmetric matrix can be decomposed as [A]= [U] T [U], where T stands for transpose. The rest of the process is similar to LU decomposition and Gauss elimination, except only one matrix, [U], needs to be stored.

LU Factorization LU factorization involves two steps: – Factorization to decompose the [A] matrix into a product of a lower triangular matrix [L] and an upper triangular matrix [U]. [L] has 1 for each entry on the diagonal. – Substitution to solve for {x} Gauss elimination can be implemented using LU factorization

MATLAB MATLAB can perform a Cholesky factorization with the built-in chol command: U = chol(A) MATLAB’s left division operator \ examines the system to see which method will most efficiently solve the problem. This includes trying banded solvers, back and forward substitutions, Cholesky factorization for symmetric systems. If these do not work and the system is square, Gauss elimination with partial pivoting is used.

Gauss-Seidel Method The Gauss-Seidel method is the most commonly used iterative method for solving linear algebraic equations [A]{x}={b}. The method solves each equation in a system for a particular variable, and then uses that value in later equations to solve later variables. For a 3x3 system with nonzero elements along the diagonal, for example, the j th iteration values are found from the j-1 th iteration using:

Jacobi Iteration The Jacobi iteration is similar to the Gauss- Seidel method, except the j-1th information is used to update all variables in the jth iteration: a)Gauss-Seidel b)Jacobi

Convergence The convergence of an iterative method can be calculated by determining the relative percent change of each element in {x}. For example, for the i th element in the j th iteration, The method is ended when all elements have converged to a set tolerance.

MATLAB Program