290 likes | 310 Views
Linear Systems. Numerical Methods. Jacobi Iterative Method. Iterative methods provide an alternative to the elimination methods. Choose an initial guess (i.e. all zeros) and Iterate until the equality is satisfied. No guarantee for convergence! Each iteration takes O(n 2 ) time!.
E N D
Linear Systems Numerical Methods
Jacobi Iterative Method Iterative methods provide an alternative to the elimination methods. Choose an initial guess (i.e. all zeros) and Iterate until the equality is satisfied. No guarantee for convergence! Each iteration takes O(n2) time!
Gauss-Seidel • Iterative or approximate methods provide an alternative to the elimination methods. The Gauss-Seidel method is the most commonly used iterative method. • The system [A]{X}={B} is reshaped by solving the first equation for x1, the second equation for x2, and the third for x3, …and nth equation for xn. For conciseness, we will limit ourselves to a 3x3 set of equations.
**here Gauss-Seidel • The Gauss-Seidel method is a commonly used iterative method. • It is same as Jacobi technique except with one important difference: A newly computed x value (say xk) is substituted in the subsequent equations (equations k+1, k+2, …, n) in the same iteration. Example: Consider the 3x3 system below: • First, choose initial guesses for the x’s. • A simple way to obtain initial guesses is to assume that they are all zero. • Compute new x1using the previous iteration values. • New x1is substituted in the equations to calculate x2 and x3 • The process is repeated for x2, x3, …
Now we can start the solution process by choosing guesses for the x’s. A simple way to obtain initial guesses is to assume that they are zero. These zeros can be substituted into x1equation to calculate a new x1=b1/a11.
New x1 is substituted to calculate x2 and x3. The procedure is repeated until the convergence criterion is satisfied: For all i, where j and j-1 are the present and previous iterations.
Convergence Criterion for Gauss-Seidel Method • The Gauss-Seidel method has two fundamental problems as any iterative method: • It is sometimes nonconvergent, and • If it converges, converges very slowly. • Recalling that sufficient conditions for convergence of two linear equations, u(x,y) and v(x,y) are
Similarly, in case of two simultaneous equations, the Gauss-Seidel algorithm can be expressed as
Substitution into convergence criterion of two linear equations yield: • In other words, the absolute values of the slopes must be less than unity for convergence: Chapter 11
Gauss-Seidel Method: Example 1 The upward velocity of a rocket is given at three different times Table 1 Velocity vs. Time data. The velocity data is approximated by a polynomial as: http://numericalmethods.eng.usf.edu
Gauss-Seidel Method: Example 1 Using a Matrix template of the form The system of equations becomes Initial Guess: Assume an initial guess of
Gauss-Seidel Method: Example 1 Rewriting each equation
Gauss-Seidel Method: Example 1 Applying the initial guess and solving for ai Initial Guess When solving for a2, how many of the initial guess values were used?
Gauss-Seidel Method: Example 1 Finding the absolute relative approximate error At the end of the first iteration The maximum absolute relative approximate error is 125.47%
Gauss-Seidel Method: Example 1 Iteration #2 Using the values of ai are found: from iteration #1
Gauss-Seidel Method: Example 1 Finding the absolute relative approximate error At the end of the second iteration The maximum absolute relative approximate error is 85.695%
Gauss-Seidel Method: Example 1 Repeating more iterations, the following values are obtained Notice – The relative errors are not decreasing at any significant rate Also, the solution is not converging to the true solution of
Gauss-Seidel Method: Example 2 Given the system of equations The coefficient matrix is: With an initial guess of Will the solution converge using the Gauss-Siedel method?
Gauss-Seidel Method: Example 2 Rewriting each equation With an initial guess of
Gauss-Seidel Method: Example 2 The absolute relative approximate error The maximum absolute relative error after the first iteration is 100%
Gauss-Seidel Method: Example 2 After Iteration #1 Substituting the x values into the equations After Iteration #2
Gauss-Seidel Method: Example 2 Iteration #2 absolute relative approximate error The maximum absolute relative error after the first iteration is 240.61% This is much larger than the maximum absolute relative error obtained in iteration #1. Is this a problem?
Gauss-Seidel Method: Example 2 Repeating more iterations, the following values are obtained The solution obtained is close to the exact solution of .
Gauss-Seidel Method: Example 3 Given the system of equations Rewriting the equations With an initial guess of
Gauss-Seidel Method: Example 3 Conducting six iterations, the following values are obtained The values are not converging. Does this mean that the Gauss-Seidel method cannot be used?
Gauss-Seidel Method Observe the set of equations
MATRIX INVERSE A. A-1 = I Solve in n=3 major steps 1 2 3 Solve each one using A=L.U method e.g.