Download presentation

Presentation is loading. Please wait.

Published byGerard Armstrong Modified over 5 years ago

1
**Mujahed AlDhaifallah (Term 342) Read Chapter 9 of the textbook**

EE 3561 : - Computational Methods Unit 3: Solution of Systems of Linear Equations Mujahed AlDhaifallah (Term 342) Read Chapter 9 of the textbook EE3561_Unit 3 (c)AL-DHAIFALLAH1435

2
**Systems of linear equations**

Coefficient Matrix Unknown Vector RHS Vector EE3561_Unit 3 (c)AL-DHAIFALLAH1435

3
**Solutions of linear equations**

EE3561_Unit 3 (c)AL-DHAIFALLAH1435

4
**Solutions of linear equations**

A set of equations is inconsistent if there exist no solution to the system of equations EE3561_Unit 3 (c)AL-DHAIFALLAH1435

5
**Solutions of linear equations**

Some systems of equations may have infinite number of solutions EE3561_Unit 3 (c)AL-DHAIFALLAH1435

6
**Graphical Solution of Systems of Linear Equations**

EE3561_Unit 3 (c)AL-DHAIFALLAH1435

7
**Cramer’s Rule is not practical**

EE3561_Unit 3 (c)AL-DHAIFALLAH1435

8
**Lecture 6 Naive Gaussian Elimination**

Examples EE3561_Unit 3 (c)AL-DHAIFALLAH1435

9
**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. EE3561_Unit 3 (c)AL-DHAIFALLAH1435

10
**Elementary Row operations**

Adding a multiple of one row to another Multiply any row by a non-zero constant EE3561_Unit 3 (c)AL-DHAIFALLAH1435

11
**Example Forward Elimination**

EE3561_Unit 3 (c)AL-DHAIFALLAH1435

12
**Example Forward Elimination**

EE3561_Unit 3 (c)AL-DHAIFALLAH1435

13
**Example Forward Elimination**

EE3561_Unit 3 (c)AL-DHAIFALLAH1435

14
**Example Backward substitution**

EE3561_Unit 3 (c)AL-DHAIFALLAH1435

15
Forward Elimination EE3561_Unit 3 (c)AL-DHAIFALLAH1435

16
Forward Elimination EE3561_Unit 3 (c)AL-DHAIFALLAH1435

17
**Backward substitution**

EE3561_Unit 3 (c)AL-DHAIFALLAH1435

18
**How many solutions does a system of equations AX=B have?**

EE3561_Unit 3 (c)AL-DHAIFALLAH1435

19
**How do we know if a solution is good or not**

Given AX=B X is a solution if AX-B=0 Due to computation error AX-B may not be zero Compute the residuals R=|AX-B| One possible test is ????? EE3561_Unit 3 (c)AL-DHAIFALLAH1435

20
Determinant EE3561_Unit 3 (c)AL-DHAIFALLAH1435

21
**Linear Systems Types Singular Systems EE3561_Unit 3**

(c)AL-DHAIFALLAH1435

22
**Detecting Singularity**

After completing the elimination step, the determinant can be evaluated as the product of the diagonal elements. One can detect singularity by the fact that the determinant of a singular system is zero. EE3561_Unit 3 (c)AL-DHAIFALLAH1435

23
**Problems with Naive Gaussian Elimination**

The Naive Gaussian Elimination may fail for very simple cases. (The pivoting element is zero). Very small pivoting element may result in , serious computation errors EE3561_Unit 3 (c)AL-DHAIFALLAH1435

24
Possible solution Equations Permutation: Naive Gaussian elimination method works well in the above two examples if the equations are first permuted, i.e., arranged as The procedure that will do so is called “Gaussian elimination with scaled partial pivoting”. EE3561_Unit 3 (c)AL-DHAIFALLAH1435

25
**Gaussian Elimination with Scaled Partial Pivoting**

In Gaussian elimination method, the order in which the equations are used as pivoting equations is the natural order {1, 2, 3, · · · , n}. To overcome the problems that Naive Guassian elimination procedure face, we choose an order which is different than the natural used in forward elimination method. This is called partial pivoting. The most important step in this method is to determine the pivot equation EE3561_Unit 3 (c)AL-DHAIFALLAH1435

26
**Gaussian Elimination with Scaled Partial Pivoting**

EE3561_Unit 3 (c)AL-DHAIFALLAH1435

27
**Scaled Partial Pivoting Procedure**

Let l0 = {1, 2, 3, · · · , n}. This vector is called the “index vector”. Define This vector is called the “Scale Vector” and is fixed for all operations. This means that si =absolute value of the maximum element in row i. For iteration 1, define ratio#1 as That is divide the absolute value of the elements of the first column by the corresponding elements in the “Scaled Vector”. EE3561_Unit 3 (c)AL-DHAIFALLAH1435

28
**Scaled Partial Pivoting Procedure**

Choose the equation which give the greatest ratio as the first pivoting equation. Assume the greatest ratio is Set the new index vector to be i.e., interchange the place of 1 and i in l0 to get l1. Then do the elimination as in the Naive Gaussian elimination method by taking raw i as the pivot raw and aii as the pivot element. Repeat steps 3 to 6 for n − 1 iterations. EE3561_Unit 3 (c)AL-DHAIFALLAH1435

29
Example 2 EE3561_Unit 3 (c)AL-DHAIFALLAH1435

30
**Example 2 Initialization step**

Scale vector: disregard sign find largest in magnitude in each row EE3561_Unit 3 (c)AL-DHAIFALLAH1435

31
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 since they could be stored at different locations. EE3561_Unit 3 (c)AL-DHAIFALLAH1435

32
**Example 2 Forward Elimination-- Step 1: eliminate x1**

EE3561_Unit 3 (c)AL-DHAIFALLAH1435

33
**Example 2 Forward Elimination-- Step 1: eliminate x1**

First pivot equation EE3561_Unit 3 (c)AL-DHAIFALLAH1435

34
**Example 2 Forward Elimination-- Step 2: eliminate x2**

EE3561_Unit 3 (c)AL-DHAIFALLAH1435

35
**Example 2 Forward Elimination-- Step 2: eliminate x2**

EE3561_Unit 3 (c)AL-DHAIFALLAH1435

36
**Example 2 Forward Elimination-- Step 3: eliminate x3**

Third pivot equation Determinant = (-1)3*(-1.5)(-2.5)(2)(4) = 30- EE3561_Unit 3 (c)AL-DHAIFALLAH1435

37
**Example 2 Backward substitution**

EE3561_Unit 3 (c)AL-DHAIFALLAH1435

38
Example 3 EE3561_Unit 3 (c)AL-DHAIFALLAH1435

39
**Example 3 Initialization step**

EE3561_Unit 3 (c)AL-DHAIFALLAH1435

40
**Example 3 Forward Elimination-- Step 1: eliminate x1**

EE3561_Unit 3 (c)AL-DHAIFALLAH1435

41
**Example 3 Forward Elimination-- Step 1: eliminate x1**

EE3561_Unit 3 (c)AL-DHAIFALLAH1435

42
**Example 3 Forward Elimination-- Step 2: eliminate x2**

EE3561_Unit 3 (c)AL-DHAIFALLAH1435

43
**Example 3 Forward Elimination-- Step 2: eliminate x2**

EE3561_Unit 3 (c)AL-DHAIFALLAH1435

44
**Example 3 Forward Elimination-- Step 3: eliminate x3**

EE3561_Unit 3 (c)AL-DHAIFALLAH1435

45
**Example 3 Forward Elimination-- Step 3: eliminate x3**

Determinant = (-1)2*(0.8448)* ( )*(-10.5)*(4) = EE3561_Unit 3 (c)AL-DHAIFALLAH1435

46
**Example 3 Backward substitution**

EE3561_Unit 3 (c)AL-DHAIFALLAH1435

47
**How good is the solution?**

EE3561_Unit 3 (c)AL-DHAIFALLAH1435

48
Remarks: We use index vector to avoid the need to move the rows which may not be practical for large problems. If you order equation as in the last value of the index vector, you have 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. EE3561_Unit 3 (c)AL-DHAIFALLAH1435

Similar presentations

© 2021 SlidePlayer.com Inc.

All rights reserved.

To make this website work, we log user data and share it with processors. To use this website, you must agree to our Privacy Policy, including cookie policy.

Ads by Google