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ţii
algebrice liniare este
AX = B
3. Systems of Linear Algebraic Equations
Systems of linear algebraic
equations are used:
directlyin mathematical models for
electrical, structural and pipe
networks;
in computational methods for fitting
curves to data
4. Systems of Linear Algebraic
Equations
Direct methods
Iterative methods
5. Systems of Linear Algebraic Equations
Direct 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. Systems of Linear Algebraic Equations
Iterative 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
8. a. Gauss Elimination Method
Gauss (1777- 1855)
Goal
Toreduce the coefficients matrix to an
upper triangular form
Stages
Eliminationof the unknown parameters
Back substitution
9. a. Gauss Elimination Method
example for n=3
The 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 3
Stages
Eliminationof the unknown parameters
Back substitution
10. a. Gauss Elimination Method
example for n=3
1st 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. a. Gauss Elimination Method
example for n=3
STEP 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. a. Gauss Elimination Method
example for n=3
STEP 1
After 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. a. Gauss Elimination Method
example for n=3
1st 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. a. Gauss Elimination Method
example for n=3
STEP 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. a. Gauss Elimination Method
example for n=3
STEP 2
After 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. a. Gauss Elimination Method
example for n=3
STEP 3
The 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. a. Gauss Elimination Method
example for n=3
STEP 3
After 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. a. Gauss Elimination Method
example for n=3
2nd Stage
Backwards 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. Gauss Elimination Method
Elimination 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. 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. 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. 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,
nn
where
b ( n ) = b ( n −1) a ( n −1)
n n nn
23. Gauss Elimination Method
Back substitution
x n = b (n ) ,
n
(k ) n (k )
xk = bk − ∑ a kj x j , k = n − 1,..., 1.
j= k +1
24. b. Metoda Gauss-Jordan
Marie 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ă din
toate ecuaţiile sistemului, cu excepţia liniei pivot k.
După pasul k, sistemul devine:
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. 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. 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.
29. a. Metoda iterativă Jacobi
Jacobi
Fiecare ecuaţie se va rezolva în raport cu o
necunoscută.
Se obţine următorul sistem echivalent de
ecuaţ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. a. Metoda iterativă Jacobi
Unde,
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. a. Metoda iterativă Jacobi
În continuare, sistemul se va rezolva prin
metoda aproximaţiilor succesive:
succesive
X(0) = T
X(1) = T + SX(0), ...
X(k) = T + SX(k-1) , k = 1, 2,...
32. a. Metoda iterativă Jacobi
Relaţ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≠ i
Procesul iterativ se va opri atunci când:
max x i( k ) − x i( k −1) ≤ ε
i
Procesul iterativ este convergent atunci când
matricea coeficienţilor, A, este diagonal dominantă,
adică:
a ii > max a ij , i = 1, 2,..., n.
j≠ i
33. a. Metoda iterativă Jacobi
Aplicaţie
Să se rezolve sistemul de ecuaţii:
2 x + 3y + z = 11
2 x + y − 4z = −8
3x − 2 y + z = 2
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. a. Metoda iterativă Jacobi
Rezolvarea unui circuit electric
R3 R8
V2 i2 i3
R5
R2 R7
i1 i4
V1 R4
R1 R6
36. a. Metoda iterativă Jacobi
Reţ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. a. Metoda iterativă Jacobi
The equations for the currents are derived
from Ohm’s Law and Kirchhoff’s Voltage
Law.
Legea lui Ohm – Tensiunea măsurată în
dreptul unei rezistenţe R este iR, considerată
în direcţia curentului i.
Legea lui Kirchhoff – Tensiunea într-o buclă
inchisă este zero.
39. a. Metoda iterativă Jacobi
The 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. 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. a. Metoda iterativă Jacobi
The exact solution is
i1 = 0,14; i2 = 0,95; i3 = 0,37; i4 = 0,16
The approximate solution, after 16 iterations
i1 = 0,139631 ; i2 = 0,949146 ;
i3 = 0,369631 ; i4 = 0,158861
42. b.Metoda Gauss-Seidel
(Philipp Ludwig von Seidel 1821-1896)
Principiul metodei este acelaşi ca al metodei Jacobi, dar la determinarea valorii
aproximative a necunoscutei xi la pasul k, se consideră deja valorile actualizate la
acest 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. Gauss-Seidel Method
The exact solution is
i1 = 0,14; i2 = 0,95; i3 = 0,37; i4 = 0,16
The approximate solution, after 10 iterations
i1 = 0,139685 ; i2 = 0,949785 ;
i3 = 0,369767 ; i4 = 0,159773.