Numerical Methods. Introduction Prof. S. M. Lutful Kabir, BRAC University2  One of the most popular techniques for solving simultaneous linear equations.

Slides:



Advertisements
Similar presentations
Numerical Solution of Linear Equations
Advertisements

Chapter 2 Solutions of Systems of Linear Equations / Matrix Inversion
Numerical Methods.  Forward Elimination of Unknowns: In this step, the unknown is eliminated in each equation starting with the first equation. This.
Gauss Elimination.
Chapter: 3c System of Linear Equations
CSCI-455/552 Introduction to High Performance Computing Lecture 25.
Autar Kaw Humberto Isaza
Simultaneous Linear Equations
Lecture 9: Introduction to Matrix Inversion Gaussian Elimination Sections 2.4, 2.5, 2.6 Sections 2.2.3, 2.3.
Part 3 Chapter 9 Gauss Elimination
Chapter 9 Gauss Elimination The Islamic University of Gaza
Major: All Engineering Majors Author(s): Autar Kaw
1 Simultaneous Linear Equations Gaussian Elimination.
Linear Algebraic Equations
ECIV 301 Programming & Graphics Numerical Methods for Engineers Lecture 15 Solution of Systems of Equations.
Algorithm for Gauss elimination 1) first eliminate for each eq. j, j=1 to n-1 for all eq.s k greater than j a) multiply eq. j by a kj /a jj b) subtract.
Mujahed AlDhaifallah (Term 342) Read Chapter 9 of the textbook
The Islamic University of Gaza Faculty of Engineering Civil Engineering Department Numerical Analysis ECIV 3306 Chapter 10 LU Decomposition and Matrix.
Systems of Linear Equations
Copyright © 2006 The McGraw-Hill Companies, Inc. Permission required for reproduction or display. by Lale Yurttas, Texas A&M University Part 31 Chapter.
Copyright © 2006 The McGraw-Hill Companies, Inc. Permission required for reproduction or display. 1 ~ Linear Algebraic Equations ~ Gauss Elimination Chapter.
Major: All Engineering Majors Author(s): Autar Kaw
CSE 330 : Numerical Methods
Math 201 for Management Students
MATH 250 Linear Equations and Matrices
MECN 3500 Inter - Bayamon Lecture 7 Numerical Methods for Engineering MECN 3500 Professor: Dr. Omar E. Meza Castillo
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.
Chemical Engineering Majors Author(s): Autar Kaw
Copyright © The McGraw-Hill Companies, Inc. Permission required for reproduction or display. 1 Part 3 - Chapter 9 Linear Systems of Equations: Gauss Elimination.
CSE 330 : Numerical Methods Lecture 15: Numerical Integration - Trapezoidal Rule Dr. S. M. Lutful Kabir Visiting Professor, BRAC University & Professor.
Gaussian Elimination Electrical Engineering Majors Author(s): Autar Kaw Transforming Numerical Methods Education for.
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.
Gaussian Elimination Industrial Engineering Majors Author(s): Autar Kaw Transforming Numerical Methods Education for.
Gaussian Elimination Mechanical Engineering Majors Author(s): Autar Kaw Transforming Numerical Methods Education for.
Linear Systems Numerical Methods. 2 Jacobi Iterative Method Choose an initial guess (i.e. all zeros) and Iterate until the equality is satisfied. No guarantee.
3/6/ Gauss-Siedel Method Major: All Engineering Majors Author: دکتر ابوالفضل رنجبر نوعی
Gaussian Elimination Civil Engineering Majors Author(s): Autar Kaw Transforming Numerical Methods Education for STEM.
Unit #1 Linear Systems Fall Dr. Jehad Al Dallal.
Autar Kaw Benjamin Rigsby Transforming Numerical Methods Education for STEM Undergraduates.
Numerical Methods.  LU Decomposition is another method to solve a set of simultaneous linear equations  For most non-singular matrix [A] that one could.
Lecture 9 Numerical Analysis. Solution of Linear System of Equations Chapter 3.
Copyright © The McGraw-Hill Companies, Inc. Permission required for reproduction or display. 1 Part 3 - Chapter 9.
Numerical Methods. Prof. S. M. Lutful Kabir, BRAC University2  One of the most popular techniques for solving simultaneous linear equations is the Gaussian.
Pitfalls of Gauss Elimination ● Division by zero (avoid by pivoting) ● Round-off errors – Important with >100 eqns – Substitute answer into original eqn.
Part 3 Chapter 9 Gauss Elimination
Chapter: 3c System of Linear Equations
ECE 3301 General Electrical Engineering
Simultaneous Linear Equations
Spring Dr. Jehad Al Dallal
Gaussian Elimination.
Gauss-Siedel Method.
Numerical Analysis Lecture12.
PROGRAMME 4 DETERMINANTS.
Chapter 10: Solving Linear Systems of Equations
Naïve Gauss Elimination Pitfalls
Autar Kaw Benjamin Rigsby
Part 3 - Chapter 9.
Simultaneous Linear Equations
Major: All Engineering Majors Author(s): Autar Kaw
Numerical Analysis Lecture14.
Numerical Analysis Lecture13.
Numerical Analysis Lecture10.
Numerical Computation and Optimization
Simultaneous Linear Equations
Lecture 13 Simultaneous Linear Equations – Gaussian Elimination (2) Partial Pivoting Dr .Qi Ying.
Simultaneous Linear Equations Gaussian Elimination with Partial Pivoting
Naïve Gauss Elimination Pitfalls
Numerical Analysis Lecture11.
Presentation transcript:

Numerical Methods

Introduction Prof. S. M. Lutful Kabir, BRAC University2  One of the most popular techniques for solving simultaneous linear equations is the Gaussian elimination method.  The approach is designed to solve a general set of equations and unknowns

Two Steps in Gaussian Elimination Forward Elimination of Unknowns: In this step, the unknown is eliminated in each equation starting with the first equation. This way, the equations are reduced to one equation and one unknown in each equation. Back Substitution: In this step, starting from the last equation, each of the unknowns is found. Prof. S. M. Lutful Kabir, BRAC University3

Forward Elimination of Unknowns In the first step of forward elimination, the first unknown, x 1 is eliminated from all rows below the first row. The first equation is selected as the pivot equation to eliminate x 1. So, to eliminate x 1 in the second equation, one divides the first equation by a 11 (hence called the pivot element) and then multiplies it by a 21. This is the same as multiplying the first equation by a 21 /a 11 to give Prof. S. M. Lutful Kabir, BRAC University4

Forward Elimination of Unknowns (continued) Now, this equation can be subtracted from the second equation to give or where, Prof. S. M. Lutful Kabir, BRAC University5

Forward Elimination of Unknowns (continued) This procedure of eliminating, is now repeated (with the first equation as pivot) for the third equation to the n th equation to reduce the set of equations as This is the end of first step Prof. S. M. Lutful Kabir, BRAC University6

Forward Elimination of Unknowns (continued) Now for the second step of forward elimination, we start with the second equation as the pivot equation and a’ 22 as the pivot element. So, to eliminate x 2 in the third equation, one divides the second equation by a’ 22 (the pivot element) and then multiply it by a’ 32. This is the same as multiplying the second equation by a’ 32 / a’ 22 and subtracting it from the third equation. This makes the coefficient of x 2 zero in the second equation. Prof. S. M. Lutful Kabir, BRAC University7

Forward Elimination of Unknowns (continued) The same procedure is now repeated for the fourth equation till the n th equation to give Prof. S. M. Lutful Kabir, BRAC University8

Forward Elimination of Unknowns (continued) The next steps of forward elimination are conducted by using the third equation as a pivot equation and so on. There will be a total of (n-1) steps of forward elimination. At the end of (n-1) steps of forward elimination, we get a set of equations that look like 9

Back Substitution Now the equations are solved starting from the last equation as it has only one unknown. Then the second last equation, that is the (n-1) th equation, has two unknowns: x n and x n+1 and, but x n is already known. This reduces the (n-1) th equation also to one unknown. Back substitution hence can be represented for all equations by the formula for n = n-1, n-2, …2, 1 and 10

Example 1 The upward velocity of a rocket is given at three different times in Table 1. The velocity data is approximated by a polynomial as Find the values of b 1, b 2 and b 3 using the Gauss elimination method. Find the velocity at t = 6, 7.5, 9, 11 seconds. 11 Time (s)Velocity (m/s)

Solution to Example 1 (contd.) The three equations can be written as 25 b b 2 + b 3 = …. …. …. …. … …. (1) 64 b b 2 + b 3 = …. …. …. …. … …. (2) 144 b b 2 + b 3 = …. …. …. …. … …. (3) Pivoting a 11 in equation (1) we can eliminate b 1 from equation (2) and (3). The changed equation becomes, 25 b b 2 + b 3 = … ….. … (4) b b 3 = … ….. …. (5) b b 3 = (6) Prof. S. M. Lutful Kabir, BRAC University12

Solution to Example 1 (contd.) Now, with a 22 ’ as pivot element we can eliminate b 2 from equation (6), the previous three equation now become, 25 b b 2 + b 3 = … ….. … (7) b b 3 = … ….. …. (8) 0.7 b 3 = 0.76 … (9) BACK SUBSTITUTION  From equation (9), b 3 =  From equation (8), using the value of b 3, b 2 =  From equation (7), using the value of b 2 & b 3, b 1 =  Hence the equation for the velocity is v(t)=b 1 +b 2 t+b 3 t 2  The velocity at 6,7.5, 9 and 11 can be found by putting the time value in the equation. Prof. S. M. Lutful Kabir, BRAC University13

Pitfalls in Gauss Elimination Method There are two pitfalls in Gauss Elimination Method (a) Division by zero (b) Round off error Prof. S. M. Lutful Kabir, BRAC University14

Example of Pitfall of “Division by Zero” Consider the set of equations, where division by zero is a problem at the beginning, Consider another set of equations, where division by zero is a problem, Prof. S. M. Lutful Kabir, BRAC University15

Example of Pitfall of “Round off error” Let us consider, the following set of equations When they are solved, considering numbers of six significant digits, the solution is x 1 =0.9625, x 2 =1.05 and x 3 = But when numbers of five significant digits are considered, the solution becomes, x 1 =0.625, x 2 =1.5 and x 3 = Prof. S. M. Lutful Kabir, BRAC University16

Technique to improve the Gaussian Elimination Method Use more significant digits for eliminating the round off error To avoid division by zero as well as to reduce round off error gauss elimination method with partial pivoting is used Prof. S. M. Lutful Kabir, BRAC University17

Partial Pivoting The two methods are the same, except in the beginning of each step of forward elimination, a row switching is done based on the following criterion. Criteria: If there are n equations, then there are n-1 forward elimination steps. In the k th step of forward elimination, one finds the elements of the kth column below k-1 row |a kk |, |a k+1,k |,……….|a nk | Then, if the maximum of these values is |a pk | in the p th row, then switch rows p and k. The other steps of forward elimination are the same as the Gauss elimination method. The back substitution steps stay exactly the same as the Gauss elimination method. 18

Example of partial pivoting Consider the set of equations In 1 st step, the absolute values the elements in the first column are 20, 3 and 5.Among them 20 is the largest. No interchange. At the end of first step, the equations become In step 2, among and 2.75, 2.75 is the largest and since 2.75 is in the 3 rd row, so row 3 (largest) and row 2 (pivot) has to be interchanged and the next process is as usual 19