1 Numerical Methods Solution of Systems of Linear Equations.

Slides:



Advertisements
Similar presentations
Chapter 2 Solutions of Systems of Linear Equations / Matrix Inversion
Advertisements

Algebraic, transcendental (i.e., involving trigonometric and exponential functions), ordinary differential equations, or partial differential equations...
MATH 685/ CSI 700/ OR 682 Lecture Notes
Scientific Computing Linear Systems – Gaussian Elimination.
Simultaneous Linear Equations
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.
Lecture 6 Matrix Operations and Gaussian Elimination for Solving Linear Systems Shang-Hua Teng.
Part 3 Chapter 9 Gauss Elimination
Solution of linear system of equations
Chapter 9 Gauss Elimination The Islamic University of Gaza
Lecture 11 - LU Decomposition
Linear Algebraic Equations
Lecture 6 Intersection of Hyperplanes and Matrix Inverse Shang-Hua Teng.
Goldstein/Schnieder/Lay: Finite Math & Its Applications, 9e 1 of 86 Chapter 2 Matrices.
ECIV 301 Programming & Graphics Numerical Methods for Engineers Lecture 17 Solution of Systems of Equations.
Matrices and Systems of Equations
ECIV 301 Programming & Graphics Numerical Methods for Engineers Lecture 14 Elimination Methods.
ECIV 520 Structural Analysis II Review of Matrix Algebra.
Math for CSLecture 31 LU Decomposition Pivoting Diagonalization Gram-Shcmidt Orthogonalization Lecture 3.
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
Systems of Linear Equations
10.1 Gaussian Elimination Method
Finite Mathematics & Its Applications, 10/e by Goldstein/Schneider/SiegelCopyright © 2010 Pearson Education, Inc. 1 of 86 Chapter 2 Matrices.
Chapter 5 Determinants.
Solving System of Linear Equations. 1. Diagonal Form of a System of Equations 2. Elementary Row Operations 3. Elementary Row Operation 1 4. Elementary.
Copyright © 2006 The McGraw-Hill Companies, Inc. Permission required for reproduction or display. 1 ~ Linear Algebraic Equations ~ Gauss Elimination Chapter.
SYSTEMS OF LINEAR EQUATIONS
Major: All Engineering Majors Author(s): Autar Kaw
ECON 1150 Matrix Operations Special Matrices
Advanced Computer Graphics Spring 2014 K. H. Ko School of Mechatronics Gwangju Institute of Science and Technology.
Square n-by-n Matrix.
Slide Copyright © 2007 Pearson Education, Inc. Publishing as Pearson Addison-Wesley.
Linear Systems Gaussian Elimination CSE 541 Roger Crawfis.
Three variables Systems of Equations and Inequalities.
CHAPTER 2 MATRIX. CHAPTER OUTLINE 2.1 Introduction 2.2 Types of Matrices 2.3 Determinants 2.4 The Inverse of a Square Matrix 2.5 Types of Solutions to.
Introduction to Numerical Analysis I MATH/CMPSC 455 PA=LU.
Engineering Analysis ENG 3420 Fall 2009 Dan C. Marinescu Office: HEC 439 B Office hours: Tu-Th 11:00-12:00.
Matrix Solutions to Linear Systems. 1. Write the augmented matrix for each system of linear equations.
WEEK 8 SYSTEMS OF EQUATIONS DETERMINANTS AND CRAMER’S RULE.
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.
Lecture 8 Matrix Inverse and LU Decomposition
Lecture 7 - Systems of Equations CVEN 302 June 17, 2002.
Copyright © The McGraw-Hill Companies, Inc. Permission required for reproduction or display. 1 Part 3 - Chapter 9 Linear Systems of Equations: Gauss Elimination.
Copyright © 2011 Pearson Education, Inc. Solving Linear Systems Using Matrices Section 6.1 Matrices and Determinants.
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.
Chapter 2 Determinants. With each square matrix it is possible to associate a real number called the determinant of the matrix. The value of this number.
Lecture 6 - Single Variable Problems & Systems of Equations CVEN 302 June 14, 2002.
Unit #1 Linear Systems Fall Dr. Jehad Al Dallal.
Lecture 9 Numerical Analysis. Solution of Linear System of Equations Chapter 3.
Numerical Computation Lecture 6: Linear Systems – part II United International College.
Pitfalls of Gauss Elimination ● Division by zero (avoid by pivoting) ● Round-off errors – Important with >100 eqns – Substitute answer into original eqn.
Linear Equations in Linear Algebra
Part 3 Chapter 9 Gauss Elimination
Section 4.1 Systems With Two Variables.
Spring Dr. Jehad Al Dallal
Linear Equations.
CHAPTER 9: GAUSSIAN ELIMINATION.
Lecture 11 Matrices and Linear Algebra with MATLAB
Major: All Engineering Majors Author(s): Autar Kaw
Numerical Analysis Lecture10.
Linear Systems Numerical Methods.
Linear Equations in Linear Algebra
Lecture 13 Simultaneous Linear Equations – Gaussian Elimination (2) Partial Pivoting Dr .Qi Ying.
Ax = b Methods for Solution of the System of Equations (ReCap):
Presentation transcript:

1 Numerical Methods Solution of Systems of Linear Equations

2 Vector, Matrices, and Linear Equations

3 VECTORS

4 MATRICES

5 MATRICES

6 Determinant of a MATRICES

7 Adding and Multiplying Matrices

8 Systems of Linear Equations

9 Solutions of Linear Equations

10 Solutions of Linear Equations  A set of equations is inconsistent if there exists no solution to the system of equations:

11 Solutions of Linear Equations  Some systems of equations may have infinite number of solutions

12 Graphical Solution of Systems of Linear Equations Solution x 1 =1, x 2 =2

13 Cramer’s Rule is Not Practical

14  Naive Gaussian Elimination  Examples Lecture 13 Naive Gaussian Elimination

15 Naive Gaussian Elimination  The method consists of two steps: Forward Elimination: the system is reduced to upper triangular form. A sequence of elementary operations is used. Backward Substitution: Solve the system starting from the last variable.

16 Elementary Row Operations  Adding a multiple of one row to another  Multiply any row by a non-zero constant

17 Example Forward Elimination

18 Example Forward Elimination

19 Example Forward Elimination

20 Example Backward Substitution

21 Forward Elimination

22 Forward Elimination

23 Backward Substitution

24  Summary of the Naive Gaussian Elimination  Example  Problems with Naive Gaussian Elimination Failure due to zero pivot element Error  Pseudo-Code Naive Gaussian Elimination

25 Naive Gaussian Elimination oThe method consists of two steps oForward Elimination: the system is reduced to upper triangular form. A sequence of elementary operations is used. oBackward Substitution: Solve the system starting from the last variable. Solve for x n,x n-1,…x 1.

26 Example 1

27 Example 1

28 Example 1 Backward Substitution

29 Determinant

30 How Many Solutions Does a System of Equations AX=B Have?

31 Examples

Pseudo-Code: Forward Elimination Do k = 1 to n-1 Do i = k+1 to n factor = a i,k / a k,k Do j = k+1 to n a i,j = a i,j – factor * a k,j End Do b i = b i – factor * b k End Do 32

Pseudo-Code: Back Substitution x n = b n / a n,n Do i = n-1 downto 1 sum = b i Do j = i+1 to n sum = sum – a i,j * x j End Do x i = sum / a i,i End Do 33

34 Gaussian Elimination with Scaled Partial Pivoting  Problems with Naive Gaussian Elimination  Definitions and Initial step  Forward Elimination  Backward substitution  Example

35 Problems with Naive Gaussian Elimination oThe Naive Gaussian Elimination may fail for very simple cases. (The pivoting element is zero). oVery small pivoting element may result in serious computation errors

36 Example 2

37 Example 2 Initialization step Scale vector: disregard sign find largest in magnitude in each row

38 Why Index Vector?  Index vectors are used because it is much easier to exchange a single index element compared to exchanging the values of a complete row.  In practical problems with very large N, exchanging the contents of rows may not be practical.

39 Example 2 Forward Elimination-- Step 1: eliminate x1

40 Example 2 Forward Elimination-- Step 1: eliminate x1 First pivot equation

41 Example 2 Forward Elimination-- Step 2: eliminate x2

42 Example 2 Forward Elimination-- Step 3: eliminate x3 Third pivot equation

43 Example 2 Backward Substitution

44 Example 3

45 Example 3 Initialization step

46 Example 3 Forward Elimination-- Step 1: eliminate x1

47 Example 3 Forward Elimination-- Step 1: eliminate x1

48 Example 3 Forward Elimination-- Step 2: eliminate x2

49 Example 3 Forward Elimination-- Step 2: eliminate x2

50 Example 3 Forward Elimination-- Step 3: eliminate x3

51 Example 3 Forward Elimination-- Step 3: eliminate x3

52 Example 3 Backward Substitution

53 How Do We Know If a Solution is Good or Not Given AX=B X is a solution if AX-B=0 Compute the residual vector R= AX-B Due to rounding error, R may not be zero

54 How Good is the Solution?

55 Remarks:  We use index vector to avoid the need to move the rows which may not be practical for large problems.  If we order the equation as in the last value of the index vector, we have a triangular form.  Scale vector is formed by taking maximum in magnitude in each row.  Scale vector does not change.  The original matrices A and B are used in checking the residuals.

56 Tridiagonal & Banded Systems and Gauss-Jordan Method  Tridiagonal Systems  Diagonal Dominance  Tridiagonal Algorithm  Examples  Gauss-Jordan Algorithm

57 Tridiagonal Systems:  The non-zero elements are in the main diagonal, super diagonal and subdiagonal.  a ij =0 if |i-j| > 1 Tridiagonal Systems

58  Occur in many applications  Needs less storage (4n-2 compared to n 2 +n for the general cases)  Selection of pivoting rows is unnecessary (under some conditions)  Efficiently solved by Gaussian elimination Tridiagonal Systems

59  Based on Naive Gaussian elimination.  As in previous Gaussian elimination algorithms Forward elimination step Backward substitution step  Elements in the super diagonal are not affected.  Elements in the main diagonal, and B need updating Algorithm to Solve Tridiagonal Systems

60 Tridiagonal System

61 Diagonal Dominance

62 Diagonal Dominance

63 Diagonally Dominant Tridiagonal System  A tridiagonal system is diagonally dominant if  Forward Elimination preserves diagonal dominance

64 Solving Tridiagonal System

65 Example

66 Example

67 Example Backward Substitution  After the Forward Elimination:  Backward Substitution:

68 Gauss-Jordan Method  The method reduces the general system of equations AX=B to IX=B where I is an identity matrix.  Only Forward elimination is done and no backward substitution is needed.  It has the same problems as Naive Gaussian elimination and can be modified to do partial scaled pivoting.  It takes 50% more time than Naive Gaussian method.

69 Gauss-Jordan Method Example

70 Gauss-Jordan Method Example

71 Gauss-Jordan Method Example

72 Gauss-Jordan Method Example