Lecture 9 Gaussian Elimination - PowerPoint PPT Presentation

1 / 32
About This Presentation
Title:

Lecture 9 Gaussian Elimination

Description:

Gauss-Jordan Method. There are one phases to the solving technique ... Gauss-Jordan method is more computational intense and does not improve the round ... – PowerPoint PPT presentation

Number of Views:91
Avg rating:3.0/5.0
Slides: 33
Provided by: San59
Category:

less

Transcript and Presenter's Notes

Title: Lecture 9 Gaussian Elimination


1
Lecture 9 - Gaussian Elimination
  • CVEN 302
  • September 12, 2001

2
Lectures Goals
  • Discuss how to solve systems
  • Gaussian Elimination
  • Gauss-Jordan
  • Tridiagonal Solver
  • Problems with the technique
  • Examples
  • Iterative Techniques

3
Gauss-Jordan Method
  • The Gauss-Jordan Method is similar to the
    Gaussian Elimination.
  • The method requires almost 50 more operations.

4
Gauss-Jordan Method
The Gauss-Jordan method changes the matrix into
the identity matrix.
5
Gauss-Jordan Method
  • There are one phases to the solving technique
  • Elimination --- use row operations to convert the
    matrix into an identity matrix.
  • The new b vector is the solution to the x values.

6
Gauss-Jordan Algorithm
  • Ax b
  • Augment the n x n coefficient matrix with the
    vector of right hand sides to form a n x (n1)
  • Interchange rows if necessary to make the value
    a11 with the largest magnitude of any coefficient
    in the first row
  • Create zero in 2nd through nth row in first row
    by subtracting ai1 / a11 times first row from ith
    row

7
Gauss-Jordan Elimination Algorithm
  • Repeat (2) (3) for first through the nth rows,
    putting the largest magnitude coefficient in the
    diagonal by interchanging rows (consider only row
    j to n ) and then subtract times the jth row
    from the ith row so as to create zeros in all
    positions of jth column and the diagonal becomes
    all ones
  • Solve for all of the equations, xi ai,n1

8
Example - Gauss Jordan
  • X1 3X2 5
  • 2X1 4X2 6

9
Example - Gauss-Jordan
  • -3X1 2X2 - X3 -1
  • 6X1 - 6X2 7X3 -7
  • 3X1 - 4X2 4X3 -6

10
Band Solver
  • Large matrices tend to be banded, which means
    that the matrix has a band of non-zero
    coefficients and zeroes on the outside of the
    matrix.
  • The simplest of the methods is the Thomas Method,
    which is used for a tridiagonal matrix.

11
Advantages of Band Solvers
  • The method reduce the number of operations and
    save the matrix in smaller amount of memory.
  • The band solver is faster and is useful for large
    scale matrices.

12
Thomas Method
  • The method takes advantage of the bandedness of
    the matrix.
  • The technique uses a two phase process.
  • The first phase is to obtain the coefficients
    from the sweep.
  • The second phase solves for the x values.

13
Thomas Method
  • The first phase starts with the first row of
    coefficients scales the a and r coefficients.
  • The second phase solves for x values using the a
    and r coefficients.

14
Thomas Method
  • The program for the method is given as
    demoThomas(a,d,b,r)
  • The algorithm is from the textbook, where a,d,b,
    r are vectors from the matrix.

15
Chapter 4Iterative Techniques
16
Iterative Techniques
  • The method of solving simultaneous linear
    algebraic equations using Gaussian Elimination
    and the Gauss-Jordan Method. These techniques
    are known as direct methods. Problems can arise
    from round-off errors and zero on the diagonal.
  • One means of obtaining an approximate solution to
    the equations is to use an educated guess.

17
Iterative Methods
  • We will look at three iterative methods
  • Jacobi Method
  • Gauss-Seidel Method
  • Successive over Relaxation (SOR)

18
Convergence Restrictions
  • There are two conditions for the iterative method
    to converge.
  • Necessary that 1 coefficient in each equation is
    dominate.
  • The sufficient condition is that the diagonal is
    dominate.

19
Jacobi Iteration
  • If the diagonal is dominant, the matrix can be
    rewritten in the following form

20
Jacobi Iteration
  • The technique can be rewritten in a shorthand
    fashion, where D is the diagonal, A is the
    matrix without the diagonal and c is the
    right-hand side of the equations.

21
Jacobi Iteration
  • If the diagonal is dominant, the matrix can be
    rewritten in the following form

22
Jacobi Iteration
  • The technique can be rewritten in a shorthand
    fashion, where D is the diagonal, A is the
    matrix without the diagonal and c is the
    right-hand side of the equations.

23
Jacobi Iteration
  • The technique solves for the entire set of x
    values for each iteration.
  • The problem does not update the values until an
    iteration is completed.

24
Example 1(Jacobi Example)
  • 4X1 - 2X2 3
  • - X1 5X2 -2

25
Example (Jacobi Iteration)
  • 4X1 2X2 2
  • 2X1 10X2 4X3 6
  • 4X2 5X3 5
  • Solution (X1 , X2 , X3 ) (0.41379, 0.17241,
    0.86206)

26
Jacobi Example
27
Jacobi Example
28
Jacobi Example
  • Formulation of the matrix

29
Jacobi Iteration
  • Iteration 1 2 3 4 5 6 7
  • X 1 0.5 0.2 0.45 0.324 0.429 0.376 0.42
  • X 2 0.6 0.1 0.352 0.142 0.248 0.16 0.204
  • X 3 1 0.52 0.92 0.718 0.886 0.802 0.872

30
Jacobi Program
  • The computer program is setup to do the Jacobi
    method for any size square matrix
  • Jacobi(A,b)
  • The program can has options for maximum number of
    iterations, nmax, and tolerance, tol.
  • Jacobi(A,b,nmax,tol)

31
Summary
  • Gauss-Jordan method is more computational intense
    and does not improve the round-off errors.
    However, it is useful for finding matrix
    inverses.
  • Banded matrix solvers are faster and use less
    memory.
  • Convergence conditions need to be met in-order
    for iterative techniques to converge
  • Jacobi method upgrades the values after each
    iteration

32
Homework
  • Check the Homework webpage
Write a Comment
User Comments (0)
About PowerShow.com