chapter 12 iterative methods
play

Chapter 12: Iterative Methods ES 240: Scientific and Engineering - PowerPoint PPT Presentation

ES 240: Scientific and Engineering Computation. Iterative Methods and Eigenvalues Uchechukwu Ofoegbu Temple University Chapter 12: Iterative Methods ES 240: Scientific and Engineering Computation. Iterative Methods and Eigenvalues Gauss-


  1. ES 240: Scientific and Engineering Computation. Iterative Methods and Eigenvalues Uchechukwu Ofoegbu Temple University Chapter 12: Iterative Methods

  2. ES 240: Scientific and Engineering Computation. Iterative Methods and Eigenvalues Gauss- -Seidel Method Seidel Method Gauss � The Gauss-Seidel method is the most commonly used iterative method for solving linear algebraic equations [ A ]{ x }={ b }. � The method solves each equation in a system for a particular variable, and then uses that value in later equations to solve later variables. For a 3x3 system with nonzero elements along the diagonal, for example, the j th iteration values are found from the j -1 th iteration using: j − 1 − a 13 x 3 j − 1 j = b 1 − a 12 x 2 x 1 a 11 j − a 23 x 3 j = b 2 − a 21 x 1 j − 1 x 2 a 22 j − a 32 x 2 j = b 3 − a 31 x 1 j x 3 a 33

  3. ES 240: Scientific and Engineering Computation. Iterative Methods and Eigenvalues Gauss- -Seidel Method Seidel Method Gauss � The Gauss-Seidel method is the most commonly used iterative method for solving linear algebraic equations [ A ]{ x }={ b }. � The method solves each equation in a system for a particular variable, and then uses that value in later equations to solve later variables. For a 3x3 system with nonzero elements along the diagonal, for example, the j th iteration values are found from the j -1 th iteration using: + + = = − − a x a x a x c x ( c a x a x ) / a 11 1 12 2 13 3 1 1 1 12 2 13 3 11 + + = = − − a x a x a x c x ( c a x a x ) / a 21 1 22 2 23 3 2 2 2 21 1 23 3 22 + + = = − − a x a x a x c x ( c a x a x ) / a 31 1 32 2 33 3 3 3 3 31 1 32 2 33

  4. ES 240: Scientific and Engineering Computation. Iterative Methods and Eigenvalues Applying the Gauss- -Seidel Method Seidel Method Applying the Gauss 1. Select an initial guess: 0 0 0 [ x , x , x ] 2 3 1 2. Update each variable = − − x ( c a x a x ) / a 1 1 12 2 13 3 11 = − − x ( c a x a x ) / a 2 2 21 1 23 3 22 = − − x ( c a x a x ) / a 3 3 31 1 32 2 33 3. Continue to update the variables 4. Stop when the tolerance is met − − ( t ) ( t 1 ) x x ε = < ε i i 100 % a , i s ( t ) x i

  5. ES 240: Scientific and Engineering Computation. Iterative Methods and Eigenvalues Convergence Convergence 1. Sometimes this method diverges 2. If the magnitude of each diagonal term is greater than the sum of the magnitudes of the other terms in the same row, the method will certainly converge n ∑ ≥ a a ii ij = ≠ i 1 , j i 3. Rows could be rearranged to ensure convergence 4. Sometimes convergence is attained even when the condition is not met

  6. ES 240: Scientific and Engineering Computation. Iterative Methods and Eigenvalues Example Example Solve the following using the Gauss Seidel method + − = x 8 x x 11 1 2 3 − + = 10 x 2 x 3 x 15 1 2 3 − + = − 2 x 3 x 15 x 14 1 2 3 Now use the GaussSeidel function

  7. ES 240: Scientific and Engineering Computation. Iterative Methods and Eigenvalues Jacobi Iteration Jacobi Iteration � The Jacobi iteration is similar to the Gauss- Seidel method, except the j-1th information is used to update all variables in the jth iteration: a) Gauss-Seidel b) Jacobi

  8. ES 240: Scientific and Engineering Computation. Iterative Methods and Eigenvalues Example Example Solve the following using the Jacobi Iteration method + − = x 8 x x 11 1 2 3 − + = 10 x 2 x 3 x 15 1 2 3 − + = − 2 x 3 x 15 x 14 1 2 3 Compare with GaussSeidel

  9. ES 240: Scientific and Engineering Computation. Iterative Methods and Eigenvalues Eigenvalues and Eigenvectors and Eigenvectors Eigenvalues � Nonhomogeneous system: [A]{x} = {b} � Homogeneous system: [A]{x} = 0 � Nontrivial solutions exist but are not unique � The solution of A satisfies the eigenvalue equation: Ax= λ x � [A- λ I] x = 0 λ = eigenvalue of A � � x = eigenvector of A � Nontrivial solutions exist iff characteristic polynomial, det(A - λ I) = 0 � The size of A determines the number of eigenvalues

  10. ES 240: Scientific and Engineering Computation. Iterative Methods and Eigenvalues Polynomial method for eigenvalues eigenvalues Polynomial method for � Root of the characteristic polynomial = λ – Example: x + 2x = 0 3x + 4x = 0 ⎡ ⎤ 1 3 • A = ⎢ ⎥ ⎣ ⎦ 3 4 − λ ⎡ ⎤ 1 3 • Characteristic poly = f( λ ) = det = λ − λ − 2 5 5 ⎢ ⎥ − λ ⎣ ⎦ 3 4 • roots of f( λ ) = -0.8541, 5.8541 � In Matlab: p = ploy(A); e = roots(p)

  11. ES 240: Scientific and Engineering Computation. Iterative Methods and Eigenvalues Power method for eigenvalues eigenvalues and eigenvectors and eigenvectors Power method for � Iterative method � Determines the largest eigenvalue most of the time � Method – Set Ax = λ x – Choose initial value for x – Factor out highest element as λ – Continue until desired accuracy – Example: ⎡ ⎤ 1 3 • A = ⎢ ⎥ ⎣ ⎦ 3 4

  12. ES 240: Scientific and Engineering Computation. Iterative Methods and Eigenvalues Matlab eigenvalues eigenvalues and eigenvectors and eigenvectors Matlab � Eig(A) � [v e] = eig(A) � How would you find the minimum eigenvalue using the power method?

  13. ES 240: Scientific and Engineering Computation. Iterative Methods and Eigenvalues Lab Lab � Problem 12.2, 12.3 � Use the power method to find the minimum eigenvalue of the matrix � B = [1 2; 2 2];

Recommend


More recommend