VIEWS: 47 PAGES: 17 POSTED ON: 3/27/2011 Public Domain
TERM PAPER OF NUMERICAL ANALYSIS (MTH204) TOPIC NAME: ROLE OF PIVOTING IN SOLVING SYSTEM OF LINEAR EQUATIONS.MIXED BOUNDARY CONDITIONS IN SOLVING DIFFERENTIAL EQUATIONS SUBMITTED TO: SUBMITTED BY: ACKNOWLEDGEMENT First and foremost, I thank my teacher who has assigned me for this term paper to bring out my capabilities. I express my gratitude to my parents for being a continuous source of encouragement and for their financial aids given to me. I would like to acknowledge the assistance provided to me by the library staff of L.P.U. My heartful gratitude to my friends for helping me to complete my work in time. TABLE OF CONTENTS Sr.No. Topic Name Page No. 1 System of linear equations 4-5 2 Methods for solving system of 5 linear equations (in detail the role of Pivoting in Linear eq.) 3 Gauss elimination 6-8 4 Example of Gauss elimination 8-9 5 Disadvantages of Gauss 10 elimination and How to remove them 6 Pivoting:(i)Partial Pivoting 10-13 (ii) Complete Pivoting 7 Why pivoting is important? 14-15 i) Gauss-elimination without partial pivoting ii) Gauss-elimination with partial pivoting 8 Why use Gaussian elimination 15 9 Mixed boundary condition 16 10 Conclusion 16 11 Bibliography/Refrences 17 System of linear equations: General equations An n-dimensional linear equation takes the form Ax = b Where, A is a known n × n matrix b is a known n × 1 vector x is an unknown n × 1 vector to be determined a11 x1 + a12 x2 + a13 x3 + . . . . + a1n xn = b1 a21 x1 + a22 x2 + a23 x3 + . . . . + a2n xn = b2 ………………………………………………... ………………………………………………… an1 x1 + an2 x2 + an3 x3 + . . . . + ann xn = bn 1) Linear equations are ubiquitous in computational economics. 2) Linear equations arise naturally in many applications: a) Linear multicommodity market equilibrium models b) Finite-state financial market models c) Markov chain models d) Ordinary least squares 3) Linear equations, however, more often arise indirectly when numerically solving economic models involving nonlinear and functional equations: a) Nonlinear multicommodity market models b) Multiperson static game models c) Dynamic optimization models d) Rational expectations models Matrix representation Or, A x = b There are several methods for solving system of linear equations 1) Cramer’s rule 2) Finding A-1, then x = A-1 b 3) Gauss Elimination (GE) with partial pivoting 4) Gauss-Jordon (GJ) method 5) LU decomposition 6) Iterative methods But in this term paper I have to explain in detail the role of Pivoting in solving system of linear equation. GAUSS ELIMINATION A linear equation may be solved using Gaussian Elimination. 1) Gaussian elimination employs elementary row operations: a) Interchange two rows b) Multiply a row by a nonzero constant c) Add a nonzero multiple of one row to another 2) Elementary row operations alter the form of a linear equation without changing its solution. In Gauss elimination, we convert A x = b to U x = g, where U is an upper triangular matrix. The system of equations is then solved easily by back substitution. Method: Create zeros below the diagonal elements. Denote the original matrix by Step 1: Define row multipliers as: Eliminate x1 from equation (2) through (n). Define: for i, j=2, 3,……….., n Convert these elements into zero in the next At step kth, Define multiplier as and calculate for i, j = (k+1), . . . , n EXAMPLE: x1 + 2 x2 + x3 = 0 2 x1+ 2 x2 + 3 x3 = 3 - x1 – 3 x2 = 2 The augmented matrix of these equations is given as: Define: Calculate: Define: Calculate: Back Substitution Therefore, Disadvantages of GAUSS ELIMINATION: If during triangularization of A by Gauss elimination, no zeros appear on the diagonal of the final upper triangular matrix, U, the rank of A is equal to n, and unique solution exists. Gauss elimination method does not work a) if the first coefficient of the first row is zero b) If a diagonal coefficient becomes zero in the process of solution as they are used in the denominators during forward elimination. c) Gauss elimination method produces poor result d) If the diagonal coefficient are smaller in magnitude compared to the off-diagonal coefficients. To remove these: Use partial pivoting – interchange rows in order to avoid zero being present at diagonal locations, and also, make each diagonal coefficient larger in magnitude than any other coefficients below it. a) Advantages for Gauss elimination with partial pivoting b) Prevents diagonal coefficient from becoming zero (or very small number) thereby allowing Gauss elimination to continue. c) Reduces round-off error thereby increases accuracy of solution. PIVOTING: 1) PARTIAL PIVOTING a) The equations are not mathematically affected. It merely changes the sequential order in which the equations are solved thereby makes the computation possible whenever the diagonal coefficient becomes zero or very small number. b) Even when all diagonal coefficients are non-zero, the changes of the order increase accuracy in computation of solution. c) If a zero diagonal element is unavoidable inspite of pivoting, it indicates that the problem has no unique solution. Some equations are linearly dependent. In partial or column pivoting, we rearrange the rows of the matrix and bring the numerically largest value in the column onto the diagonal right-hand side. For example in this matrix the largest value is in element 6, 2 and so we simply swap rows 2 and 6 to give Partial pivoting may be implemented for every step of the solution process, or only when the diagonal values are sufficiently small as to potentially cause a problem. Pivoting for every step will lead to smaller errors being introduced through numerical inaccuracies, but the continual reordering will slow down the calculation. Partial pivoting: At stage k That is, if i > k, then switch rows “k” and “i” in A and b, and proceed with step k elimination process of Gauss elimination. All multipliers will now satisfy This prevents the growth of elements in A (k) of greatly varying size and thus reduce the possibility for large loss of significant errors. 2) FULL PIVOTING / COMPLETE PIVOTING Complete pivoting (interchange of both rows and columns) to get the largest coefficient at diagonal location will improve accuracy in computation even further. Switch rows of A and b, and columns of A to bring at the pivot position an element maximum absolute value of Ck. The full pivoting is much the same as that of partial pivoting. The main difference is that the numerically largest value in the column or row containing the value to be replaced. For example above element the magnitude of element 2, 5 (201) is the greatest in either row 2 or column 2 so we shall rearrange the columns to bring this element onto the diagonal. This will also entail a rearrangement of the solution vector x. The rearranged system becomes The ultimate degree of accuracy can be provided by rearranging both rows and columns so that the numerically largest value in the sub matrix not yet processed is brought onto the diagonal. In the example above, the largest value is 6003 occurring at position 4, 6 in the matrix. We may bring this onto the diagonal for the next step by interchanging columns one and six and rows two and four. The order in which we do this is unimportant. The final result is Again this process may be undertaken for every step, or only when the value on the diagonal is considered too small relative to the other values in the matrix. If it is not possible to rearrange the columns or rows to remove a zero from the diagonal, then the matrix A is singular and no solution exists. Note that, a) The order of unknown is changed with a column switch b) Complete pivoting is expensive as it requires bookkeeping of the variables and thus is not usually used. Not to allow error to grow Partial pivoting must be used with Gauss elimination a) To avoid getting zero on the diagonal, and b) To increase accuracy by reducing round-off errors. Why pivoting is important? Let A and b be as follows Gauss-elimination without partial pivoting: The upper triangular matrix obtained is as follows: Solution is: Whereas the exact solution of the above problem is Gauss-elimination with partial pivoting: Rearrange the matrix to get maximum absolute value entry at the pivots. Gauss elimination now results: Therefore, just by rearranging the set of equations, we could reduce the round-off errors. Why use Gaussian elimination to solve linear equations? 1) Gaussian elimination is the most efficient known method for solving a general n-dimensional linear equation Ax = b. 2) For large n, Gaussian elimination requires about n3/3 + n2 multiplication/division operations. 3) Explicitly computing A−1b requires about n3 + n2 operations. a) Cramer’s rule requires (n + 1)! operations. b) For n = 10, the number of operations are Gaussian Elimination 430 Explicit Inverse 1,100 Cramer’s Rule 40,000,000 MIXED BOUNDARY CONDITION A MIXED BOUNDARY CONDITION for a partial differential equation indicates that different boundary conditions are used on different parts of the boundary of the domain of the equation. For example, if u is a solution to a partial differential equation on a set Ω with piecewise - smooth boundary ∂Ω, and ∂Ω is divided into two parts, Γ₁ and Γ₂, one can use a Dirichlet boundary condition on Γ₁ and a Neumann boundary condition on Γ₂: where u₀ and g are given functions defined on those portions of the boundary. CONCLUSION Pivoting must be used in Gauss elimination Method to solve the system of equations. It helps to sole the equations in correct manner. Without using pivoting there are some variations in results as described in above example. Pivoting helps to avoid getting zero on the diagonal, and also helps to increase accuracy by reducing round-off errors.Therefore, it is important to use it in Guass elimination method to solve the system of equations. BIBLIOGRAPHY 1) http://azload.com/pol502-lecture-notes-linear-algebra-2414.html 2) http://azload.com/lecture-notes-for-linear-algebra-1868.html 3) http://www.supermath.info/LinearnotestoSec5p3.pdf 4) http://en.wikipedia.org/wiki/Mixed_boundary_condition