Presentation is loading. Please wait.

Presentation is loading. Please wait.

Copyright © The McGraw-Hill Companies, Inc. Permission required for reproduction or display. 1 Part 3 - Chapter 9 Linear Systems of Equations: Gauss Elimination.

Similar presentations


Presentation on theme: "Copyright © The McGraw-Hill Companies, Inc. Permission required for reproduction or display. 1 Part 3 - Chapter 9 Linear Systems of Equations: Gauss Elimination."— Presentation transcript:

1 Copyright © The McGraw-Hill Companies, Inc. Permission required for reproduction or display. 1 Part 3 - Chapter 9 Linear Systems of Equations: Gauss Elimination

2 Copyright © The McGraw-Hill Companies, Inc. Permission required for reproduction or display. 2 Gauss Elimination Chapter 9 Solving Small Numbers of Equations There are many ways to solve a system of linear equations: –Graphical method –Cramer’s rule –Method of elimination Computer methods are necessary for large numbers of equations For n ≤ 3

3 Copyright © The McGraw-Hill Companies, Inc. Permission required for reproduction or display. 3 Graphical Method For two equations: Solve both equations for x 2:

4 Copyright © The McGraw-Hill Companies, Inc. Permission required for reproduction or display. 4 Plot x 2 vs. x 1 on rectilinear paper, the intersection of the lines present the solution. Fig. 9.1

5 Copyright © The McGraw-Hill Companies, Inc. Permission required for reproduction or display. 5

6 6 Figure 9.2 No Solutions Infinite Solutions Ill conditioned

7 Copyright © The McGraw-Hill Companies, Inc. Permission required for reproduction or display. 7 Determinants and Cramer’s Rule Cramer’s rule uses determinants to solve for the vector of unknowns, x.

8 Copyright © The McGraw-Hill Companies, Inc. Permission required for reproduction or display. The technique for calculating a determinant is similar to that for calculating the cross product (chapter 8) 8

9 Copyright © The McGraw-Hill Companies, Inc. Permission required for reproduction or display. 9 Is the same as:

10 Copyright © The McGraw-Hill Companies, Inc. Permission required for reproduction or display. 10 Cramer’s rule expresses the solution of a system of linear equations in terms of ratios of determinants of the array of coefficients of the equations. For example, x 1 would be computed as:

11 Copyright © The McGraw-Hill Companies, Inc. Permission required for reproduction or display. 11

12 Copyright © The McGraw-Hill Companies, Inc. Permission required for reproduction or display. Solve Example 9.2 using the det function in MATLAB 12

13 Copyright © The McGraw-Hill Companies, Inc. Permission required for reproduction or display. 13

14 Copyright © The McGraw-Hill Companies, Inc. Permission required for reproduction or display. 14

15 Copyright © The McGraw-Hill Companies, Inc. Permission required for reproduction or display. 15 Method of Elimination The basic strategy is to –successively solve one of the equations of the set for one of the unknowns –and to eliminate that variable from the remaining equations by substitution. The elimination of unknowns can be extended to systems with more than two or three equations; however, the method becomes extremely tedious to solve by hand.

16 Copyright © The McGraw-Hill Companies, Inc. Permission required for reproduction or display. For example… page 230 3 rd edition 16

17 Copyright © The McGraw-Hill Companies, Inc. Permission required for reproduction or display. 17 Naive Gauss Elimination Extension of method of elimination to large sets of equations by developing a systematic scheme or algorithm to eliminate unknowns and to back substitute. As in the case of the solution of two equations, the technique for n equations consists of two phases: –Forward elimination of unknowns –Back substitution

18 Copyright © The McGraw-Hill Companies, Inc. Permission required for reproduction or display. 18

19 Copyright © The McGraw-Hill Companies, Inc. Permission required for reproduction or display. 19 Pivot row

20 Copyright © The McGraw-Hill Companies, Inc. Permission required for reproduction or display. 20 Pivot row

21 Copyright © The McGraw-Hill Companies, Inc. Permission required for reproduction or display. 21 Pivot row

22 Copyright © The McGraw-Hill Companies, Inc. Permission required for reproduction or display. 22

23 Copyright © The McGraw-Hill Companies, Inc. Permission required for reproduction or display. 23

24 Copyright © The McGraw-Hill Companies, Inc. Permission required for reproduction or display. Example 9.3

25 Copyright © The McGraw-Hill Companies, Inc. Permission required for reproduction or display. 25 % Example 9.3

26 Copyright © The McGraw-Hill Companies, Inc. Permission required for reproduction or display. 26 Pitfalls of Elimination Methods Division by zero. It is possible that during both elimination and back-substitution phases a division by zero can occur. Round-off errors. Ill-conditioned systems. Systems where small changes in coefficients result in large changes in the solution.

27 Copyright © The McGraw-Hill Companies, Inc. Permission required for reproduction or display. 27 Singular systems. When two equations are identical, we would loose one degree of freedom. Use the fact that the determinant of a singular system is zero to test for singular systems.

28 Copyright © The McGraw-Hill Companies, Inc. Permission required for reproduction or display. 28 Techniques for Improving Solutions Use of more significant figures. Pivoting. If a pivot element is zero, normalization step leads to division by zero. The same problem may arise, when the pivot element is close to zero. Problem can be avoided: –Partial pivoting. Switching the rows so that the largest element is the pivot element. –Complete pivoting. Searching for the largest element in all rows and columns then switching.

29 Copyright © The McGraw-Hill Companies, Inc. Permission required for reproduction or display. 29

30 Copyright © The McGraw-Hill Companies, Inc. Permission required for reproduction or display. 30 Example 9.4 Partial Pivoting Use Gauss elimination with and without partial pivoting to solve:

31 Copyright © The McGraw-Hill Companies, Inc. Permission required for reproduction or display. Multiply the first equation by 1/.0003 31

32 Copyright © The McGraw-Hill Companies, Inc. Permission required for reproduction or display. Subtract 32

33 Copyright © The McGraw-Hill Companies, Inc. Permission required for reproduction or display. Back Substitute 33

34 Copyright © The McGraw-Hill Companies, Inc. Permission required for reproduction or display. The answer is highly dependent on the number of significant figures you carry 34 Significant Figures X2X2 X1X1 Absolute Value of Percent Relative Error 30.667-3.331099 40.66670.0000100 50.666670.3000010 60.6666670.3300001 70.66666670.33300000.1

35 Copyright © The McGraw-Hill Companies, Inc. Permission required for reproduction or display. Implement Pivoting 35 Make the equation with the largest value of a I,1 the pivot row

36 Copyright © The McGraw-Hill Companies, Inc. Permission required for reproduction or display. Multiply the first equation by.0003/1 36

37 Copyright © The McGraw-Hill Companies, Inc. Permission required for reproduction or display. Subtract 37

38 Copyright © The McGraw-Hill Companies, Inc. Permission required for reproduction or display. Back Substitute 38

39 Copyright © The McGraw-Hill Companies, Inc. Permission required for reproduction or display. The answer is much less dependent on the number of significant figures you carry 39 Significant Figures X2X2 X1X1 Absolute Value of Percent Relative Error 30.6670.3330.1 40.66670.33330.01 50.666670.333330.001 60.6666670.3333330.0001 70.66666670.33333330.00001

40 Copyright © The McGraw-Hill Companies, Inc. Permission required for reproduction or display. Tridiagonal Systems A tridiagonal system is a banded system with a bandwidth of 3: Tridiagonal systems can be solved using the same method as Gauss elimination, but with much less effort because most of the matrix elements are already 0.

41 Copyright © The McGraw-Hill Companies, Inc. Permission required for reproduction or display. Tridiagonal System Solver

42 Copyright © The McGraw-Hill Companies, Inc. Permission required for reproduction or display. Summary For small systems of linear equations we can use –Graphical techniques –Cramer’s rule –Method of elimination For large systems of linear equations we need a computer technique such as gaussian elimination 42

43 Copyright © The McGraw-Hill Companies, Inc. Permission required for reproduction or display. Gaussian Elimination Naïve Gaussian elimination Pivoting –Partial Pivoting –Complete Pivoting Left Division implements Gaussian elimination 43


Download ppt "Copyright © The McGraw-Hill Companies, Inc. Permission required for reproduction or display. 1 Part 3 - Chapter 9 Linear Systems of Equations: Gauss Elimination."

Similar presentations


Ads by Google