1 / 42

Today’s class

Today’s class. Briefly summarize the first two parts Error analysis Roots of equation Linear Algebraic Equations Gauss Elimination. Error Analysis. Round-off errors are caused because exact numbers cannot be expressed in a fixed number of digits as with computer representations

chuong
Download Presentation

Today’s class

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Today’s class • Briefly summarize the first two parts • Error analysis • Roots of equation • Linear Algebraic Equations • Gauss Elimination Prof. Jinbo Bi CSE, UConn

  2. Error Analysis • Round-off errors are caused because exact numbers cannot be expressed in a fixed number of digits as with computer representations • Round-off errors occurs from imprecision in representation of data • Truncation errors result from a numerical approximation in place of an exact analytical formula • Finite divided difference, Infinite series Prof. Jinbo Bi CSE, UConn

  3. Roots of equations • Bisection • 2 initial guesses, slow convergence, will notdiverge • False-position • 2 initial guesses, slow-medium convergence,will not diverge Prof. Jinbo Bi CSE, UConn

  4. Roots of equations • Newton-Raphson • 1 initial guess, fast convergence, maydiverge • Secant • 2 initial guesses, medium-fast convergence, may diverge Prof. Jinbo Bi CSE, UConn

  5. Roots of equations • Muller • 3 initial guesses, medium-fast convergence,may diverge, only polynomials, complexroots • Bairstow • 2 initial guesses, medium-fast convergence,may diverge, only polynomials, complex roots Prof. Jinbo Bi CSE, UConn

  6. Linear Algebraic Equations • Solving for roots gave us solutions to equations of the form: • A more general problem would be to solve the following n equations simultaneously Prof. Jinbo Bi CSE, UConn 6

  7. Linear Algebraic Equations • A linear algebraic system is a system of equations where all the functions are linear Prof. Jinbo Bi CSE, UConn

  8. Linear Algebraic Equations • Graphical solutions • Plot the functions and the solution is the intersection point of the functions • For two dimensional linear systems, each equation is a line • For three dimensional linear systems each equation is a plane Prof. Jinbo Bi CSE, UConn

  9. Linear Algebraic Equations • Example: Prof. Jinbo Bi CSE, UConn

  10. Linear Algebraic Equations • Singular system (no solution) Prof. Jinbo Bi CSE, UConn

  11. Linear Algebraic Equations • Singular system (infinite solutions) Prof. Jinbo Bi CSE, UConn

  12. Linear Algebraic Equations • Ill-conditioned system Prof. Jinbo Bi CSE, UConn

  13. Linear Algebraic Equations • Graphical methods work only for second and maybe third order systems • Not precise • Useful visualization tool Prof. Jinbo Bi CSE, UConn

  14. Linear Algebraic Equations • In matrix form • where A is a n x n matrix, and X and B are n x 1 vectors. Prof. Jinbo Bi CSE, UConn

  15. Matrices • Definitions: • Symmetric matrix • Diagonal matrix • Identity matrix (I) Prof. Jinbo Bi CSE, UConn

  16. Matrices • Definitions: • Upper triangular • Lower triangular • Banded • Transpose Prof. Jinbo Bi CSE, UConn

  17. Matrix Operations • Addition • Subtraction • Multiplication Prof. Jinbo Bi CSE, UConn

  18. Matrix operations • Addition/Subtraction - O(n2) • Multiplication - O(n3) Prof. Jinbo Bi CSE, UConn

  19. Inverse Matrices • If A is non-singular and square, then A-1 is the inverse such that Prof. Jinbo Bi CSE, UConn

  20. Linear algebraic equations • In matrix form • where A is a n x n matrix, and X and B are n x 1 vectors. Prof. Jinbo Bi CSE, UConn

  21. Linear algebraic equations • We need to solve for X Prof. Jinbo Bi CSE, UConn

  22. Linear Equations • How do we get A-1? • It is non-trivial • Not very efficient if solved by hand • Usually use other methods to solve for X • Gauss Elimination • LU Decomposition Prof. Jinbo Bi CSE, UConn

  23. Determinants, Cramer’s Rule • Given a second-order matrix A, the determinant D is defined as follows: • Given a third-order matrix A, the determinant D is defined as follows: Prof. Jinbo Bi CSE, UConn

  24. Determinants, Cramer’s Rule • Using determinants to solve a linear system • Cramer’s rule • Replace a column of coefficients in matrix A with the B vector and find determinant Prof. Jinbo Bi CSE, UConn

  25. Cramer’s rule example Prof. Jinbo Bi CSE, UConn 25

  26. Gauss Elimination • Extension of elimination of unknowns as a systematic algorithm • Two steps • Elimination of unknowns • Back substitution Prof. Jinbo Bi CSE, UConn

  27. Gauss Elimination • Forward elimination • Eliminate x1 from row 2 • Multiply row 1 by a21/a11 Prof. Jinbo Bi CSE, UConn

  28. Gauss Elimination • Eliminate x1 from row 2 • Subtract row 1 from row 2 • Eliminate x1 from all other rows in the same way • Then eliminate x2 from rows 3 to n and so on Prof. Jinbo Bi CSE, UConn

  29. Gauss Elimination • Forward elimination • Back substitute to solve for x Prof. Jinbo Bi CSE, UConn

  30. Gauss Elimination • Back substitution • In general, Prof. Jinbo Bi CSE, UConn

  31. Gauss Elimination Prof. Jinbo Bi CSE, UConn

  32. Gauss elimination • Computational complexity • 2n3/3 + O(n2) • three orders of increase for every order of increase in n • Most of the effort is incurred in the elimination step Prof. Jinbo Bi CSE, UConn

  33. Gauss elimination • Things to worry about • Division by zero • Round-off error • Ill-conditioned system Prof. Jinbo Bi CSE, UConn

  34. Gauss elimination • Ill-conditioned system example Prof. Jinbo Bi CSE, UConn

  35. Gauss elimination • Ill-conditioned system example Prof. Jinbo Bi CSE, UConn

  36. Gauss elimination • If the determinant is close to zero, thesystem is ill-conditioned • If the determinant is exactly zero, thesystem is singular • It is difficult to specify how close to zero, as the magnitude of the determinantcan be changed by multiplying by a constant without changing the solution Prof. Jinbo Bi CSE, UConn

  37. Gauss elimination with pivoting • Basic idea is to remove divide by zero if a11 is zero • Swap the row with the largest element withthe top row Prof. Jinbo Bi CSE, UConn

  38. Gauss elimination with pivoting Prof. Jinbo Bi CSE, UConn

  39. Gauss elimination with pivoting Prof. Jinbo Bi CSE, UConn

  40. Gauss elimination with scaling • It is sometimes useful to scale the equations so that the largest coefficient in any row is 1 • Example Prof. Jinbo Bi CSE, UConn

  41. Gauss elimination with scaling • Example Prof. Jinbo Bi CSE, UConn

  42. Next class • LU Decomposition • Read Chapter 10 Prof. Jinbo Bi CSE, UConn

More Related