La présentation est en train de télécharger. S'il vous plaît, attendez

La présentation est en train de télécharger. S'il vous plaît, attendez

1 Iterative Methods A.X = b  Direct Methods : Gauss, LU, L L T, etc. Op(N 3)  Iterative methods : generates a sequences of vectors X (0), X (1), X (2),

Présentations similaires


Présentation au sujet: "1 Iterative Methods A.X = b  Direct Methods : Gauss, LU, L L T, etc. Op(N 3)  Iterative methods : generates a sequences of vectors X (0), X (1), X (2),"— Transcription de la présentation:

1

2 1 Iterative Methods A.X = b  Direct Methods : Gauss, LU, L L T, etc. Op(N 3)  Iterative methods : generates a sequences of vectors X (0), X (1), X (2), …X (n) such that:

3 2 Iterative Methods The term “Iterative Method” refers to a wide range of techniques that use successive approximations to obtain more accurate solutions to a linear system at each step.

4 3 Iterative Methods  stationary iterative method ( Jacobi, Gauss-Seidel, SOR, etc):. Iterative method that performs in each iteration the same operations on the current iteration vectors.  Nonstationary iterative Method (Conjugate Gradient (CG)): Iterative method that has iteration-dependent coefficients.

5 4 Jacobi Method (Jacobi 1830) The Jacobi method is based on solving for every variable locally with respect to the other variables; on iteration of the method corresponds to solving for every variable once. The resulting method is easy understand and implement, but convergence is slow.

6 5 Jacobi Method (Jacobi 1830) To solve the n x n linear system A.x = b A = M + N M represent the diagonal part of A. N represent the strictly lower-triangular, and the strictly upper-triangular parts of A (M (-1) exists)

7 6 A.x = b → M.x + N.x = b Then x = -M -1.N.x + M -1.b C onsider the iteration: x (0) : Choose the initial guess x (k+1) = -M -1.N.x (k) + M -1.b x (k+1) = Ω.x (k) + h With Ω = -M -1.N and h = M -1.b

8 7 Theorem: For any x (0) the sequence {x (k) } (k = 0,1,3…) defined by: x (k+1) = Ω.x (k) + h For each K > 0 converges to the unique solution of x = Ω.x + h, and only if ρ(Ω ) < 1 Definition: Diagonally dominant Theorem: If A is stricly diagonally dominant, then for any choice of x (0) both the jacobi and Gauss- Seidel methods give sequences {x (k) } (k = 0,1,3…) that converge to the solution A.X=b

9 8 In matrix terms: x (k+1) = Ω.x (k) + h The i th iteration of the method defined: We obtain

10 9 Example:

11 10

12 11 Example

13 12 The form x (k+1) = Ω.x (k) + h

14 13 For an initial approximation let x (0) =(0,0,0,0) T and generate x (1) by (Jacobi method):

15 14

16 15 Results:

17 16 For an initial approximation let x (0) =(0,0,0,0) T and generate x (1) by (Gauss-Siedel method):

18 17

19 18

20 19 Gauss-Siedel method (Von Siedel 1830) The Gauss Seidel method is like the Jacobi method, except that it uses updated values as soon as they available. In general, if the Jacobi method converges, the Gauss-Seidel method will converge faster than the Jacobi method, Though still relatively slowly.

21 20 Gauss-Siedel Method (Von Siedel 1830) To solve the n x n linear system A.x = b A = M + N

22 21 A.x = b → M.x + N.x = b Then x = -M -1.N.x + M -1.b x (0) initial approximation x (k+1) = -M -1.N.x (k) + M -1.b x (k+1) = Ω.x (k) + h with Ω = -M -1.N and h = M -1.b

23 22 In matrix terms: x (k+1) = Ω.x (k) + h The i th iteration of the method defined: We obtain

24 23 Stopping criterion Since an iterative method computes successive approximations to the solution of a linear system, a practical test is needed to determine when to stop the iteration. Ideally this test would measure the distance of the last iterate to the true solution, but this is not possible. Instead, various other metrics are used, typically involving the residual.

25 24 Stopping criterion: Virtual Convergence:

26 25 (SOR: Successive Over Relaxation): Successive Over Relaxation can be derived from the Gauss-Seidel method by introducing an extrapolation parameter w. For the optimal choice of w, SOR may converge faster than Gauss-Seidel by an order of magnitude.

27 26 successive over relaxation (SOR): If A is stricly diagonally dominant, and if 0< w <1 then for any choice of x (0) the SOR method give sequences {x (k) } (k = 0,1,3…) that converge to the solution A.X=b. If A SDP(symmetric positive definite ), and 0 < w < 2. Then SOR method converge.

28 27 Choosing the value of ω If ω = 1, the SOR method simplifies to the GS. In general, it is not possible to compute in advance the value of ω that is optimal with respect to the rate of convergence of SOR. Some heuristic estimate is used, such as ω = 2 – O(h) where h is the mesh spacing of the discretization of the underlying physical problem. Theoretically optimal value (PDEs):

29 28

30 29 The equations for the SOR method with ω =1.25

31 30

32 31 Méthodes itératives stationnaires

33 32 Accélérateur Aiken Aitken: une série géométrique basée sur les deux itérations précédentes. La suite X i est le vecteur solution donné par la méthode de Jacobi et de Gauss-Seidel. La suite Y i est le vecteur solution par Aitken.

34 33 Méthodes itératives stationnaires Ou non- stationnaires Les méthodes de projection qu’on verra par la suite sont plus générales et plus robustes que les méthodes stationnaires. ??

35 34 Méthodes itératives non-stationnaires Notations K k (A,r 0 ) = eng{r 0, Ar 0,….., A k-1 r 0 } espace de Krylov associé à A et r0r0 x* est la solution exacte & le résidu r (i) = A x (i) – b Gradient conjugué : (Conjugate Gradient (CG)) La méthode du CG est CG est une méthode efficace pour les matrices SDP

36 35 Théorie du (CG) Théorie du (CG) x (i) élément de x (0) + K k (A,r 0 ) La résolution du système A x = b est remplacée par une minimisation : J(x) = ½ x t A x – x t b On cherche les itérés x (k+1) sous la forme : x (k+1) = x (k) +  (k) u (k) ) Où minimise E dans la direction choisie. Où  (k) minimise E dans la direction u (k) choisie. E(x) = (x (i) -x*) T A (x (i) -x*) soit minimisé

37 36 Conjugate Gradient (CG): The conjugate gradient method derives its name from the fact that it generates a sequence of conjugate (or orthogonal) vectors. These vectors are the residuals of the iterates. They are also the gradients of a quadratic functional, the minimization of which is equivalent to solving the linear system. CG is an extremely effective method when the coefficient matrix is symmetric positive definite, since storage for only a limited number of vectors is required.

38 37 The CG Method The CG Method Choose an initial guess x (0) to the solution x. r (0) = A x (0) – b u (0) = - r (0)  (0) = (r (0), r (0) ) Iterates :  (k) =  (k) _ (u (k), A u (k) ) x (k+1) = x (k)  +  (k) u (k) r (k+1) = A x (k+1) – b = r (k)  +  (k) A u (k)  (k+1) = (r (k+1), r (k+1) ) (End if  (k+1) = 0) (k+1) =  (k+1)  (k) u (k+1) = - r (k+1) + (k+1) u (k) k = 0, …,n-1

39 38 Example: The linear system A.x = b

40 39

41 40

42 41 Convergence Accurate predictions of the convergence of iterative methods are difficult to make. Spectral condition number:

43 42 Convergence du (CG)  Il est difficile de prédire exactement la convergence des méthodes itératives.  L’erreur se borne en fonct⁰ du conditionn. spectral k2 k2 de A  Si A est SDP, avec un préconditionneur M SDP, on peut démontrer que : ||x (i) -x*|| A  2  i || x (0) – x*|| A Avec :  Si les valeurs propres extrémales de la matrice M -1 A sont très éloignées, On aura un phénomène qui s’appelle convergence superlinéaire.

44 43 Implémentation du (CG)  Deux produits scalaires (u (k), A u (k) ) et (r (k+1), r (k+1) ) La méthode du gradient conjugué implique à chaque itération :  Un produit matrice-vecteur de A par la direction de descente u  Trois opérations de mise à jour pour les vecteurs : Résidu, direction de descente et vecteur solution Lorsqu’on préconditionne le système par exemple par le préconditionneur SSOR, chaque produit matrice-vecteur sera transformé en une suite de produits matrice-vecteur : A * u sera D 1/2 (D + L) -1 A ( D + L T ) -1 D 1/2 u :

45 44 Choix du vecteur de départ x 0 de CG : On peut affirmer que la méthode du gradient conjugué converge le mieux lorsque le vecteur de départ est fixé à zéro pour tous les systèmes linéaires Remarquons qu’on ne peut pas cependant généraliser ce résultat à tout type de matrices

46 45 Récapitulation des méthodes non-stationnaires :

47 46 Suite des méthodes non-stationnaires :

48 47 La méthode de stockage dépend de la méthode de résolution Soit A creuse de taille n et soit Nz le nombre total d’éléments non nuls  La factorisation d’une matrice creuse détruit son caractère creux, sauf si elle est bande.  Une méthode itérative, n’utilise la matrice qu’à travers sa multiplication par des vecteurs alors on peut ne pas stocker que les coefficients non nuls de la matrice. Voire ne rien stocker. STOCKA GE

49 48 STOCKAGE (2)

50 49 Préconditionnement La convergence des méthodes itératives dépend du conditionnement spectral de A Avec : (k 2 (A) = max (A) / min (A) ) A x = b  M -1 A x = M -1 b k 2 (A) > k 2 (M -1 A) Compromis de coût entre construction & application du préconditionneur M à chaque itération et le gain dans la vitesse de convergence

51 50 Préconditionnement à gauche et à droite M -1 A n'est pas symétrique, même si M et A le sont. M = M 1 M 2 M 1 -1 AM 2 -1 (M 2 x) = M 1 -1 b Et à la fin des itérations : x  M 2 -1 x n Avec x n la solution finale calculée M 1 = le préconditionneur gauche et M 2 = le préconditionneur droit

52 51 Préconditionneur de Jacobi D = Diag(A) M = D = M 1 M 2 = D = D 1/2 D 1/2 M 1 -1 AM 2 -1 (M 2 x) = M 1 -1 b  (D -1/2 A D -1/2 ) (D 1/2 x) = (D -1/2 b) Le préconditionneur SSOR A = D + L + L T Pour A Sym. M = (D + L) D -1 ( D + L ) T Ou M(  ) = 1 ( 1 D + L) ( 1 D) -1 ( 1 D + L) T 2-     M = (D + L) D -1/2 D -1/2 ( D + L ) T Préconditionnement (1)

53 52 Préconditionneur SSOR Le truc d’Eisenstat’s Préconditionner A x = b avec M = (D + L) D -1 ( D + L ) T Le truc d’Eisenstat’s concevoir un nouveau système A’ u = b’ (D + L) -1 A ( D + L T ) -1 ( D + L T ) x = (D + L) -1 b Préconditionner A’ u = b’ avec le préconditionneur M = D -1 D 1/2 A’ D 1/2 ( D -1/2 u ) = D 1/2 b’

54 53 Comparaison entre méthodes méthodes directes & méthodes itératives La méthode directe est commode pour les systèmes denses d’ordre supérieur, ainsi que pour les matrices bandes même d’ordre élevé. La méthode itérative est mieux adaptée aux autres matrices d’ordre très élevé et comportant de nombreux éléments nuls. Mais, lorsque le code cessera de tourner séquentiellement, et l’idée de la parallélisation s’impose, c’est la méthode itérative qui remporte la victoire.


Télécharger ppt "1 Iterative Methods A.X = b  Direct Methods : Gauss, LU, L L T, etc. Op(N 3)  Iterative methods : generates a sequences of vectors X (0), X (1), X (2),"

Présentations similaires


Annonces Google