24
Linear Equation Systems Iterative Methods

Linear Equation Systems Iterative Methods€¦ · Linear Equation Systems ‐Iterative Methods ... solution. •In these methods is necessary to have an initial value for the method

Embed Size (px)

Citation preview

Page 1: Linear Equation Systems Iterative Methods€¦ · Linear Equation Systems ‐Iterative Methods ... solution. •In these methods is necessary to have an initial value for the method

Linear Equation Systems‐Iterative Methods‐

Page 2: Linear Equation Systems Iterative Methods€¦ · Linear Equation Systems ‐Iterative Methods ... solution. •In these methods is necessary to have an initial value for the method

Content

• Iterative Methods• Jacobi Iterative Method• Gauss‐Seidel Iterative Method

Page 3: Linear Equation Systems Iterative Methods€¦ · Linear Equation Systems ‐Iterative Methods ... solution. •In these methods is necessary to have an initial value for the method

Iterative Methods

• Iterative methods are those that produce a sequence of successive approximations which, under specific conditions, converge to the true solution.

• In these methods is necessary to have an initial value for the method begins to iterate and also requires a convergence criterion for reaching settlement.

• Representative methods for this are:• Jacobi method• Gauss‐Seidel Method

Page 4: Linear Equation Systems Iterative Methods€¦ · Linear Equation Systems ‐Iterative Methods ... solution. •In these methods is necessary to have an initial value for the method

Jacobi Iterative Method

A system of  linear equations in  unknowns

can be solved by the Jacobi iterative methodwhen certain conditions are met.A sufficient but not necessary condition is the condition that guarantees convergence:

Page 5: Linear Equation Systems Iterative Methods€¦ · Linear Equation Systems ‐Iterative Methods ... solution. •In these methods is necessary to have an initial value for the method

Jacobi Iterative Method

Recursion formulas Jacobi method for  equations with  unknowns are:

If the convergence condition is satisfied then the recursion formulas for Jacobi generate a sequence of successive approximations that converge to the exact solution of the system, starting with an arbitrary approximation 

, , , … , .Since the convergence condition is not necessary, this condition can not be satisfied and the method never converge.

Page 6: Linear Equation Systems Iterative Methods€¦ · Linear Equation Systems ‐Iterative Methods ... solution. •In these methods is necessary to have an initial value for the method

Jacobi Iterative Method

Example:• Consider the following system of linear equations with a convergence value of 0.1:

Page 7: Linear Equation Systems Iterative Methods€¦ · Linear Equation Systems ‐Iterative Methods ... solution. •In these methods is necessary to have an initial value for the method

Jacobi Iterative Method

• Note that the order of the equations has been selected so that the main diagonal coefficients predominate over the coefficient off‐diagonal.

• Since the diagonal elements are non‐zero, we can express the variable in the  th equation in terms of the remaining variables and 

constant.• The result can be expressed in recursion formula as follows:

Page 8: Linear Equation Systems Iterative Methods€¦ · Linear Equation Systems ‐Iterative Methods ... solution. •In these methods is necessary to have an initial value for the method

Jacobi Iterative Method

• This system of equations we can write in matrix form:

• The first iteration of the solution are given below, starting with , , , … , , , as initial approximate solution:

Page 9: Linear Equation Systems Iterative Methods€¦ · Linear Equation Systems ‐Iterative Methods ... solution. •In these methods is necessary to have an initial value for the method

Jacobi Iterative Method

• Evaluate convergence

Page 10: Linear Equation Systems Iterative Methods€¦ · Linear Equation Systems ‐Iterative Methods ... solution. •In these methods is necessary to have an initial value for the method

Jacobi Iterative Method

• Evaluate convergence

Page 11: Linear Equation Systems Iterative Methods€¦ · Linear Equation Systems ‐Iterative Methods ... solution. •In these methods is necessary to have an initial value for the method

Jacobi Iterative Method

• Evaluate convergence

Page 12: Linear Equation Systems Iterative Methods€¦ · Linear Equation Systems ‐Iterative Methods ... solution. •In these methods is necessary to have an initial value for the method

Jacobi Iterative Method

• Evaluate convergence

• If we continue in this way, the approach  , , will converge to the exact solution (3, 2, 1)

Page 13: Linear Equation Systems Iterative Methods€¦ · Linear Equation Systems ‐Iterative Methods ... solution. •In these methods is necessary to have an initial value for the method

Gauss‐Seidel Iterative Method

• This iterative method for solving a system of linear equations is a simple modification of the method of Jacobi.

• If the recursion formulas are changed so that every time the value is calculated, it is used for calculations of  , , … , , 

then we obtain the following recursion formulas for Gauss‐Sidel:

Page 14: Linear Equation Systems Iterative Methods€¦ · Linear Equation Systems ‐Iterative Methods ... solution. •In these methods is necessary to have an initial value for the method

Gauss‐Seidel Iterative Method

• A sufficient but not necessary condition for converging the Gauss‐Seidel is:

• Note that the condition is the same as the Jacobi method, however, for a rough initial solution, the Gauss‐Seidel method can converge to a true solution while the Jacobi method does not, and vice versa.

• Shown that the Gauss‐Seidel method is twice the rate of convergence of Jacobi.

Page 15: Linear Equation Systems Iterative Methods€¦ · Linear Equation Systems ‐Iterative Methods ... solution. •In these methods is necessary to have an initial value for the method

Recursion Formulas

Jacobi Method• For this method apply matrix multiplication and matrix addition.

1. Input:  , number of equations;  , maximum number of iterations;  , convergence criterion;  , coefficients matrix;  , constants matrix.

2. Divide the row  of the matrices  and  between  ; ; , ; ,

3. Initialize iteration counter  . Match zero matrix  :  . ,

4. Multiply the matrix  by  and add the matrix  for 

Page 16: Linear Equation Systems Iterative Methods€¦ · Linear Equation Systems ‐Iterative Methods ... solution. •In these methods is necessary to have an initial value for the method

Recursion Formulas

5. Evaluate convergence:a) If any of  , go to step 6b) If all  , go to step 7

6. Evaluate the iteration counter:a) If  , increase  to 1 and return to step 4b) If  , go to step 8

7. Exit for convergence. Write the solutions: ,

8. Exit. Writing "The program could not converge on  iterations."

Page 17: Linear Equation Systems Iterative Methods€¦ · Linear Equation Systems ‐Iterative Methods ... solution. •In these methods is necessary to have an initial value for the method

Recursion Formulas

Gauss‐Seidel method1. Input:  , number of equations;  , maximum number of iterations;  , 

convergence criterion; augmented matrix  , .2. Divide the row  of the matrix  , between 

; ; , ; ,

3. Initialize the iteration counter  . Initialize values of. ,

4. Calculate the successive iterations  using the following computational formula:

, ; ,

Page 18: Linear Equation Systems Iterative Methods€¦ · Linear Equation Systems ‐Iterative Methods ... solution. •In these methods is necessary to have an initial value for the method

Recursion Formulas

5. Evaluate convergence:a) If any of  , go to step 6b) If all  , go to step 7

6. Evaluate the iteration counter:a) If  , increase  to 1 and return to step 4b) If  , go to step 8

7. Exit for convergence. Write the solutions: ,

8. Exit. Writing "The program could not converge on  iterations."

Page 19: Linear Equation Systems Iterative Methods€¦ · Linear Equation Systems ‐Iterative Methods ... solution. •In these methods is necessary to have an initial value for the method
Page 20: Linear Equation Systems Iterative Methods€¦ · Linear Equation Systems ‐Iterative Methods ... solution. •In these methods is necessary to have an initial value for the method
Page 21: Linear Equation Systems Iterative Methods€¦ · Linear Equation Systems ‐Iterative Methods ... solution. •In these methods is necessary to have an initial value for the method

Homework 3 (Individual)

1. Solve the following system of linear equations manually for each of the following methods:a) Inverse matrixb) Cramer’s Rulec) Gauss‐Jordan Methodd) Montante Method

3 5 6 72 4 3 174 6 2 4

The solution of the system of equations is (2, 1, ‐3)

Page 22: Linear Equation Systems Iterative Methods€¦ · Linear Equation Systems ‐Iterative Methods ... solution. •In these methods is necessary to have an initial value for the method

Homework 3 (Individual)

2. Solve the following system of linear equations manually for each of the following methods, taking as initial values  0, 0, 0 . You can make use of a table in Excel:a) Jacobi Method (convergence error 0.1)b) Gauss‐Seidel Method (convergence error 0.01)

3 132 7 21

4 6 5The solution of the system of equations is (3, 2, 1)

Page 23: Linear Equation Systems Iterative Methods€¦ · Linear Equation Systems ‐Iterative Methods ... solution. •In these methods is necessary to have an initial value for the method

Computer Program 2 (by team)

• Submit a computer program to solve a system of  linear equations with unknowns, for each of the following methods:a) Inverse Matrixb) Cramer’s Rulec) Method of Gauss‐Jordand) Montante Methode) Jacobi Methodf) Gauss‐Seidel Method

• Hand over:• Computational algorithm (printed)• Source Code (printed and file)• Executable (file)

Page 24: Linear Equation Systems Iterative Methods€¦ · Linear Equation Systems ‐Iterative Methods ... solution. •In these methods is necessary to have an initial value for the method

Linear Equation Systems‐Iterative Methods‐