You are on page 1of 11

Pitfalls of Elimination Methods

• Division by zero. It is possible that during both


elimination and back-substitution phases a division
by zero can occur.
• Round-off errors.
• Ill-conditioned systems. Systems where small changes
in coefficients result in large changes in the solution.
Alternatively, it happens when two or more equations
are nearly identical, resulting a wide ranges of
answers to approximately satisfy the equations. Since
round off errors can induce small changes in the
coefficients, these changes can lead to large solution
errors.
• Singular systems. When two equations are
identical, we would lose one degree of
freedom and be dealing with the impossible
case of n-1 equations for n unknowns. For
large sets of equations, it may not be obvious
however. The fact that the determinant of a
singular system is zero can be used and tested
by computer algorithm after the elimination
stage. If a zero diagonal element is created,
calculation is terminated.
Techniques for Improving Solutions
• Use of more significant figures.
• Pivoting. If a pivot element is zero,
normalization step leads to division by zero.
The same problem may arise, when the pivot
element is close to zero. Problem can be
avoided:
– Partial pivoting. Switching the rows so that the
largest element is the pivot element.
– Complete pivoting. Searching for the largest
element in all rows and columns then switching.
Partial Pivoting
• Consider solving the following equations.
A method known as Gaussian Elimination
with Partial Pivoting will be shown:

3 1 6  x   1 
5 4 2  y    12 
    
   
1 3 8   z   3
Partial Pivoting
• With just three unknowns, this can be
solved relatively easily by hand. If there
were seven unknowns, the calculations
would be very tedious, and with 20, almost
impossible simply because of the amount
of calculation involved – an ideal situation
for a computer.
Partial Pivoting
• We will walk down the elements of the leading
diagonal. The first one is 3. We look for the
largest element underneath this entry, and if it is
larger than 3, swap the two rows over. In this
case,5 is the largest element, so the first two
rows are swapped:
5 4 2  x   12 
3 1 6   y    1 
    
1 3 8   z   3
Partial Pivoting
• Now, looking at the 5 in the diagonal, we
subtract the correct multiple of the top row from
each of the rows beneath it to make all the
numbers below the 5 into 0s. This means
subtracting 3/5 of the top row from the second
row and 1/3 of the top row from the third. This
gives:
5 4 2   x   12 
0  7 5 24 5  y     31 5 
    
0 11 5 38 5  z   27 5
• The first diagonal element is now complete, so we move
on to the second diagonal element and repeat the same
procedure. The diagonal element is -7/5. We look at
every element beneath it to see if any of them is larger,
and if so swap the rows over. In this case, 11/5 is larger,
so we swap the second and third rows to give:

5 4 2   x   12 
0 11 5 38 5  y    27 5
    
0  7 5 24 5  z    31 5 
Partial Pivoting
• Now, keeping our eyes on the 11/5, we subtract
the right multiple of the second row to make
every element below the 11/5 into 0. In this
case, it means adding 7/11 of the second row to
the third to give:
5 4 2   x   12 
0 11 5 38 5   y     27 5 
    
0 0 106 11  z   106 11
Partial Pivoting
• The matrix is now in upper triangular form.
The values of x, y and z can be easily
calculated with back substitution.
• The method could be broken down using a top down development
to give:

Gaussian Elimination with partial pivoting to solve the equations


Input the data
Pivot the matrix
For each element on the leading diagonal
Find the largest element below leading diagonal
Swap so that the row of largest element swaps
with current one
Perform forward elimination
For each row below current element
Eliminate elements
Perform back substitution
For each row from bottom to top
Use constant on right and known answers to get t
he next answer
Store the results

You might also like