interactives methods

38
ITERATIVES METHODS

Upload: uis

Post on 20-Nov-2014

1.644 views

Category:

Documents


1 download

DESCRIPTION

 

TRANSCRIPT

Page 1: Interactives Methods

ITERATIVESMETHODS

Page 2: Interactives Methods

JACOBI METHOD ITERATIVESMETHODS

Page 3: Interactives Methods

JACOBI METHOD

Suppose we are trying to solve a system of linear equation Mx = b. If we assume that the diagonal entries are non-zero (true if the matrix M is positive definite), then we may rewrite this equation as:

Dx + Moffx = b

Where:D is the diagonal matrix containing the diagonal entries of M and Moff contains the off-diagonal entries of M. Because all the entries of the diagonal matrix are non-zero, the inverse is simply the diagonal matrix whose diagonal entries are the reciprocals of the corresponding entries of D.

Page 4: Interactives Methods

Thus, we may bring the off-diagonal entries to the right hand side and multiply by D-1:

x = D-1(b - Moffx)

You will recall from the class on iteration, we now have an equation of the form x = f(x), except in this case, the argument is a vector, and thus, one method of solving such a problem is to start with an initial vector x0.

Page 5: Interactives Methods

EXAMPLE

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

1325 321 x x x

293 321 x x x

372 321 x x x

0

0

0

3

2

1

x

x

x

With initial values:

Page 6: Interactives Methods

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

To begin, write the system in the form:

5

321x 32

1

xx

9

32x 31

2

xx

7

23x 21

3

xx

Page 7: Interactives Methods

As a convenient initial approximation. So, the first approximation is:

200.05

)0(21x1

222.09

)0()0(32x2

429.07

)0()0(23x3

Page 8: Interactives Methods

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

n 0 1 2 3 4 5 6 7

X1 0.000

-0.200

0.146

0.192

0.181 0.185 0.186 0.186

X2

0.000

0.222 0.203

0.328

0.332 0.329 0.331 0.331

X3 0.000

-0.429

-0.51

7

-0.41

6

-0.421

-0.424

-0.423

-0.423

Page 9: Interactives Methods

Because the last two columns in table are identical, you can conclude that to three significant digits the solution is:

423.0x

331.0x

186.0x

3

2

1

For the system of linear equations given in example, the Jacobi method is said ti converge. That is, repeated iterations succeed in producing approximation that is correct to three significant digits. As is generally true for iterative methods, grater accuracy would require more iterations.

Page 10: Interactives Methods

GAUSS-SEIDEL METHOD

ITERATIVESMETHODS

Page 11: Interactives Methods

GAUSS-SEIDEL METHOD

The Gauss–Seidel method, also known as the Liebmann method or the method of successive displacement, is an iterative method used to solve a linear system of equations. It is named after the German mathematicians Carl Friedrich Gauss and Philipp Ludwig von Seidel, and is similar to the Jacobi method. Though it can be applied to any matrix with non-zero elements on the diagonals, convergence is only guaranteed if the matrix is either diagonally dominant, or symmetric and positive definite.

Page 12: Interactives Methods

First solve for the unknowns in order.

Then we assume an initial value for [X(0)]

We must remember that I always use the most recent value xi. This means that calculated values apply for the calculations are in the current iteration

0n

01-n

02

01

x

x

x

x

Page 13: Interactives Methods

Calculation of relative absolute error approximate

Then find the correct answer when the maximum relative absolute error is approximately less than the specified tolerance for all unknowns.

100

nuevoi

anteriori

nuevoi

ia x

xx

sia max

Page 14: Interactives Methods

EXAMPLE

Solve the following system of equations:

34 321 - x x x

1972 321 x x x

31123 321 x x x

0

0

0

3

2

1

x

x

x

With initial values:

Matrix coefficients:

1231

172

114

A

Page 15: Interactives Methods

1231

172

114

A

Let's see if the matrix is diagonally dominant

31277 232122 aaa

4311212 323133 aaa

211124 131211 aaa

Satisfy all inequalities, therefore the solution should converge using the Gauss Seidel.

Page 16: Interactives Methods

31

19

3

x

x

x

1231

172

114

3

2

1

0

0

0

3

2

1

x

x

x

Rewriting each equation:

4

3 231

xxx

7

219 312

xxx

12

331 213

xxx

43

4

003x1

25

7

043219x2

48151

12

2534331x3

With initial values:

Page 17: Interactives Methods

The approximate relative absolute error:

The approximate maximum relative absolute error after the first iteration is

100%.

%10010043

0431

a

%10010025

0252

a

%10010048151

1481513

a

Iteration 1

84151

25

43

3

2

1

x

x

x

Page 18: Interactives Methods

Substituting the above values into the equations

192175

4

25481513x1

224449

7

48151192175219x2

008.3

12

224449319217531x3

Page 19: Interactives Methods

The approximate maximum relative absolute error after the second iteration

is 24.7%.

Iteration 2

008.3

224449

192175

3

2

1

x

x

x

%7.17100192175

431921751

a

%7.24100224449

252244492

a

%6.4100008.3

48151008.33

a

The approximate relative absolute error:

Page 20: Interactives Methods

Substituting the above values into the equations

0008.1

4

224449008.33x1

9986.1

7

008.30008.1219x2

9995.2

12

9986.130008.131x3

Page 21: Interactives Methods

The approximate maximum

relative absolute error after the

second iteration is 8.9%.

Iteration 3

9995.2

9986.1

0008.1

3

2

1

x

x

x

%9.81000008.1

1921750008.11

a

%29.01009986.1

2244499986.12

a

%04.01009995.2

008.39995.23

a

The approximate relative absolute error:

Page 22: Interactives Methods

Substituting the above values into the equations

0002.1

4

9986.19995.23x1

0000.2

7

9995.20002.1219x2

9999.2

12

0000.230002.131x3

Page 23: Interactives Methods

The approximate maximum

relative absolute error after the

second iteration is 0.06%.

Iteration 4

%06.01000002.1

0008.10002.11

a

%07.01000000.2

9986.10000.22

a

%01.01009999.2

9995.29999.23

a

The approximate relative absolute error:

9999.2

0000.2

0002.1

3

2

1

x

x

x

Page 24: Interactives Methods

3

2

1

3

2

1

x

x

xThe exact solution is:

The resulting solution is:

9999.2

0000.2

0002.1

3

2

1

x

x

x

Page 25: Interactives Methods

Gauss-Seidel ITERATIVESMETHODS

GAUSS-SEIDEL RELAXATION

METHOD

Page 26: Interactives Methods

GAUSS-SEIDEL RELAXATION

The Gauss-Seidel method is a technique for solving the equations of the linear system of equations Ax = b one at a time in sequence, and uses previously computed results as soon as they are available,

ii

kjijij

kjijijk

i a

xaxabix

)1()()(

Page 27: Interactives Methods

There are two important characteristics of the Gauss-Seidel method should be noted. Firstly, the computations appear to be serial. Since each component of the new iterate depends upon all previously computed components, the updates cannot be done simultaneously as in the Jacobi method. Secondly, the new iterate depends upon the order in which the equations are examined. If this ordering is changed, the components of the new iterates (and not just their order) will also change.

Page 28: Interactives Methods

In terms of matrices, the definition of the Gauss-Seidel method can be expressed as

where the matrices D, -L and -U represent the diagonal, strictly lower triangular, and strictly upper triangular parts of, respectively.

The Gauss-Seidel method is applicable to strictly diagonally dominant, or symmetric positive definite matrices .

)()( )1(1)( bUxLDx kki

Page 29: Interactives Methods

IMPROVING THE CONVERGENCE USING

RELAXATION SOR The relaxation represents a slight modification to

the Gauss Seidel and this improves the convergence. Estimated after each new value of x, that value is changed by a weighted average of the results of previous and current iteration.

Where w is a weighting factor that has a Valors between 0 and 2.

)()()( )1( previousi

newi

newi xwxwx

Page 30: Interactives Methods

Figure 5. The effect of freezing the boundary on several levels of a surface.

Example.

Page 31: Interactives Methods

EXAMPLE

Solve the following system of equations for Relaxation SOR:

80125 21 x x

24 321 x x x

4586 21 x x

With : 90.0w

%5s

0

0

0

3

2

1

x

x

x

With initial values:

Page 32: Interactives Methods

80

45

2

x

x

x

1205

186

114

3

2

1

Rewriting each equation:

4

2 231

xxx

8

645 12

xx

12

580 13

xx

21

4

002x1

With initial values X1:

Page 33: Interactives Methods

21)(1 newx

209)0)(90.01()21()90.0(1 x

804778

)209(645)(2

newx

8004293)0)(90.01()80477()90.0(2 x

4831112

)209(580)(3

newx

160933)0)(90.01()48311()90.0(3 x

Iteration 1

160933

8004293

209

3

2

1

x

x

x

Page 34: Interactives Methods

0244.2)209)(90.01()2993.2()90.0(1 x

1067.48

)0244.2(645)(2

newx

2326.4)8004293)(90.01()1067.4()90.0(2 x

5101.712

)0244.2(580)(3

newx

3423.7)160933)(90.01()5101.7()90.0(3 x

Iteration 2

2993.24

)8004293()160933(2)(1

newx

3423.7

2326.4

0244.2

3

2

1

x

x

x

Page 35: Interactives Methods

And we must make the followings iterations y and obtained:

656.7

844.3

375.2

3

2

1

x

x

x

Page 36: Interactives Methods

If A is symmetric and positive definite, the Gauss-Seidel method converges.

If A is symmetric and the matrix is the form:

And is positive definite, the Jacobi method is convergent.

nnnn

n

n

aaa

aaa

aaa

ULD

.....

..

.

.

.

.....

....

21

22221

11211

CONVERGENCE OF ITERATIVES METHODS

Page 37: Interactives Methods

If A is symmetric and positive definite, the relaxation method converges if and only if 0 < w <2.

If w < 1 the method is named subrelajation and if w > 1, Overrelaxation.

If A is symmetric, positive definite and tridiagonal, the optimal value of w for the convergence of the relaxation method is:

where: Pj: The spectral radius of the matrix Jacobi iteration method.

211

2

Pjw

Page 38: Interactives Methods

http://www.google.com.co/imgres?imgurl=http://www.unavarra.es/personal/victor_dominguez/portMatlab.jpg&imgrefurl=http://www.unavarra.es/personal/victor_dominguez/libroMatlab.htm&usg=__g0H6VfxnJXinSq932hKACQW-4mE=&h=423&w=596&sz=61&hl=es&start=19&itbs=1&tbnid=qcEPT90K9KGOJM:&tbnh=96&tbnw=135&prev=/images%3Fq%3DGauss-Seidel%2Bcon%2Brelajaci%25C3%25B3n%26hl%3Des%26sa%3DG%26gbv%3D2%26tbs%3Disch:1

http://www.ana.iusiani.ulpgc.es/metodos_numericos/document/apuntes/Parte_4.pdf

Bibliography