iterative methods for the solution

Post on 20-Nov-2014

645 Views

Category:

Documents

2 Downloads

Preview:

Click to see full reader

DESCRIPTION

 

TRANSCRIPT

OSCAR EDUARDO MENDIVELSO OROZCO I study Petroleum Engineering Numerical Methods

ITERATIVE METHODS FOR THE SOLUTION

OF SYSTEM OF LINEAR EQUATIONS

JACOBI METHOD

*The Jacobi method is the iterative method for solving systems of linear equations more simple and applies only square systems, ie systems with as many unknowns as equations.

1. First, we determine the equation of recurrence. For this order the equations and unknowns. Of the equation i cleared the unknown i. In matrix notation is written as:

where x is the vector of unknowns.

2. It takes an approach to the solutions and this is designated by

3.  

Example:

From (x = 1, y = 2) apply two iterations of the Jacobi method to solve the system:

Solution:

We must first solve the equation for the unknown

x= 0.20+0.00x-0.40y

y= 0.00+0.25x+0.00y

Written in vector notation would be:

We apply the first iteration starting from =1.00 y :

0.20 + 0.00 (1.00) - 0.40 (2.00) = -0.60

0.00 + 0.25 (1.00) + 0.00 (2.00) = 0.25

We apply the second iteration starting from = -0.60 y=0.25

0.20 + 0.00 (-0.60) - 0.40 (0.25) = 0.10

0.00 + 0.25 (−0.60) +0.00 (0.25) = −0.15

We apply the next iteration from 0.10 y =0.25:

0.20 + 0.00 (0.10) - 0.40 (-0.15) = 0.26

0.00 +0.25 (0.10) +0.00 (−0.15) = 0.025

We apply the next iteration from 0.26 y =0.025:

0.20 + 0.00 (0.26) − 0.40 (0.025) = 0.190

0.00 + 0.25 (0.26) + 0.00 (0.025) = 0.065

We apply the next iteration from 0.190 y =0.065:

0.20 + 0.00 (0.19) − 0.40 (0.065) = 0.174

0.00 + 0.25 (0.19) + 0.00 (0.065) = 0.0475

We apply the next iteration from 0.174 y =0.0475:

0.20 + 0.00 (0.174) − 0.40 (0.0475) = 0.181

0.00 + 0.25 (0.174) + 0.00 (0.0475) = 0.0435

Where

THE GAUSS-SEIDEL METHOD

*The Gauss-Seidel method is very similar to the method of Jacobi. While using the Jacobi the value of the unknowns to determine a new approach in the Gauss-Seidel is using values of the unknowns recently calculated in the same iteration, and not the next.

* For example, Jacobi method is obtained in the first calculation +1, But the value of x is not used until the next iteration. In the Gauss-Seidel method instead of is used i +1 instead of immediately to calculate the value of equally applicable to the following variables are used whenever newly calculated variables.

Example: From (x = 1, y = 2, z = 0) apply two iterations of Gauss-Seidel method to solve the system:

Solution:

We must first solve the equation for the unknown.

x = −0.10 + 0.00 x + 0.00 y + 0.10 z

y = 0.66 − 0.33 x + 0.00 y + 0.33 z

z = 0.40 − 0.40 x − 0.40 y + 0.00 z

We apply the first iteration starting from =1.00,

x1 = −0.10 + 0.00 (1.00) + 0.00 (2.00) + 0.10 (0.00) = −0.1

y1 = 0.66 − 0.33 (−0.10) + 0.00 (2.00) + 0.33 (0.00) = 0.70

z1 = 0.40 − 0.40 (−0.10) − 0.40 (0.70) + 0.00 (0.00) = 0.16We apply the second iteration starting from = -0.10,=0.70 y =0.16:

x1 = −0.10 + 0.00(−0.10) + 0.00 (0.70) + 0.10 (0.16) = −0.084

y1 = 0.66 − 0.33(−0.084) + 0.00 (0.70) + 0.33 (0.16) = 0.748

z1 = 0.40 − 0.40(−0.084) − 0.40 (0.748) + 0.00 (0.16) = 0.134 We apply the third iteration starting from = -0.084,=0.748 y =0.134:

x1 = −0.10 +0.00(−0.084) +0.00(0.748) +0.10 (0.134) = −0.086

y1 = 0.66 − 0.33(−0.086) + 0.00 (0.748) + 0.33 (0.134) = 0.740

z1 = 0.40 − 0.40(−0.086) − 0.40 (0.740) + 0.00 (0.134) = 0.138

Computational costIt is difficult to estimate the computational cost of an iterative method, it is not known beforehand how many iterations required to obtain an answer that satisfies the user. Usually proceed to calculate computational cost per iteration. In the case of the Jacobi method used the recurrence relation is:

It is difficult to estimate the computational cost involved: the product of the matrix B, n × n by the vector takes n × (2n-1) FLOPs, and the sum of two vectors in with n FLOPs making which gives a total of 2 FLOPs at each iteration of the Jacobi method.

*Using this information we can conclude that if the algorithm takes m iterations then the total FLOPs shall be:

*That is why the Jacobi method is preferred in problems where n is large, when you can ensure convergence and when the expected number of iterations is low.

REFERENCES

http://www.mty.itesm.mx/etie/deptos/m/ma95-843/lecturas/l843-13.pdf

top related