10.4 Scaling

   

 
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.4 Scaling

Even partial pivoting is not always enough, however. The following is another simple system:

graphics/10equ11.gif


The approximate answer is x 1 = 1.0002 and x 2 = 0.9997, or, with three significant digits, x 1 = 1.00 and x 2 = 1.00.

Forward elimination gives us (with three significant digits)

graphics/10equ12.gif


and back substitution produces the inaccurate solution

graphics/10equ13.gif


So we failed, even though the pivot element was the largest possible. After forward elimination, we still have magnitude errors from the greatly different coefficient values.

Scaling helps with this problem. To scale an equation, divide through by the coefficient with the largest absolute value in that equation. Thus, we divide the first equation through by 10,000 and the second equation through by 2.00:

graphics/10equ14.gif


Now we must partially pivot:

graphics/10equ15.gif


Forward elimination gives us

graphics/10equ16.gif


And, finally, back substitution produces

graphics/10equ17.gif


We can improve the Gaussian elimination algorithm with a combination of scaling and partial pivoting.


   
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