0
Upcoming SlideShare
×

Thanks for flagging this SlideShare!

Oops! An error has occurred.

×
Saving this for later? Get the SlideShare app to save on your phone or tablet. Read anywhere, anytime – even offline.
Standard text messaging rates apply

# Iterative methods for the solution

1,333

Published on

1 Like
Statistics
Notes
• Full Name
Comment goes here.

Are you sure you want to Yes No
• Be the first to comment

Views
Total Views
1,333
On Slideshare
0
From Embeds
0
Number of Embeds
0
Actions
Shares
0
19
0
Likes
1
Embeds 0
No embeds

No notes for slide

### Transcript

• 1. ITERATIVE METHODS FOR THE SOLUTION OF SYSTEM OF LINEAR EQUATIONS<br />OSCAR EDUARDO MENDIVELSO OROZCO<br />I studyPetroleumEngineering<br /> Numerical Methods <br />
• 2. JACOBI METHOD<br />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.<br />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:<br />𝒙=𝒄+𝑩𝒙<br /> where x is the vector of unknowns.<br /> <br />
• 3. 2.It takes an approach to the solutions and this is designated by 𝒙𝒐<br />3. Is iterated in the cycle that changes the approach  𝒙𝒊+𝟏=𝒄+𝑩𝒙𝒊<br /> <br />
• 4. Example:<br />From (x = 1, y = 2) apply two iterations of the Jacobi method to solve the system:                                𝟓𝒙 +𝟐𝒚  =𝟏𝒙    −𝟒𝒚  =𝟎<br />Solution:<br />We must first solve the equation for the unknown<br />x= 0.20+0.00x-0.40y<br /> y= 0.00+0.25x+0.00y<br />Written in vector notation would be:<br />𝑥𝑦=0.200.00+0.00−0.400.250.00𝑥𝑦<br /> <br />
• 5. We apply the first iteration starting from𝑥0=1.00 y 𝑦0=2.00:<br />𝑥1=0.20 + 0.00 (1.00) - 0.40 (2.00) = -0.60<br />𝑦1=0.00 + 0.25 (1.00) + 0.00 (2.00) = 0.25<br />We apply the second iteration starting from 𝑥1= -0.60 y 𝑦1=0.25 <br />𝑥2= 0.20 + 0.00 (-0.60) - 0.40 (0.25) = 0.10<br />𝑦2=0.00 + 0.25 (−0.60) +0.00 (0.25) = −0.15<br />We apply the next iteration from 𝑥2= 0.10 y 𝑦1=0.25:<br />𝑥3= 0.20 + 0.00 (0.10) - 0.40 (-0.15) = 0.26<br />𝑦3= 0.00 +0.25 (0.10) +0.00 (−0.15) = 0.025<br />We apply the next iteration from 𝑥3=0.26 y 𝑦3=0.025:<br />𝑥4=0.20 + 0.00 (0.26) − 0.40 (0.025) = 0.190<br />𝑦4=0.00 + 0.25 (0.26) + 0.00 (0.025) = 0.065<br /> <br />
• 6. We apply the next iteration from 𝑥4=0.190 y 𝑦4=0.065:<br />𝑥5=0.20 + 0.00 (0.19) − 0.40 (0.065) = 0.174<br />𝑦5=0.00 + 0.25 (0.19) + 0.00 (0.065) = 0.0475<br /> We apply the next iteration from 𝑥5=0.174 y 𝑦4=0.0475:<br />𝑥6=0.20 + 0.00 (0.174) − 0.40 (0.0475) = 0.181<br />𝑦6=0.00 + 0.25 (0.174) + 0.00 (0.0475) = 0.0435<br />Where<br /> <br />
• 7.
• 8. THE GAUSS-SEIDEL METHOD<br />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.<br />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 𝑥𝑖+1is used i +1 instead of 𝑥𝑖 immediatelyto calculate the value of 𝑦𝑖+1  equally applicable to the following variables are used whenever newly calculated variables.<br /> <br />
• 9. Example: From (x = 1, y = 2, z = 0) apply two iterations of Gauss-Seidel method to solve the system:<br />10𝑥+0𝑦   +𝑧   =−14𝑥   +12𝑦 +4𝑧  =  84𝑥   +4𝑦    +10𝑧 = 4<br />Solution:<br />We must first solve the equation for the unknown.<br />x = −0.10 + 0.00 x + 0.00 y + 0.10 z<br /> y = 0.66 − 0.33 x + 0.00 y + 0.33 z<br />z = 0.40 −0.40 x − 0.40 y + 0.00 z<br /> <br />
• 10. We apply the first iteration starting from𝑥0=1.00, 𝑦0=2.00 𝑦 𝑧=0.00:<br />x1 = −0.10 + 0.00 (1.00) + 0.00 (2.00) + 0.10 (0.00) = −0.1<br /> y1 = 0.66 − 0.33 (−0.10) + 0.00 (2.00) + 0.33 (0.00) = 0.70<br />z1 = 0.40 − 0.40(−0.10) − 0.40 (0.70) + 0.00 (0.00) = 0.16<br />We apply the second iteration starting from 𝑥1= -0.10, 𝑦1=0.70 y 𝑧1=0.16:<br />x1 = −0.10 + 0.00(−0.10) + 0.00 (0.70) + 0.10 (0.16) = −0.084<br />y1 = 0.66 − 0.33(−0.084) + 0.00 (0.70) + 0.33 (0.16) = 0.748<br />z1 = 0.40 − 0.40(−0.084) − 0.40 (0.748) + 0.00 (0.16) = 0.134<br />We apply the third iteration starting from 𝑥1= -0.084,  𝑦1=0.748 y 𝑧1=0.134:<br />x1 = −0.10 +0.00(−0.084) +0.00(0.748) +0.10 (0.134) = −0.086<br /> y1 = 0.66 − 0.33(−0.086) + 0.00 (0.748) + 0.33 (0.134) = 0.740<br />z1 = 0.40 − 0.40(−0.086) − 0.40 (0.740) + 0.00 (0.134) = 0.138<br /> <br />
• 11. Computationalcost<br />It 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:<br />𝒙𝒊+𝟏=𝐜+𝑩𝒙𝒊<br />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𝑛2 FLOPs at each iteration of the Jacobi method. <br /> <br />
• 12. Using this information we can conclude that if the algorithm takes m iterations then the total FLOPs shall be:<br />2𝑚𝑛2<br />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.<br />REFERENCES<br />http://www.mty.itesm.mx/etie/deptos/m/ma95-843/lecturas/l843-13.pdf<br /> <br />