Sisteme de ecuatii

432 views
322 views

Published on

0 Comments
0 Likes
Statistics
Notes
  • Be the first to comment

  • Be the first to like this

No Downloads
Views
Total views
432
On SlideShare
0
From Embeds
0
Number of Embeds
0
Actions
Shares
0
Downloads
0
Comments
0
Likes
0
Embeds 0
No embeds

No notes for slide

Sisteme de ecuatii

  1. 1. Sisteme de ecuaţii algebrice liniare Capitolul 3
  2. 2. Sisteme de ecuaţii algebrice liniare Forma generală a unui sistem de ecuaţii algebrice liniare este a 11 x 1 + a 12 x 2 +  + a 1n x n = b1 a x + a x +  + a x = b  21 1 22 2 2n n 2  ........................................................ a n1 x 1 + a n 2 x 2 + a nn x n = b n Forma matriceală a unui sistem de ecuaţiialgebrice liniare este AX = B
  3. 3. Systems of Linear Algebraic EquationsSystems of linear algebraic equations are used:  directlyin mathematical models for electrical, structural and pipe networks;  in computational methods for fitting curves to data
  4. 4. Systems of Linear AlgebraicEquations Direct methods Iterative methods
  5. 5. Systems of Linear Algebraic EquationsDirect methods the exact solution is obtained by applying a finite algorithm the solution is affected by round-off errors methods  Cramer Rule  Gauss Elimination Method  Gauss-Jordan Method
  6. 6. Systems of Linear Algebraic EquationsIterative methods the approximate solution is obtained after a number of steps of an infinite iterative procedure the solution is affected by round - off and truncation errors methods  Jacobi Method  Gauss-Seidel Method
  7. 7. Systems of Linear Algebraic Equations3.1 Direct methods
  8. 8. a. Gauss Elimination MethodGauss (1777- 1855)Goal Toreduce the coefficients matrix to an upper triangular formStages Eliminationof the unknown parameters Back substitution
  9. 9. a. Gauss Elimination Method example for n=3The system of 3 equations is: a 11x1 + a 12 x 2 + a 13 x 3 = b1  a 21x1 + a 22 x 2 + a 23 x 3 = b 2 a x + a x + a x = b  31 1 32 2 33 3 3Stages  Eliminationof the unknown parameters  Back substitution
  10. 10. a. Gauss Elimination Method example for n=31st stage  Elimination of the unknown parameters STEP 1 Elimination of x1 from eqs.2 and 3 Pivot line-1; pivot element a11 After step 1, the system becomes: x1 + a 12) x 2 + a 13) x 3 = b11) (1 (1 (   a (22) x 2 + a (23) x 3 = b (21) 1 1   a 32) x 2 + a 33) x 3 = b 31) (1 (1 (
  11. 11. a. Gauss Elimination Method example for n=3STEP 1 Elements of the pivot line a1 j a 1j = (1) , j = 1, 2, 3 a 11 b1 b (1) 1 = a 11 Elements of the non-pivot lines a (ij1) = a ij − a i1a 11) , j = 1, 2, 3; i = 2, 3 ( j b i(1) = b i − a i1b11) (
  12. 12. a. Gauss Elimination Method example for n=3STEP 1After Step1, the system can be written by matrices as: 1 a12) a13)   x1  b11)  (1 (1 (  (1)    = b (1)  0 a 22 a 23  ⋅  x 2   2  (1) 0 a 32) a 33)   x 3  b 31)  (1 (1 (      
  13. 13. a. Gauss Elimination Method example for n=31st stage  Elimination of the unknown parameters STEP 2 Elimination of x2 from eq.3 Pivot line-2; pivot element a22(1) After step 2, the system becomes: x1 + a 12) x 2 + a 13) x 3 = b11) (1 (1 (   x 2 + a (23) x 3 = b (22 ) 2   a 33) x 3 = b 32 ) (2 (
  14. 14. a. Gauss Elimination Method example for n=3STEP 2 Elements (of the pivot line 1) a 2j a 2j = ( 2) , j = 2, 3 a 22 b (1) b ( 2) 2 = 2 a 22 Elements of the non-pivot lines a (ij2 ) = a (ij1) − a (i1) a ( 2j) , j = 2, 3; i = 3 2 2 b i( 2 ) = b i(1) − a (i1) b ( 2 ) 2 2
  15. 15. a. Gauss Elimination Method example for n=3STEP 2After Step 2, the system can be written by matrices as: 1 a12) a13)   x1   b11)  (1 (1 (  ( 2)    = b ( 2 )  0 1 a 23  ⋅  x 2   2  0 0 a 33)   x 3  b 32 )  (2 (      
  16. 16. a. Gauss Elimination Method example for n=3STEP 3The pivot line is the 3rd and the pivot element is a33(2).The 1 xsystem+becomes: + a 12) x 2 a 13) x 3 = b11) (1 (1 (   x 2 + a (23) x 3 = b (22 ) 2   x 3 = b 33) ( b 32 ) ( b 33) = ( 2 ) (Where a 33
  17. 17. a. Gauss Elimination Method example for n=3STEP 3After Step 3, the system can be written by matrices as: 1 a12) (1 a   x1   b11)  (1) 13 (      ( 2)  0 1 a  ⋅  x 2  = b 2  ( 2) 23 0 0   x 3   b 33)  1      ( 
  18. 18. a. Gauss Elimination Method example for n=32nd StageBackwards substitution x 3 = b 33) (  x 2 = b 2 − a 23 x 3 ( 2) ( 2)   x1 = b (21) − (a13) x 3 + a 12) x 2 ) (1 (1
  19. 19. Gauss Elimination MethodElimination stage Step k – the elimination of xk from the last (n – k) equations (k = 1, 2, ... , n – 1) After step k, the system has the following form: 1 a (1)  a 11) ( a 11k +1 ()  a 11)   x 1   b (1)  (  12 k , n  1 0 1  a ( 2) a 2,k(+12)  ( 2)  x   ( 2)  a 2n   2   b 2  2k                 0 0 (k )     (k )   1 a ( kk +1 k, )  a k ,n ⋅  x k  =  b k    0 0  0 a ( k )1,k +1  (k ) a k +1,n   x k +1  b ( k )   k+     k +1                (k )   x   (k )  0 0  0 a ( kk +1  ) a nn   n   b n     n,
  20. 20. Gauss Elimination Method The new elements of the matrices are:  For the pivot row a ( k ) = 1,  k ,k  (k ) ( k −1) ( k −1) a kj = a kj a k , k , j = k + 1,..., n ,  (k ) ( k −1) ( k −1) b k = b k a k ,k , 
  21. 21. Gauss Elimination Method  For the non-pivot rows a ( k ) = 0, ik (k) ( k −1) ( k −1) ( k ) a ij = a ij − a ik a kj , j = k + 1, ..., n , i = k + 1,..., n , (k ) b i = b i( k −1) − a ik −1) b ( k ) . (k k
  22. 22. Gauss Elimination Method  Step n 1 a (1)  a 11) ( a 11k +1 ()  a 11)   x 1   b11)  ( (  12 k , n   x   ( 2)  0 1  a ( 2) 2k a 2,k(+1  2) ( 2) a 2n   2   b 2                   (k )  0 0 (k )  ⋅  x  =  1 a ( kk +1  k, ) a k ,n  k   bk     0 0 0 1 ( k +1) a k +1,n   x k +1  b ( k +1)      k +1                   x   (n )  0 0   0 0  1   n   bn     a ( n ) = 1,  nnwhere  b ( n ) = b ( n −1) a ( n −1)  n n nn
  23. 23. Gauss Elimination MethodBack substitutionx n = b (n ) , n (k ) n (k )xk = bk − ∑ a kj x j , k = n − 1,..., 1. j= k +1
  24. 24. b. Metoda Gauss-JordanMarie Ennemond Camille Jordan (1821-1922)Obiectivul metodei Matricea coeficienţilor, A, este adusă, prin transformări succesive, la forma unei matrice unitate.La pasul k, necunoscuta xk este eliminată dintoate ecuaţiile sistemului, cu excepţia liniei pivot k.După pasul k, sistemul devine:
  25. 25. Metoda Gauss-Jordan1 0  0 a 1,k )+1 (  a 1n )   x 1   b ( k )  (k k   1k ) 0 1  0 (k ) a 2,k +1  a (k)   x 2   b (     2n 2             0 (k )     (k)  0  1 a ( kk +1 k, )  a k ,n ⋅  x k  =  b k  0 0  0 a ( k )1, k +1  (k ) a k +1,n   x k +1  b ( k )  k+     k +1               (k)   x   (k) 0 0  0 a ( kk +1  ) a nn  n  bn   n, 
  26. 26. Metoda Gauss-Jordan• Noile elemente ale liniei pivot sunt: a ( k ) = 1,  k ,k  (k ) ( k −1) ( k −1) a kj = a kj a k ,k , j = k + 1,..., n ,  (k ) ( k −1) ( k −1) b k = b k a k ,k , 
  27. 27. Gauss-Jordan Method  Elementele liniilor ne-pivot sunt:a ( k ) = 0, ik (k)a ij = a ijk −1) − a ik −1) a ( k ) , j = k + 1, ..., n , i = 1,..., n , i ≠ k , ( (k kj (k )b i = b i k −1) − a ik −1) b ( k ) . ( (k k  Pentru obţinerea soluţiei sistemului, se vor identifica valorile necunoscutelor cu termenii liberi obţinuţi după pasul n. x k = b (kn ) , k = 1, ..., n.
  28. 28. Sisteme de ecuaţii algebrice liniare3.2 Metode iterative
  29. 29. a. Metoda iterativă JacobiJacobiFiecare ecuaţie se va rezolva în raport cu onecunoscută.Se obţine următorul sistem echivalent deecuaţii:x 1 = t 1 + s12 x 2 +  + s1n x nx = s x + t 2 +  + s 2n x n 2 21 1...................................................x n = s n1 x 1 + s n 2 x 2 +  + t n
  30. 30. a. Metoda iterativă JacobiUnde,s ii = 0, i = 1, 2, ..., n;s ij = − a ij a ii , j = 1, 2,..., n , j ≠ i ;t i = b i a ii .Sitemul poate fi scris în formă matriceală X = T + SX
  31. 31. a. Metoda iterativă JacobiÎn continuare, sistemul se va rezolva prinmetoda aproximaţiilor succesive: succesive X(0) = T X(1) = T + SX(0), ... X(k) = T + SX(k-1) , k = 1, 2,...
  32. 32. a. Metoda iterativă JacobiRelaţiile metodei Jacobi pot fi scrise explicit, astfel: x (0) = t i , i = 1, 2,..., n  i  n x ( k ) = t + ∑ s x ( k −1) , k = 1, 2,...  i i ij j j=1   j≠ iProcesul iterativ se va opri atunci când: max x i( k ) − x i( k −1) ≤ ε iProcesul iterativ este convergent atunci cândmatricea coeficienţilor, A, este diagonal dominantă,adică: a ii > max a ij , i = 1, 2,..., n. j≠ i
  33. 33. a. Metoda iterativă JacobiAplicaţie Să se rezolve sistemul de ecuaţii: 2 x + 3y + z = 11  2 x + y − 4z = −8 3x − 2 y + z = 2 
  34. 34. a. Metoda iterativă Jacobi Sistemul trebuie adus la o formă diagonal dominantă:2 x + 3y + z = 11 3x − 2 y + z = 2 2 x + y − 4z = −8 2 x + 3y + z = 113x − 2 y + z = 2 2 x + y − 4z = −8 
  35. 35. a. Metoda iterativă Jacobi Rezolvarea unui circuit electric R3 R8V2 i2 i3 R5 R2 R7 i1 i4V1 R4 R1 R6
  36. 36. a. Metoda iterativă JacobiReţeaua este caracterizată prin: 8 rezistenţe R1 ... R8; două surse de curent V1 and V2, în direcţiile din figură; intensităţile curentului prin cele patru bucle ale reţelei sunt i1 ... i4, considerate în orar.
  37. 37. a. Metoda iterativă JacobiThe equations for the currents are derivedfrom Ohm’s Law and Kirchhoff’s VoltageLaw.Legea lui Ohm – Tensiunea măsurată îndreptul unei rezistenţe R este iR, consideratăîn direcţia curentului i.Legea lui Kirchhoff – Tensiunea într-o buclăinchisă este zero.
  38. 38.  loop 1: i1R1 + (i1 – i4) R4 + (i1 – i2) R2 + V1 = 0; loop 2: (i2 - i1) R2 + (i2 – i3) R5 + i2 R3 – V2 = 0; loop 3: (i3 – i4) R7 + i3 R8 + (i3 – i2) R5 = 0; loop 4: i4R6 + (i4 – i3) R7 + (i4 – i1) R4 = 0. R3 R8 V2 i2 i3 R5 R2 R7 i1 i4 V1 R4 R1 R6
  39. 39. a. Metoda iterativă JacobiThe system may be written in a matrix form SI=V,where R 1 + R 2 + R 4 −R2 0 −R4   −R2 R2 + R3 + R5 −R5 0 S=    0 − R5 R5 + R7 + R8 −R7     −R4 0 −R7 R4 + R6 + R7   i1  − V1  i  5; k = 1, 2, 3, 4 V1 = 3,45 V  Rk = I=  2  V=  2  2; k = 5, 6, 7, 8 V2 = 9,96 i 3   0      i 4   0 
  40. 40. a. Metoda iterativă Jacobi ( ( i 1k ) = − 3,45 + 5i ( k −1) + 5i ( k −1) 15 2 4 ) = (9,96 + 5i ) 12; ; . ( k.) ( k −1) ( k −1) ; i2 1 + 2i 3 ( ( i 3k ) = 2i ( k −1) + 2i ( k −1) 6 2 4 ) 4 ( i ( k ) = 5i 1k −1) + 2i 3k −1) 9 ( ( )
  41. 41. a. Metoda iterativă JacobiThe exact solution isi1 = 0,14; i2 = 0,95; i3 = 0,37; i4 = 0,16The approximate solution, after 16 iterationsi1 = 0,139631 ; i2 = 0,949146 ;i3 = 0,369631 ; i4 = 0,158861
  42. 42. b.Metoda Gauss-Seidel (Philipp Ludwig von Seidel 1821-1896)Principiul metodei este acelaşi ca al metodei Jacobi, dar la determinarea valoriiaproximative a necunoscutei xi la pasul k, se consideră deja valorile actualizate laacest pas ale necunoscutelor x1...xi-1 s ii = 0, i = 1, 2, ..., n; s ij = − a ij a ii , j = 1, 2,..., n , j ≠ i ; t i = b i a ii , x ( 0) = t i , i = 1, 2,..., n  i  (k ) i −1 n  x i = t i + ∑ s ij x j + ∑ s ij x (jk −1) , k = 1, 2,... (k )  j=1 j=i +1
  43. 43. Gauss-Seidel MethodThe exact solution isi1 = 0,14; i2 = 0,95; i3 = 0,37; i4 = 0,16The approximate solution, after 10 iterationsi1 = 0,139685 ; i2 = 0,949785 ;i3 = 0,369767 ; i4 = 0,159773.

×