160 likes | 448 Views
Chapter 12: Iterative Methods. Uchechukwu Ofoegbu Temple University. Gauss-Seidel Method. The Gauss-Seidel method is the most commonly used iterative method for solving linear algebraic equations [ A ]{ x }={ b }.
E N D
Chapter 12: Iterative Methods Uchechukwu Ofoegbu Temple University
Gauss-Seidel Method • 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 jth iteration values are found from the j-1th iteration using:
Gauss-Seidel Method • 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 jth iteration values are found from the j-1th iteration using:
Applying the Gauss-Seidel Method • Select an initial guess: • Update each variable • Continue to update the variables • Stop when the tolerance is met
Convergence • Sometimes this method diverges • 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 • Rows could be rearranged to ensure convergence • Sometimes convergence is attained even when the condition is not met
Example Solve the following using the Gauss Seidel method Now use the GaussSeidel function
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: • Gauss-Seidel • Jacobi
Example Solve the following using the Jacobi Iteration method Compare with GaussSeidel
Eigenvalues and Eigenvectors • Nonhomogeneous system: [A]{x} = {b} • Homogeneous system: [A]{x} = 0 • Nontrivial solutions exist but are not unique • Thesolutionof 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
Polynomial method for eigenvalues • Root of the characteristic polynomial = λ • Example: x + 2x = 0 3x + 4x = 0 • A = • Characteristic poly = f(λ) = det = • roots of f(λ) = -0.8541, 5.8541 • In Matlab: p = ploy(A); e = roots(p)
Power method for eigenvalues and eigenvectors • 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: • A =
Matlab eigenvalues and eigenvectors • Eig(A) • [v e] = eig(A) • How would you find the minimum eigenvalue using the power method?
Lab • Problem 12.2, 12.3 • Use the power method to find the minimum eigenvalue of the matrix • B = [1 2; 2 2];