18
Name : (1) Kamal A khtar F .(120450119156) Branch: M echanical - 4C(1) Collage: S.V.M.I.T.

system of algebraic equation by Iteration method

Embed Size (px)

Citation preview

Page 1: system of algebraic equation by Iteration method

Name: (1) Kamal Akhtar F.(120450119156)Branch: Mechanical-4C(1)Collage: S.V.M.I.T.

Page 2: system of algebraic equation by Iteration method

Introduction…

O Iteration method:-

O Why iteration method is need?O When the system of algebraic equation consist of large

number of equation then the direct method becomes cumbersome and time consuming.

O In this case Iteration method provide easy tosolve the system.

O In Iteration method we start from initial approximation to the actual solution and obtain better and better approximation after repeating iteration.

O Iteration method gives the value to the desired accuracy.

Page 3: system of algebraic equation by Iteration method

Iteration method:-

O(1) Jacobi's methodO(2) Gauss-Seidel method

Page 4: system of algebraic equation by Iteration method

Jacobi's methodO A set of n equations and n unknowns:

O note: assume all the diagonal elements

are not zero.

11313212111 ... bxaxaxaxa nn

2n2n323222121 bxa...xaxaxa . .

. .

. .

nnnnnnn bxaxaxaxa ...332211

Page 5: system of algebraic equation by Iteration method

Jacobi's methodO If diagonal elements are zero then we

Rewrite the question as…

O 𝑥1 =[𝑏1− 𝑎11𝑥2+𝑎13𝑥3+⋯+𝑎1𝑛𝑥𝑛 ]

𝑎11

O 𝑥2 =[𝑏2− 𝑎21𝑥2+𝑎23𝑥3+⋯+𝑎2𝑛𝑥𝑛 ]

𝑎22

O 𝑥𝑛 =[𝑏𝑛− 𝑎𝑛1𝑥2+𝑎𝑛2𝑥2+⋯+𝑎𝑛(𝑛−1)𝑥𝑛−1 ]

𝑎𝑛𝑛

Page 6: system of algebraic equation by Iteration method

Jacobi's methodO Suppose that the initial solution is…

O 𝑥1(0), 𝑥2

(0), … , 𝑥𝑛(0) put this all value in the

above equation then we obtain the 1𝑠𝑡

approximation to solution as 𝑥1(1), 𝑥2

(1), … , 𝑥𝑛

(1).

O Against the put this value in above equation then we obtain the 2𝑛𝑑 approximation to solution as 𝑥1

(2), 𝑥2(2), … , 𝑥𝑛

(2).

O Continues the process of finding the approximation till get the solution is the desired level of accuracy.

Page 7: system of algebraic equation by Iteration method

Use the Jacobi method to approximate the solution of the following system of linear equations.

𝟓𝒙𝟏 − 𝟐𝒙𝟐+𝟑𝒙𝟑 = −𝟏−𝟑𝒙𝟏 + 𝟗𝒙𝟐+𝒙𝟑 = 𝟐𝟐𝒙𝟏 − 𝒙𝟐 − 𝟕𝒙𝟑 = 𝟑

Continue the iterations until two successive approximations are identical when rounded to three significant digits.

O Solution:--O 𝒙𝟏 = −

𝟏

𝟓+

𝟐

𝟓𝒙𝟐 −

𝟑

𝟓𝒙𝟑

O 𝒙𝟐 =𝟐

𝟗+

𝟑

𝟗𝒙𝟏 −

𝟏

𝟗𝒙𝟑

O 𝒙𝟑 = −𝟑

𝟕+

𝟐

𝟕𝒙𝟏 −

𝟏

𝟕𝒙𝟐

O Because we do not know the actual solution, chooseO 𝒙𝟏 = 𝟎, 𝒙𝟐 = 𝟎, 𝒙𝟑 = 𝟎…Initial approximationO as a convenient initial approximation. So, the first approximation is

O 𝒙𝟏 = −𝟏

𝟓+

𝟐

𝟓𝟎 −

𝟑

𝟓𝟎 ≈ −0.200

O 𝒙𝟐 =𝟐

𝟗+

𝟑

𝟗(𝟎) −

𝟏

𝟗(𝟎) ≈ 𝟎. 𝟐𝟐𝟐

O 𝒙𝟑 = −𝟑

𝟕+

𝟐

𝟕𝟎 −

𝟏

𝟕𝟎 ≈ −𝟎. 𝟒𝟐𝟗

Page 8: system of algebraic equation by Iteration method

Continuing this procedure, you obtain the sequence of approximations shown in Table

𝑛 𝑥1 𝑥2 𝑥3

0 0.000 0.000 0.000

1 -0.200 0.200 -0.429

2 0.146 0.203 -0.517

3 0.192 0.328 -0.416

4 0.181 0.332 -0.421

5 0.185 0.329 -0.424

6 0.186 0.331 -0.423

7 0.186 0.331 -0.423

Because the last two rows in Table are identical, you can conclude that

to three significant digits the solution is…

𝑥1=0.186𝑥2=0.331𝑥3= − 0.423

Page 9: system of algebraic equation by Iteration method

The Gauss-Seidel MethodO A modification of the Jacobi method called the Gauss-Seidel method.O This modification is no more difficult to use than the Jacobi method,

and it often requires fewer iterations to produce the same degree of accuracy.

O With the Jacobi method, the values of 𝒙𝒊 obtained in the nth approximation remain unchanged until the entire(𝒏 + 𝟏)th approximation has been calculated.

OWith the Gauss- Seidel method…O On the other hand, you use the new values of each 𝒙𝒊 as soon as they

are known. That is, once you have determined 𝒙𝟏 from the first equation, its value is then used in the second equation to obtain the new 𝒙𝟐 Similarly, the new 𝒙𝟏& 𝒙𝟐are used in the third equation to obtain the new𝒙𝟑 and so on. This procedure is demonstrated in 𝒙𝒏.

Page 10: system of algebraic equation by Iteration method

(1)Using the gauss-seidel method to solve the system…𝟖𝟑𝒙 + 𝟏𝟏𝒚 − 𝟒𝒛 = 𝟗𝟓,𝟕𝒙 + 𝟓𝟐𝒚 + 𝟏𝟑𝒛 = 𝟏𝟎𝟒,𝟑𝒙 + 𝟖𝒚 − 𝟐𝟗𝒛 = 𝟕𝟏,

O Solution…- rewriting the equation as...

O 𝑥 =95−11𝑦+4𝑧

83= 1.145 − 0.133𝑦 + 0.048𝑧

O y=104−7𝑥−13𝑧

52= 2 − 0.135 − 0.25𝑧

O z=71−3𝑥+8𝑦

29= 2.448 − 0.103𝑥 + 0.276𝑦

O Assume the initial solution:…

O 𝑥 = 𝑦 = 𝑧 = 0

Page 11: system of algebraic equation by Iteration method

Continuing this procedure, you obtain the sequence of approximations shown in Table

n X Y Z

0 0 0 0

1 1.145 1.845 1.821

2 0.987 1.412 1.957

3 1.051 1.369 1.962

4 1.057 1.367 1.962

5 1.057 1.367 1.962

Because the last two rows in Table are identical, you can

conclude that to three significant digits the solution is…

𝑥=1.057𝑦=1.367𝑧=1.962

Continuing this procedure, you obtain the sequence of approximations shown in Table

n X Y Z

0 0 0 0

1 1.145 1.845 1.821

2 0.987 1.412 1.957

3 1.051 1.369 1.962

4 1.057 1.367 1.962

5 1.057 1.367 1.962

Because the last two rows in Table are identical, you can

conclude that to three significant digits the solution is…

𝑥=1.057𝑦=1.367𝑧=1.962

Page 12: system of algebraic equation by Iteration method

(2)Using the gauss-seidel method to solve the system…6𝒙 + 𝒚 + 𝒛 = 𝟏𝟎𝟓,4𝒙 + 𝟖𝒚 + 𝟑𝒛 = 𝟏𝟓𝟓,5𝒙 + 𝟒𝒚 − 𝟏𝟎𝒛 = 𝟔𝟓,

O Solution…- rewriting the equation as...

O 𝑥 =105−𝑦−𝑧

6= 17.5 − 0.167𝑦 − 0.167𝑧

O y=155−4𝑥−3𝑧

8= 19.375 − 0.5𝑥 − 0.375𝑧

O z=−65+5𝑥+4𝑦

10= −6.5 − 0.5𝑥 + 0.4𝑦

O Assume the initial solution:…

O 𝑥 = 𝑦 = 𝑧 = 0

Page 13: system of algebraic equation by Iteration method

Continuing this procedure, you obtain the sequence of approximations shown in Table

n X y z

0 0 0 0

1 17.5 10.625 6.5

2 14.64 9.618 4.667

3 15.114 10.068 5.084

4 14.970 9.984 4.979

5 15.001 10.007 5.003

Because the last two rows in Table are identical, you can

conclude that to three significant digits the solution is…

𝑥=15.001𝑦=10.007𝑧=5.003

Page 14: system of algebraic equation by Iteration method

(3)Using the Gauss-Seidel method to solve the system…2𝒙 − 𝒚 + 𝟐𝒛 = 𝟑,𝒙 + 𝟑𝒚 + 𝟑𝒛 = −𝟏,𝒙 + 𝟐𝒚 + 𝟓𝒛 = 𝟏,

start with the initial approximations 𝒙 = 𝟎. 𝟑, 𝒚 = −𝟎. 𝟖, 𝒛 = 𝟎. 𝟑

O Solution…- rewriting the equation as...

O 𝑥 =3+𝑦−2𝑧

2= 1.5 + 0.5𝑦 − 𝑧

O y=−1−𝑥−3𝑧

3= −0.333 − 0.333𝑥 − 𝑧

O z=1−𝑥−2𝑦

5= 0.2 − 0.2𝑥 − 0.4𝑦

O Assume the initial solution:…

O 𝑥 = 𝑦 = 𝑧 = 0

Page 15: system of algebraic equation by Iteration method

Continuing this procedure, you obtain the sequence of approximations shown in Table

n X y z

0 0.3 -0.8 0.3

1 0.8 -0.899 0.4

2 0.651 -0.950 0.450

3 0.575 -0.974 0.475

4 0.538 -0.987 0.487

5 0.520 -0.993 0.493

6 0.511 -0.996 0.496

7 0.506 -0.997 0.498

Because the last two rows in Table are identical, you can conclude that to three

significant digits the solution is…

𝑥=0.506𝑦= − 0.997

𝑧=0.498

Page 16: system of algebraic equation by Iteration method

(4)Using the Gauss-Seidel method to solve the system…3𝒙 − 𝟎. 𝟏𝒚 − 𝟎. 𝟐𝒛 = 𝟕. 𝟖𝟓,0.1𝒙 + 𝟕𝒚 − 𝟎. 𝟑𝒛 = −𝟏𝟗. 𝟑,0.1𝒙 − 𝟎. 𝟐𝒚 + 𝟏𝟎𝒛 = 𝟕𝟏. 𝟒,

start with the initial approximations 𝒙 = 𝟎. 𝟑, 𝒚 = −𝟎. 𝟖, 𝒛 = 𝟎. 𝟑

O Solution…- rewriting the equation as...

O 𝑥 =7.85+0.1𝑦+0.2𝑧

3= 2.616 + 0.033𝑦 + 0.66z

O 𝑦 =1−19.3−0.1𝑥+0.3𝑧

7= −2.757 − 0.014𝑥 + 0.042𝑧

O 𝑧 =71.4−0.3𝑥+0.2𝑦

10= 7.14 − 0.3𝑥 − 0.02𝑦

O Assume the initial solution:…

O 𝑥 = 𝑦 = 𝑧 = 0

Page 17: system of algebraic equation by Iteration method

Continuing this procedure, you obtain the sequence of approximations shown in Table

Because the last two rows in Table are identical, you can conclude that

to three significant digits the solution is…

𝑥=3.000𝑦= − 2.50000

𝑧=7.0000

Page 18: system of algebraic equation by Iteration method