# Chapter: 3c System of Linear Equations

## Presentation on theme: "Chapter: 3c System of Linear Equations"— Presentation transcript:

Chapter: 3c System of Linear Equations
Dr. Asaf Varol

Pivoting Some disadvantages of Gaussian elimination are as follows: Since each result follows and depends on the previous step, for large systems the errors introduced due to round off (or chop off) errors lead to loss of significant figures and hence to in accurate results. The error committed in any one step propagates till the final step and it is amplified. This is especially true for ill-conditioned systems. Of course if any of the diagonal elements is zero, the method will not work unless the system is rearranged so to avoid zero elements being on the diagonal. The practice of interchanging rows with each other so that the diagonal elements are the dominant elements is called partial pivoting. The goal here is to put the largest possible coefficient along the diagonal by manipulating the order of the rows. It is also possible to change the order of variables, i.e. instead of letting the unknown vector {X}T = (x, y, z) we may let it be {X}T = ( y, z, x) When this is done in addition to partial pivoting, this practice is called full pivoting. In this case only the meaning of each variable changes but the system of equations remain the same.

Example E3.4.2 Consider the following set of equations
x y = x y = The exact solution to which is x = 1/3 and y = 2/3 Solving this system by Gaussian elimination with a three significant figure mantissa yields   x = -3.33, y = 0.667 with four significant figure mantissa yields x = and y =

Example E3.4.2 (continued) Partial pivoting (switch the rows so that the diagonal elements are largest) x y = x y = The solution of this set of equations using Gaussian elimination gives y = and x = with three significant figure arithmetic y = and x = with four significant figure arithmetic

Example E3.4.3 Problem: Apply full pivoting to the following system to achieve a well conditioned matrix. 3x + 5y - 5z = 3 2x - 4y - z = -3 6x - 5y + z = 2

Example E3.4.3 (continued) Solution: First switch the first column with the second column, then switch the first column with the third column to obtain -5z + 3x + 5y = 3 - z + 2x - 4y = -3 z + 6x - 5y = 2 Then switch second row with the third row -z + 2x - 4y = -3  Yielding finally a well conditioned system given by

Gauss – Jordan Elimination
This method is very similar to Gaussian elimination method. The only difference is in that the elimination procedure is extended to the upper diagonal elements so that a backward substitution is no longer necessary. The elimination process begins with the augmented matrix, and continued until the original matrix turns into an identity matrix, of course with necessary modifications to the right hand side. In short our goal is to start with the general augmented system and arrive at the right side after appropriate algebraic manipulations. Start arrive ===> The solution can be written at once as

Pseudo Code for Gauss – Jordan Elimination
do for k = 1 to n ! Important note do for j= k+1 to n+1 ! a(i,n+1) represents the akj = akj/akk ! the right hand side end do do for i = 1 to n ; i is not equal to k do for j = k+1 to n+1 aij = aij - (aik)(akj) cc----- The solution vector is saved in a(i,n+1), i=1, to n

Example E3.4.4

Example E3.4.4 (continued)

Finding the Inverse using Gauss-Jordan Elimination

LU Decomposition

Example E3.4.5

Crout Decomposition

Pseudo Code for LU-Decomposition

Cholesky Decomposition for Symmetric Matrices

Tridiagonal Matrix Algorithm (TDMA), also known as Thomas Algorithm

TDMA Algorithm

Example E3.4.6

Iterative Methods for Solving Linear Systems

Jacobi Iteration

Example E3.5.1

Convergence Criteria for Jacobi Iteration

Gauss - Seidel Iteration

Gauss - Seidel Iteration (II)

Example E3.5.2

Convergence Criteria for Gauss - Seidel Iteration

Relaxation Concept

Example E3.5.4

Example E3.5.4 (continued)

Case Study - The Problem of Falling Objects

Case Study - The Problem of Falling Objects

References Celik, Ismail, B., “Introductory Numerical Methods for Engineering Applications”, Ararat Books & Publishing, LCC., Morgantown, 2001 Fausett, Laurene, V. “Numerical Methods, Algorithms and Applications”, Prentice Hall, 2003 by Pearson Education, Inc., Upper Saddle River, NJ 07458 Rao, Singiresu, S., “Applied Numerical Methods for Engineers and Scientists, 2002 Prentice Hall, Upper Saddle River, NJ 07458 Mathews, John, H.; Fink, Kurtis, D., “Numerical Methods Using MATLAB” Fourth Edition, 2004 Prentice Hall, Upper Saddle River, NJ 07458 Varol, A., “Sayisal Analiz (Numerical Analysis), in Turkish, Course notes, Firat University, 2001