10.3 Partial Pivoting

   

 
Java Number Cruncher: The Java Programmer's Guide to Numerical Computing
By Ronald  Mak

Table of Contents
Chapter  10.   Solving Systems of Linear Equations

10.3 Partial Pivoting

We can improve the Gaussian elimination algorithm by adding an operation called partial pivoting.

Partial pivoting prevents dividing by zero during forward elimination, and it helps with the problem of dividing by a small pivot element. At each elimination step, partial pivoting exchanges the equations in order to choose the best pivot equation. (Full pivoting includes changing the order of the coefficients of the equations and is usually not done.)

As we saw in Section 10.1 during forward elimination, we designate one equation the pivot equation, and then we subtract multiples of that equation from the equations below it to eliminate one unknown. The multiplier is a fraction whose divisor is the pivot element, the leading coefficient of the pivot equation. Therefore, if we want to avoid dividing by a small number, we want the pivot element to be the largest possible. To make this happen, we pivot (exchange) equations if necessary.

The following is a simple system to illustrate the need for partial pivoting:

graphics/10equ06.gif


The solution is approximately x 1 = 1.00005 and x 2 = 0.99995, or, with three significant digits, x 1 = 1.00 and x 2 = 1.00.

Forward elimination produces (with three significant digits)

graphics/10equ06a.gif


and back substitution yields

graphics/10equ07.gif


which is completely wrong for x 1 . The error occurred during forward elimination?adividing by the small pivot element 0.000100 generated large values, which were then subtracted from much smaller values, causing magnitude errors like the ones we examined in Chapter 4.

Before we try to eliminate x 1 in the first step, we should make the pivot element as large as possible in absolute value. Certainly, the coefficient of x 1 in the second equation, 1.00, is greater than 0.000100, so we do a partial pivot by exchanging the two rows:

graphics/10equ08.gif


Now forward elimination yields (with three significant digits)

graphics/10equ09.gif


and back substitution gives us the much more accurate solution

graphics/10equ10.gif



   
Top
 


Java Number Cruncher. The Java Programmer's Guide to Numerical Computing
Java Number Cruncher: The Java Programmers Guide to Numerical Computing
ISBN: 0130460419
EAN: 2147483647
Year: 2001
Pages: 141
Authors: Ronald Mak

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net