Solution of linear system of equations

Slides:



Advertisements
Similar presentations
Elementary Linear Algebra
Advertisements

Chapter 2 Solutions of Systems of Linear Equations / Matrix Inversion
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
Algebraic, transcendental (i.e., involving trigonometric and exponential functions), ordinary differential equations, or partial differential equations...
Chapter 4 Systems of Linear Equations; Matrices Section 2 Systems of Linear Equations and Augmented Matrics.
MATH 685/ CSI 700/ OR 682 Lecture Notes
Scientific Computing Linear Systems – Gaussian Elimination.
Chapter 8 Numerical Technique 大葉大學 資訊工程系 黃鈴玲 Linear Algebra.
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.
Lesson 8 Gauss Jordan Elimination
Chapter 9 Gauss Elimination The Islamic University of Gaza
Solving Systems of Linear Equations Part Pivot a Matrix 2. Gaussian Elimination Method 3. Infinitely Many Solutions 4. Inconsistent System 5. Geometric.
ECIV 301 Programming & Graphics Numerical Methods for Engineers Lecture 17 Solution of Systems of Equations.
Matrices and Systems of Equations
ECIV 520 Structural Analysis II Review of Matrix Algebra.
Math for CSLecture 31 LU Decomposition Pivoting Diagonalization Gram-Shcmidt Orthogonalization Lecture 3.
ECIV 301 Programming & Graphics Numerical Methods for Engineers REVIEW II.
MOHAMMAD IMRAN DEPARTMENT OF APPLIED SCIENCES JAHANGIRABAD EDUCATIONAL GROUP OF INSTITUTES.
Math for CSLecture 21 Solution of Linear Systems of Equations Consistency Rank Geometric Interpretation Gaussian Elimination Lecture 2. Contents.
Mujahed AlDhaifallah (Term 342) Read Chapter 9 of the textbook
Math for CSLecture 31 LU Decomposition Pivoting Diagonalization Gram-Shcmidt Orthogonalization Lecture 3.
ECIV 301 Programming & Graphics Numerical Methods for Engineers Lecture 18 LU Decomposition and Matrix Inversion.
Systems of Linear Equations
Math for CSTutorial 2-31 Solution of Systems of Linear Equations Gaussian Elimination LU Decomposition Gram-Schmidt vector orthogonalization Tutorial 2-3.
Chapter 5 Determinants.
1.2 Gaussian Elimination.
Multivariate Linear Systems and Row Operations.
SYSTEMS OF LINEAR EQUATIONS
1 1.1 © 2012 Pearson Education, Inc. Linear Equations in Linear Algebra SYSTEMS OF LINEAR EQUATIONS.
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.
Square n-by-n Matrix.
Matrices King Saud University. If m and n are positive integers, then an m  n matrix is a rectangular array in which each entry a ij of the matrix is.
Slide Copyright © 2007 Pearson Education, Inc. Publishing as Pearson Addison-Wesley.
Warm-Up Write each system as a matrix equation. Then solve the system, if possible, by using the matrix equation. 6 minutes.
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.
MA2213 Lecture 5 Linear Equations (Direct Solvers)
MATH 250 Linear Equations and Matrices
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.
ΑΡΙΘΜΗΤΙΚΕΣ ΜΕΘΟΔΟΙ ΜΟΝΤΕΛΟΠΟΙΗΣΗΣ 4. Αριθμητική Επίλυση Συστημάτων Γραμμικών Εξισώσεων Gaussian elimination Gauss - Jordan 1.
Matrices CHAPTER 8.1 ~ 8.8. Ch _2 Contents  8.1 Matrix Algebra 8.1 Matrix Algebra  8.2 Systems of Linear Algebra Equations 8.2 Systems of Linear.
Chapter 3 Solution of Algebraic Equations 1 ChE 401: Computational Techniques for Chemical Engineers Fall 2009/2010 DRAFT SLIDES.
Lecture 8 Matrix Inverse and LU Decomposition
Linear algebra: matrix Eigen-value Problems Eng. Hassan S. Migdadi Part 1.
Lesson 3 CSPP58001.
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
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.
Gaoal of Chapter 2 To develop direct or iterative methods to solve linear systems Useful Words upper/lower triangular; back/forward substitution; coefficient;
Matrices, Vectors, Determinants.
1 SYSTEM OF LINEAR EQUATIONS BASE OF VECTOR SPACE.
Lecture 9 Numerical Analysis. Solution of Linear System of Equations Chapter 3.
1 Numerical Methods Solution of Systems of Linear Equations.
Linear Equations in Linear Algebra
Linear Equations.
Chapter 10: Solving Linear Systems of Equations
Elementary Row Operations Gaussian Elimination Method
Numerical Analysis Lecture14.
Numerical Analysis Lecture10.
Linear Equations in Linear Algebra
Ax = b Methods for Solution of the System of Equations (ReCap):
Presentation transcript:

Solution of linear system of equations Circuit analysis (Mesh and node equations) Numerical solution of differential equations (Finite Difference Method) Numerical solution of integral equations (Finite Element Method, Method of Moments) 

Consistency (Solvability) The linear system of equations Ax=b has a solution, or said to be consistent IFF Rank{A}=Rank{A|b} A system is inconsistent when Rank{A}<Rank{A|b} Rank{A} is the maximum number of linearly independent columns or rows of A. Rank can be found by using ERO (Elementary Row Oparations) or ECO (Elementary column operations). ERO# of rows with at least one nonzero entry ECO# of columns with at least one nonzero entry

Elementary row operations The following operations applied to the augmented matrix [A|b], yield an equivalent linear system Interchanges: The order of two rows can be changed Scaling: Multiplying a row by a nonzero constant Replacement: The row can be replaced by the sum of that row and a nonzero multiple of any other row.

An inconsistent example ERO:Multiply the first row with -2 and add to the second row Rank{A}=1 Then this system of equations is not solvable Rank{A|b}=2

Uniqueness of solutions The system has a unique solution IFF Rank{A}=Rank{A|b}=n n is the order of the system Such systems are called full-rank systems

Full-rank systems If Rank{A}=n Det{A}  0  A is nonsingular so invertible Unique solution

Rank deficient matrices If Rank{A}=m<n Det{A} = 0  A is singular so not invertible infinite number of solutions (n-m free variables) under-determined system Rank{A}=Rank{A|b}=1 Consistent so solvable

Ill-conditioned system of equations A small deviation in the entries of A matrix, causes a large deviation in the solution.  

Ill-conditioned continued..... A linear system of equations is said to be “ill-conditioned” if the coefficient matrix tends to be singular

Types of linear system of equations to be studied in this course Coefficient matrix A is square and real The RHS vector b is nonzero and real Consistent system, solvable Full-rank system, unique solution Well-conditioned system

Solution Techniques Direct solution methods Iterative solution methods Finds a solution in a finite number of operations by transforming the system into an equivalent system that is ‘easier’ to solve. Diagonal, upper or lower triangular systems are easier to solve Number of operations is a function of system size n. Iterative solution methods Computes succesive approximations of the solution vector for a given A and b, starting from an initial point x0. Total number of operations is uncertain, may not converge.

Direct solution Methods Gaussian Elimination By using ERO, matrix A is transformed into an upper triangular matrix (all elements below diagonal 0) Back substitution is used to solve the upper-triangular system Back substitution  ERO

First step of elimination Pivotal element

Second step of elimination Pivotal element

Gaussion elimination algorithm For c=p+1 to n

Back substitution algorithm

Operation count Number of arithmetic operations required by the algorithm to complete its task. Generally only multiplications and divisions are counted Elimination process Back substitution Total Dominates Not efficient for different RHS vectors

LU Decomposition A=LU Ax=b LUx=b Define Ux=y Ly=b Solve y by forward substitution ERO’s must be performed on b as well as A The information about the ERO’s are stored in L Indeed y is obtained by applying ERO’s to b vector Ux=y Solve x by backward substitution

LU Decomposition by Gaussian elimination There are infinitely many different ways to decompose A. Most popular one: U=Gaussian eliminated matrix L=Multipliers used for elimination Compact storage: The diagonal entries of L matrix are all 1’s, they don’t need to be stored. LU is stored in a single matrix.

Operation count A=LU Decomposition Ly=b forward substitution Done only once A=LU Decomposition Ly=b forward substitution Ux=y backward substitution Total For different RHS vectors, the system can be efficiently solved.

Pivoting Computer uses finite-precision arithmetic A small error is introduced in each arithmetic operation, error propagates When the pivotal element is very small, the multipliers will be large. Adding numbers of widely differening magnitude can lead to loss of significance. To reduce error, row interchanges are made to maximise the magnitude of the pivotal element

Example: Without Pivoting 4-digit arithmetic Loss of significance

Example: With Pivoting

Pivoting procedures Eliminated part Pivotal row Pivotal column

Row pivoting Most commonly used partial pivoting procedure Search the pivotal column Find the largest element in magnitude Then switch this row with the pivotal row

Row pivoting Interchange these rows Largest in magnitude

Column pivoting Largest in magnitude Interchange these columns

Complete pivoting these rows Largest in magnitude Interchange these columns these rows Largest in magnitude

Row Pivoting in LU Decomposition When two rows of A are interchanged, those rows of b should also be interchanged. Use a pivot vector. Initial pivot vector is integers from 1 to n. When two rows (i and j) of A are interchanged, apply that to pivot vector.

Modifying the b vector When LU decomposition of A is done, the pivot vector tells the order of rows after interchanges Before applying forward substitution to solve Ly=b, modify the order of b vector according to the entries of pivot vector

LU decomposition algorithm with row pivoting Column search for maximum entry Interchaning the rows Updating L matrix For c=k+1 to n Updating U matrix

Example Column search: Maximum magnitude second row Interchange 1st and 2nd rows

Example continued... Eliminate a21 and a31 by using a11 as pivotal element A=LU in compact form (in a single matrix) Multipliers (L matrix)

Example continued... Column search: Maximum magnitude at the third row Interchange 2nd and 3rd rows

Example continued... Eliminate a32 by using a22 as pivotal element Multipliers (L matrix)

Example continued... A’x=b’ LUx=b’ Ux=y Ly=b’

Example continued... Ly=b’ Forward substitution Ux=y Backward

Gauss-Jordan elimination The elements above the diagonal are made zero at the same time that zeros are created below the diagonal

Gauss-Jordan Elimination Almost 50% more arithmetic operations than Gaussian elimination Gauss-Jordan (GJ) Elimination is prefered when the inverse of a matrix is required. Apply GJ elimination to convert A into an identity matrix.

Different forms of LU factorization Doolittle form Obtained by Gaussian elimination Crout form Cholesky form

Crout form First column of L is computed Then first row of U is computed The columns of L and rows of U are computed alternately

Crout reduction sequence 2 1 4 3 5 6 7 An entry of A matrix is used only once to compute the corresponding entry of L or U matrix So columns of L and rows of U can be stored in A matrix

Cholesky form A=LDU (Diagonals of L and U are 1) If A is symmetric L=UT  A= UT DU= UT D1/2D1/2U U’= D1/2U  A= U’T U’ This factorization is also called square root factorization. Only U’ need to be stored

Solution of Complex Linear System of Equations Cz=w C=A+jB Z=x+jy w=u+jv (A+jB)(x+jy)=(u+jv) (Ax-By)+j(Bx+Ay)=u+jv Real linear system of equations

Large and Sparse Systems When the linear system is large and sparse (a lot of zero entries), direct methods become inefficient due to fill-in terms. Fill-in terms are those which turn out to be nonzero during elimination Fill-in terms Elimination

Sparse Matrices Node equation matrix is a sparse matrix. Sparse matrices are stored very efficiently by storing only the nonzero entries When the system is very large (n=10,000) the fill-in terms considerable increases storage requirements In such cases iterative solution methods should be prefered instead of direct solution methods