Está en la página 1de 32

Métodos Numéricos Proyecto 1

Alexander Ojeda
Lander Lliguicota
19 Dicembre 2022

Resumen En el álgebra lineal, la factorización o descomposición LU (del


inglés Lower-Upper) es una forma de factorización de una matriz como el pro-
ducto de una matriz triangular inferior y una superior. Debido a la inestabilidad
de este método, deben tenerse en cuenta algunos casos especiales, por ejemplo,
si uno o varios elementos de la diagonal principal de la matriz a factorizar es
cero, es necesario premultiplicar la matriz por una o varias matrices elementales
de permutación. En matemáticas, la factorización o descomposición de Cholesky
toma su nombre del matemático André-Louis Cholesky, quien encontró que una
matriz simétrica definida positiva puede ser descompuesta como el producto de
una matriz triangular inferior y la traspuesta de la matriz triangular inferior.
La matriz triangular inferior es el triángulo de Cholesky de la matriz original
positiva definida.
1. Concidere la siguiente matriz:

 
1 1 1 1
1 2 1 2
 
1 1 3 1
1 2 1 5

i) Hallar la factorización LDU de A.


Para considerar la dactorizacion LDU empezacom definiendo nuess-
tro sistema,tal que A = L · U . Nos quedaria tal que:
A L U
    
1 1 1 1 1 0 0 0 U 11 U 12 U 13 U 14
1 2 1 2 L21 1 0 0  0 U 22 U 23 U 24
 =  
1 1 3 1 L31 32 1 0  0 0 U 33 U 34
1 2 1 5 L41 L42 L43 1 0 0 0 U 44

Ahora buscaremos los valores mediante operaciones . Entonces:

1
F 2 → F 2 − (1) F 1 F 3 → F 3 − (1) F 1 F 4 → F 4 − (1) F 1
     
1 1 1 1 1 1 1 1 1 1 1 1
1 2 1 2 0 1 0 1 0 1 0 1
     
1 1 3 1 1 1 3 1 0 0 2 0
1 2 1 5 1 2 1 5 1 2 1 5
F 4 → F 4 − (1) F 1 F 4 → F 4 − (1) F 2
   
1 1 1 1 1 1 1 1
0 1 0 1 0 1 0 1
   
0 0 2 0 0 0 2 2
0 1 0 4 0 0 0 3
 
1 1 1 1
0 1 0 1
U= 
0 0 2 0

0 0 0 3

Una vez obtenidos U, con los coeficioentes resaltados procedemos


hallar la matriz L. Tal que:
 
1 0 0 0
1 1 0 0
L= 1 0 1 0

1 1 0 1
La factorizacion queda tal que:
A = L x U
    
1 1 1 1 1 0 0 0 1 1 1 1
1 2 1 2 1 1 0 0
 0 1 0 1
  

1 = 
1 3 1 1 0 1 0 0 0 2 0
1 2 1 5 1 1 0 1 0 0 0 3

ii) Factorización de Cholesky.


Para el metodo de Cholesky debemos comprobar que:
  T
A=A 
1 1 1 1 1 1 1 1
1 2 1 2
1 2 1 2

.
1

1 3 1 1
 1 3 1
1 2 1 5 1 2 1 5

2
Entonces sabemos que A es simetrica y que se puede llevar acabo
Cholesky. Planteamos que A = L ∗ Lt , entonces tenemos el sistema:
A = L x Lt
    
1 1 1 1 L11 0 0 0 L11 L21 L31 L41
1 2 1 2 L21 L22 0 0   0 L22 L32 L42
 
 =
1 1 3 1 L31 L32 1 0  0 0 L33 L43
1 2 1 5 L41 L42 L43 L44 0 0 0 L44

Entonces en esta ocasion usaremos el metodo usando la


multiplicacion de matrices.

Despejando de la igualdad tenemos:



L11 = 1 = 1
L21 = 1/L11 = 1

L22 = 2 − L212 = 1
L31 = 1/L11 = 1
1−L21∗L31
L32 = = 0/1 = 0
L22
√ √ √
L33 = 3 − L312 + L322 = 3 − 1 − 0 = 2
L41 = 1/L11 = 1
2−L21∗L41 2−1
L42 = L22
= 1
=1
1−L31∗L41−L32L42 1−1−0
L43 = L33
=0 = 1
√ √ √
L44 = 5 − L412 − L422 − L432 = 5 − 1 − 1 − 0 = 3
La factorizacion de Cholesky queda:

3
A = L x Lt
    
1 1 1 1 1 0 0 0 1 1 1 1
1 2 1 2 1
  1 √0 0 
 0
 1 √0 1 

1 = 
1 3 1 1 0 2 √0 0
 0 2 √0 
1 2 1 5 1 1 0 3 0 0 0 3
iii)Usando alguna de las factorizaciones previas, determinar la
solución de Ax = b con:
 
6
11
b= 6

13
Usando LU, tenemos que Ax=b se transforma en LUx=b, teniendo
en cuenta las ecuaciones matriciales: Ly=b y Ux=Y.
1ero Ly=b
    
1 0 0 0 y1 6
1 1 0 0y2 11
1 0 1 0y3= 6  →
     − {y1 = 6
1 1 0 1 y4 13
1y1+1y2=11=y2=5
6+y3=5-y3=0
y4=-6-5+13=2
    
1 1 1 1 w 6
0 1 0 1 x   5 
0 0 2 0 y = 0 →
2do Ux=y      − {w + x + y + z = 6
0 0 0 3 z 2
x+z=5
2y=0
3z=2

2. Compare los métodos de Jacobi, Gauss Seidel y SOR en la


resolución del sistema de ecuaciones Ax = b. Para ello
i) Implemente los métodos en su versión básica x(n) = B + d
ii) Implemente los métodos en su versión iterativa (Bonus).
iii) Analice su Convergencia.
Sistema de prueba
I)

4
2x1 − x2 + 10x3 = 11
3x2 − x3 + 8x4 = 10
10x1 − x2 + 2x3 = 11
−x1 + 11x2 − x3 + 3x4 = 12
Solución:
a) Forma básica
-Transformamos a un sistema equivalente de la forma x=Bx+d
x1 = (11 + x2 − 10x3 )/2
x2 = (10 + x3 − 8x4 )/3
x3 = (11 − 10x1 + x2 )/2
x4 = (12 + x1 − 11x2 + x3 )/3
-Agrupando convenientemente para que el vector incognita
aparezca a ambos lados de la igualdad.
0x1 + 21 x2 − 5x3 + 0x4 + 11
 
  2
x1
x2   0x1 + 0x2 + 13 x3 − 83 x4 + 10
 
3

 = 
 x3  10 1 11 
− 2 x1 + 2 x2 + 0x3 + 0x4 + 2 

x4 1
x − 11
3 1
x + 13 x3 + 0x4 + 12
3 2 3

-Expresando el lado derecho en términos matriciales.


 11 
 1
  2
0 2
−5 0 x1
1 8  
 10 
0
 0 3
− x 2
3   =  
3
−5 1 0 0  x3   11 
2 2
1 11 1
3
−3 3
0 x4
4
Donde la primera matriz es B la segunda x y la última d.
-Al ejecutar el sistema iterativo x(n) = Bx(n−1) + d debemos definir
x(0) :

 
0
0
 
0
0

Entonces, procedemos a hallar x(1) ;

5
 11 
 1
  2
0 2
−5 0 0
1 8  
 10 
0 0 − 0 3
x(1) =
−5 1
3 3   +  
2
0 0  0  11 
2
1
3
− 11
3
1
3
0 0
4
 11 
2
 10 
3
x(1) = 
 11 
2
4

Ahora, para x(2) ;


 11   11 
 1

0 2
−5 0 2 2
 10 
1
 10 
0 0 − 83 
 3 
3
x(2) =
−5 1
3 + 
2
0 0  11 
2
 11 
2
1
3
− 11
3
1
3
0
4 4

− 39
 
2
 23 
− 6 
x(2) =  39 
 
− 2 
 
− 32
3

Procedemos a realizar el mismo proceso hasta x(5) tal que;


 1213   4378   178874 
12
− 9 73
 485   2723   6809 
 18   108   − 73 
x(3) =  1213 ; x(4) =  4378 ; x(5) =  178874 
     
 12  − 9   73 
     
91 740 16097
18
− 27
− 39

b) Método Jacobi
Para los siguientes métodos (Jacobi, Gauss Seidel y SOR) es
necesario conocer su matriz Triangular estrictamente inferior (L),
Diagonal (D) y Triangular estrictamente superior (U), tal que
A=L+D+U. Por ende:

6
 
2 −1 10 0
0 3 −1 8
A=  10 −1 2 0

−1 11 −1 3
     
0 0 0 0 2 0 0 0 0 −1 10 0
+D=0 3 0 0+U=0 0 −1 8
0 0 0 0    
=L= 10 −1 0 0 0 0 2 0 0 0 0 0
−1 11 −1 0 0 0 0 3 0 0 0 0
Además hay que conocer el vector b de términos independientes,

tal que:
 
11
10
b=
11

12

Para obtener la B de Jacobi (Bj) hay que aplicar la siguiente


fórmula: Bj = −D−1 (L + U ) donde;
1 
2
0 0 0
 0 31 0 0
D−1 = 0 0 1

2
0
0 0 0 13

Tal que;
1     
0 0 0
2
0 0 0 0 0 −1 10 0
0 1 0 0  0 0 0 0+0 0 −1 8
 
Bj=- 3
 0 0 1 0 *  10 −1 0
 
2
0  0 0 0 0
0 0 0 13 −1 11 −1 0 0 0 0 0
 1

0 2
−5 0
1
0 0 3
− 38 
Bj=
−5 1

2
−5 0 
1
3
− 11
3
1
3
0

Ahora, para hallar dj tenemos que: dj = −D−1 b

7
1   
2
0 0 0 11
 0 1 0 0  10
dj=- 3
 0 0 1 0 *11
  
2
0 0 0 13 12
 11 
−2
− 10 
dj= 3 
− 11 
2
−4

Una vez hallado Bj y dj podemos aplicar el siguiente algoritmo


x(n) = Bjx(n−1) + dj reemplazando por los valores conocidos, tal
que;
 1
    11 
0 2
−5 0 0 −2
1 8  
 0 0 − 0  − 10 
x(1) =  3 3 ∗   + 
−5 1 −5 0  0 − 11 
3 
2 2
1
3
− 11
3
1
3
0 0 −4
 11 
−2
 − 10 
x(1) =  3 
− 11 
2
−4

Realizamos el mismo patrón para x(2) tal que:


 1
  11   11 
0 2
−5 0 −2 −2
1 8   10 
 0 0 − 3  − 3  − 10
 
x(2) = 
−5 1 −5 0  ∗ − 11  + − 11 
3 3 
2 2 2
1 11 1
3
− 3 3
0 −4 −4
 61 
3
 11 
2
x(2) =  61 
 
3
 
41
9

Procedemos a realizar el mismo proceso hasta x(5) tal que;

8
 1253   55321   48860 
− 12 108
− 19
 235   1063   42905 
 − 27   − 108   154 
x(3) =  1253 ; x(4) =  55321 ; x(5) =  48860 
     
− 12   108  − 19 
     
− 191
18
− 67376
162
65376
175

c) Método Gauss-Seidel
Para este método iterativo es necesario conocer la B de
Gauss-Seidel (Bgs) que resulta de: Bgs = −(D + L)−1 ∗ U , tal que
   
2 0 0 0 0 0 0 0
0 3 0 0  0 0 0 0
D+L= +
0 0 2 0  10 −1 0 0

0 0 0 3 −1 11 −1 0
 
2 0 0 0
0 3 0 0
D+L=  10 −1 2 0

−1 11 −1 3
 1 
2
0 0 0

 0 1 
3
0 0
inv(D + L) =  5 1 1 
 

 2 6 2  0
 
− 23 − 76 61 13

Ahora;
1
 
2
0 0 0  
 1  0 −1 10 0
 0 3
0 0  0 0 −1 8
Bgs = −  5 1 1  ∗ 
  
− 2 6 2 0  0 0 0 0

− 23 − 67 16 13
 0 0 0 0

0 12 −5 0
 

1
− 38 
 
0 0 3
Bgs = 
 
5 151 4
0 − 2 6 − 3 
 
0 − 23 11
2
28
3

9
Por otra parte, se puede aplicar la siguiente relación para hallar
dgs, donde dgs = (D + L)−1 ∗ b
 1 
2
0 0 0  
 1  11
 0 3
0 0  10
dgs =  5 1 1  ∗ 
  
− 2 6 2 0  11

− 23 − 67 16 31
 12

 11 
2
 10 
 3 
dgs = 
− 61 

 3
− 79
6

A partir de esto, podemos aplicar el algoritmo


x(n) = Bgsx(n−1) + dgs, tal que:
0 12 −5 0
   11 
  2
1 8 0


0 0 3 3  0
  10 
   3 
 
x(1) =  4  ∗   +  61 

5 151
0 − 2 6 − 3  0 − 3 

2
0 −3 2 11 28
 0
3 − 79
6
 11 
2
 10 
 3 
x(1) = 
− 61 

 3
− 79
6

Ahora para x(2)


 1   11   11 
0 2
−5 0 2 2
1
− 38 
 10   10 
0 0
 
3
(2)
 3   3 
x = ∗   +  
0 − 5 151
− 34  − 61  − 61 
 2 6   3  3
2 11 28
0 −3 2 3
− 79
6
− 79
6

10
 653 
6
 95 
 3 
x(2) =  
− 3137 
 6 
− 2251
9

Repetimos las iteraciones hasta x(5) ;


 5271   843355   4807364

2 13 3

 26785 


 416238



 214488 

54 43
x(3)
 (4)   (5) 
= ; x =  ; x = 
 
−12924 −319522 −7905024

     
− 68175
13
−120372 −2887308

d) Método SOR
Para este método iterativo debemos definir un valor de w, en este
caso w=0,5, además debemos conocer la B de SOR (Bsor) que
resulta de: Bsor = −(D + wL)−1 ∗ (wU + (w − 1)D), tal que;
   
2 0 0 0 0 0 0 0
0 3 0 0 0 0 0 0
D + wL = 0 0 2 0 + 0, 5 ∗  10 −1 0 0
  
0 0 0 3 −1 11 −1 0
 
2 0 0 0
 0 3 0 0
D + wL =  5 − 2 2 0
 1 
 
− 21 11
2
− 1
2
3
 1 
2
0 0 0
1
 0 0 0
 
3
inv(D + wL) = 
− 5 1 1

 4 12 2
0

− 18 43
− 72 1
12
1
3
   
0 −1 10 0 2 0 0 0
0 0 −1 8  0 3 0 0
wU +(w −1)D = 0, 5∗ 
0 0 +(0, 5−1)∗  
0 0 0 0 2 0
0 0 0 0 0 0 0 3

11
1
 
−1 2
5 0
0 − 32 − 124 
 
wU + (w − 1)D =  
0
 0 −1 0 
3
0 0 0 −2

Entonces;
 1   1

2
0 0 0 −1 2
5 0
1
 0 0 0   0 − 23 − 12 4 
   
3
Bsor = − 
− 5 1 1
∗ 
 4 12 2
0  0
  0 −1 0 

1 43 1 1 3
− 8 − 72 12 3 0 0 0 −2
 1 1
− 52 0

2 4
1 1
 0 − 34 
 
2 6
Bsor = − 5 − 1 163 − 1 

 4 2 24 3
1 23 59 26
− 8 − 24 144 9

Para hallar la d de SOR podemos utilizar la siguiente relación,


dsor = w(D + wL)−1 b en donde;
 1 
2
0 0 0  
11
1
 0 0 0
 
3  ∗ 10
  
dsor = 0, 5 ∗ 
− 5 1 1 11
 4 12 2
0
12
− 81 − 43
72
1
12
1
3
 11 
4
 5 
 3 
dsor = 
 − 89 

 24 
− 175
144

A partir de esto, podemos hallar x(1) , tal que


x(n) = Bsorx(n−1) + dsor, entonces:

12
1 1
− 25
   11 
2 4
0   4
0
1 1 4  5 
 0 − 3  0  3 

(1) 2 6 ∗ +
x =
− 5 − 1 163 0  − 89 

 4 2 24
− 13 
  24 
1 23 59 26 0 175
− 8 − 24 144 9
− 144
 11 
4
 5 
 3 
x(1) = 
 − 89 
 24 
− 175
144

Asimismo para hallar x(2) ;


 1 1
− 25 11  11 
  
2 4
0 4 4
1 1
− 34 
 5   5 
 0
 
2 6
(2)
 3   3 
x = ∗   +  
− 5 − 1 163
− 31   − 89   − 89 
 4 2 24   24   24 
1 23 59 26
− 8 − 24 144 9
− 175
144
− 175
144
 221 
16
 1513 
 432 
x(2) =  
− 8321 
 254 
− 483
59

Para finalizar, repetimos esta iteración hasta x(5)


37065 69028 373487
     
401 105 79
 1513   14556   11038 
 432   619   227 
x(3) =  8321 ; x(4) =  87807 ; x(5) =
     
 101459 
− 254  − 50  − 8 
     
− 483
59
− 12050
49
− 13823
9

Como conclusión se puede observar que en nunguno de los métodos


iterativos el resultado converge, ya que a medida vamos
aumentando las iteraciones el resultado toma valores muy

13
diferentes al anterior. En este caso, solo bastó observar las 5
primeras iteraciones para notar su divergencia.

II) El sistema generado por este código, con n ≥ 10.


function[A,b]=Axb(n,k)
de=k+(n(n+1)/2); d=deones(n);
A=diag(diag(d));A(1,2:n)=2:n;A(2:n,1)=2:n;
b=sum(A(:,:));b=b’;
end

Para esta parte, el código utiliza como valor de n=10 y de k=4.


59 2 3 4 5 6 7 8 9 10 113
   
 2 59 0 0 0 0 0 0 0 0  61 
 3 0 59 0 0 0 0 0 0 0  62 
   
 4 0 0 59 0 0 0 0 0 0  63 
   
5 0 0 0 59 0 0 0 0 0   64 
   
A= b =  
6 0 0 0 0 59 0 0 0 0   65 
7 0 0 0 0 0 59 0 0 0   66 
   
8 0 0 0 0 0 0 59 0 0   67 
   
9 0 0 0 0 0 0 0 59 0   68 
10 0 0 0 0 0 0 0 0 59 69
a) Forma básica
-Transformamos a un sistema equivalente de la forma x=Bx+d
x1 = (113 − 2x2 − 3x3 − 4x4 − 5x5 − 6x6 − 7x7 − 8x8 − 9x9 − 10x10 )/59
x2 = (61 − 2x1 )/59
x3 = (62 − 3x1 )/59
x4 = (63 − 4x1 )/59
x5 = (64 − 5x1 )/59
x6 = (65 − 6x1 )/59
x7 = (66 − 7x1 )/59
x8 = (67 − 8x1 )/59
x9 = (68 − 9x1 )/59
x10 = (69 − 10x1 )/59
-Agrupando convenientemente para que el vector incognita
aparezca a ambos lados de la igualdad.

14
x1
 
 x2 
 x3 
 
 x4 
 
 x5 
 
 =
 x6 
x 
 7
x 
 8
x 
9
x10
2 3 4 5 6 7 8 9
0x1 − 59 x2 − 59 x3 − 59 x4 − 59 x5 − 59 x6 − 59 x7 − 59 x8 − 59 x9 − 10 113 

x +
59 10 59
2
− 59 x1 + 0x2 + 0x3 + 0x4 + 0x5 + 0x6 + 0x7 + 0x8 + 0x9 + 0x10 + 61
 

 59 

3 62

 − 59 x1 + 0x2 + 0x3 + 0x4 + 0x5 + 0x6 + 0x7 + 0x8 + 0x9 + 0x10 + 59 

 4


 − 59 x1 + 0x2 + 0x3 + 0x4 + 0x5 + 0x6 + 0x7 + 0x8 + 0x9 + 0x10 + 63 59


5 64

 − 59
x 1 + 0x 2 + 0x 3 + 0x 4 + 0x 5 + 0x 6 + 0x 7 + 0x 8 + 0x 9 + 0x 10 + 59


6
− 59 x1 + 0x2 + 0x3 + 0x4 + 0x5 + 0x6 + 0x7 + 0x8 + 0x9 + 0x10 + 65
 
 59

7
− 59 x1 + 0x2 + 0x3 + 0x4 + 0x5 + 0x6 + 0x7 + 0x8 + 0x9 + 0x10 + 66
 
59
 
 
8 67
− 59 x1 + 0x2 + 0x3 + 0x4 + 0x5 + 0x6 + 0x7 + 0x8 + 0x9 + 0x10 + 59
 
 
9

 − 59 x1 + 0x2 + 0x3 + 0x4 + 0x5 + 0x6 + 0x7 + 0x8 + 0x9 + 0x10 + 68 59


10 69
− 59 x1 + 0x2 + 0x3 + 0x4 + 0x5 + 0x6 + 0x7 + 0x8 + 0x9 + 0x10 + 59
-Expresando el lado derecho en términos matriciales.

2 3 4 5 6 7 8 9
0 − 59 − 59 − 59 − 59 − 59 − 59 − 59 − 59 − 10
 
59
 2
− 59 0 0 0 0 0 0 0 0 0  

  x1
− 3 0 0 0 0 0 0 0 0 0 
 59   x2 
x 
 4  
− 0 0 0 0 0 0 0 0 0 
 59  3 
 5   x4 
− 59 0 0 0 0 0 0 0 0 0 x 
 5 
  =

 6
− 59 0 0 0 0 0 0 0 0 0   x6 
 x 
− 7 0 0 0 0 0 0 0 0 0   7
 59 x 
 8  8 
− 0 0 0 0 0 0 0 0 0 
 x9
 
 59
0  x10
 9
− 59

0 0 0 0 0 0 0 0
 
− 10
59
0 0 0 0 0 0 0 0 0

15
 113 
59
 61 
 59 
 
 62 
 59 
 63 
 
 59 
 64 
 59 
 
 65 
 59 
 
 66 
 59 
 67 
 
 59 
 68 
 59 
 
69
59

Donde la primera matriz es B la segunda x y la última d.


Ahora, para ejecutar el sistema iterativo x(n) = Bx(n−1) + d
debemos definir x(0) :

0
 
0
0
 
0
 
0
 
0
 
0
 
0
 
0
0

Entonces, x(1) va a ser igual a:


x(1) =

16
2 3 4 5 6 7 8 9
0 − 59 − 59 − 59 − 59 − 59 − 59 − 59 − 59 − 10
 
59
 2
− 59 0 0 0 0 0 0 0 0 0  

  0
− 3 0 0 0 0 0 0 0 0 0 
 59  0
0
 4  
− 0 0 0 0 0 0 0 0 0 
 59
 0
 
 5
− 59 0 0 0 0 0 0 0 0 0  0
  +
  
 6
− 59 0 0 0 0 0 0 0 0 0  0
  0
− 7 0 0 0 0 0 0 0 0 0   
 59  0
 8  
− 0 0 0 0 0 0 0 0 0 
 0
 
 59
0  0
 9
− 59

0 0 0 0 0 0 0 0
 
− 10
59
0 0 0 0 0 0 0 0 0
 113 
59
 61 
 59 
 
 62 
 59 
 63 
 
 59 
 64 
 59 
 
 65 
 59 
 
 66 
 59 
 67 
 
 59 
 68 
 59 
 
69
59

17
 113 
59
 61 
 59 
 
 62 
 59 
 63 
 
 59 
 64 
 59 
x(1) =  65 
 
 59 
 
 66 
 59 
 67 
 
 59 
 68 
 59 
 
69
59

Repetimos las iteraciones hasta x(5)


     
0, 8897 1, 1009 0, 9878
0, 9689 1, 0037 0, 9966
     
     
0, 9535 1, 0056 0, 9948
     
     
0, 9224 1, 0075 0, 9931
     
     
0, 9069 1, 0093 0, 9914
x(2)
 (3)   (4) 
= ; x =  ; x =  ;
 
0, 8914 1, 0112 0, 8973
     
0, 8759 1, 0131 0, 9880
     
     
0, 8448 1, 0149 0, 9863
     
0, 8604 1, 0168 0, 9846
     
     
0, 8449 1, 0187 0, 9829

18
 
1, 0111
1, 0004
 
 
1, 0006
 
 
1, 0008
 
 
1, 0010
x(5) =
 
1, 0012

 
1, 0014
 
 
1, 0016
 
1, 0018
 
 
1, 0025

b) Método Jacobi
En este caso es necesario conocer la matriz Triangular
estrictamente inferior (L), Diagonal (D) y Triangular estrictamente
superior (U) de la matriz principal, tal que A=L+D+U. Por ende:

0 0 0 0 0 0 0 0 0 0
 
 2 0 0 0 0 0 0 0 0 0
 3 0 0 0 0 0 0 0 0 0
 
 4 0 0 0 0 0 0 0 0 0
 
 5 0 0 0 0 0 0 0 0 0
 
L=
 6 0 0 0 0 0 0 0 0 0

 7 0 0 0 0 0 0 0 0 0
 
 8 0 0 0 0 0 0 0 0 0
 
 9 0 0 0 0 0 0 0 0 0
10 0 0 0 0 0 0 0 0 0

19
59 0 0 0 0 0 0 0 0 0
 
 0 59 0 0 0 0 0 0 0 0 
 0 0 59 0 0 0 0 0 0 0 
 
 0 0 0 59 0 0 0 0 0 0 
 
 0 0 0 0 59 0 0 0 0 0 
 
+D=
 0 0 0 0 0 59 0 0 0 0 

 0 0 0 0 0 0 59 0 0 0 
 
 0 0 0 0 0 0 0 59 0 0 
 
 0 0 0 0 0 0 0 0 59 0 
0 0 0 0 0 0 0 0 0 59

0 2 3 4 5 6 7 8 9 10
 
0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 0
 
0 0 0 0 0 0 0 0 0 0
 
0 0 0 0 0 0 0 0 0 0
 
+U=
0 0 0 0 0 0 0 0 0 0

0 0 0 0 0 0 0 0 0 0
 
0 0 0 0 0 0 0 0 0 0
 
0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 0

Una vez realizado esto, procedemos a hallar la B de Jacobi donde


Bj = −D−1 (L + U )
1
0 0 0 0 0 0 0 0 0

59
1
 0 59 0 0 0 0 0 0 0 0
1
 0 0 59 0 0 0 0 0 0 0
 
1
 0 0 0 59 0 0 0 0 0 0
 
1
 0 0 0 0 59 0 0 0 0 0
 
D−1 =  1
0 0 0 0 0 0 0 0 0

59
0 0 0 0 0 1
 0 59
0 0 0
0 0 0 0 0 1
 0 0 59
0 0
0 0 0 0 0 1
0 0 0 59
0
1
0 0 0 0 0 0 0 0 0 59

Luego;

20
1
0 0 0 0 0 0 0 0 0

59
1
0 59
0 0 0 0 0 0 0 0
1
0 0 0 0 0 0 0 0 0
 
59
1
0 0 0 0 0 0 0 0 0
 
59
1
0 0 0 0 0 0 0 0 0
 
Bj=- 59 *
1
0 0 0 0 0 59 0 0 0 0
0 1
 0 0 0 0 0 59
0 0 0
0 1
 0 0 0 0 0 0 59
0 0
0 1
0 0 0 0 0 0 0 59
0
1
0 0 0 0 0 0 0 0 0 59
0 0 0 0 0 0 0 0 0 0 0 2 3 4 5 6 7 8 9 10
   
2 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
3 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
   
4 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
   
5 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
   
+
6 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
 
7 0 0 0 0 0 0 0 0 0
 0 0 0 0 0 0 0 0 0 0

 
8 0 0 0 0 0 0 0 0 0
 0 0 0 0 0 0 0 0 0 0

 
9 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
10 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0

Tal que;
2 3 4 5 6 7 8 9 10 
0 − 59 − 59 − 59 − 59 − 59 − 59 − 59 − 59 − 59

2
− 59 0 0 0 0 0 0 0 0 0 
 3
− 59 0 0 0 0 0 0 0 0 0 

 4
− 59 0 0 0 0 0 0 0 0 0 

 5
− 59 0 0 0 0 0 0 0 0 0 

Bj =  6
− 59 0 0 0 0 0 0 0 0 0 

− 7 0 0 0 0 0 0 0 0 0 
 59 
− 8 0 0 0 0 0 0 0 0 0 
 59 
− 9 0 0 0 0 0 0 0 0 0 
59
10
− 59 0 0 0 0 0 0 0 0 0
Por otro lado, para dj tenemos que dj = −D−1 b;

21
1
0 0 0 0 0 0 0 0 0 113
  
59
1
0 59
0 0 0 0 0 0 0 0   61 
1
0 0 0 0 0 0 0 0 0   62 
   
59
1
0 0 0 0 0 0 0 0 0   63 
   
59
1
0 0 0 0 0 0 0 0 0   64 
   
dj=- 59 * 
1
0 0 0 0 0 59
0 0 0 0   65 
1
  66 
0 0 0 0 0 0 59 0 0 0  

1
 67 
0 0 0 0 0 0 0 59 0 0 
 

1
0 0 0 0 0 0 0 0 59
0   68 
1
0 0 0 0 0 0 0 0 0 59
69
 113 
59
 61 
 59 
 
 62 
 59 
 63 
 
 59 
 64 
 59 
dj= 
 65 
 59 
 
 66 
 59 
 67 
 
 59 
 68 
 59 
69
59

A través de esto podemos hallar la iteración x(n) = Bjx(n−1) + dj


tal que;
x(1) =
2 3 4 5 6 7 8 9
0 − 59 − 59 − 59 − 59 − 59 − 59 − 59 − 59 − 10
 
59
2
− 59 0 0 0 0 0 0 0 0 0 
 3
− 59 0 0 0 0 0 0 0 0 0 

 4
− 59 0 0 0 0 0 0 0 0 0 

 5
− 59 0 0 0 0 0 0 0 0 0 

 6 ∗
− 59 0 0 0 0 0 0 0 0 0 
− 7 0 0 0 0 0 0 0 0 0 
 59 
− 8 0 0 0 0 0 0 0 0 0 
 59 
− 9 0 0 0 0 0 0 0 0 0 
59
− 10
59
0 0 0 0 0 0 0 0 0

22
 113 
59
   61 
0  59 
 
62 
0  59 
  
0  63


   59 
0  
   64 
0  59 
  +  65 
0  
0  59 
   66 
0  59 
   
0  67  
 59 
0  68 
 59 
69
59

1, 9153
 
1, 0339
 
 
 1,0508 
 
 
 1,0678 
 
 1,0847 
 
x(1) = 
 1,1017 
 
 
 1,1186 
 
 
 1,1356 
 
 1,1525 
 

1,1695

Realizamos el mismo procedimiento hasta x(9)

23
     
0, 8897 1, 1009 0, 9998
0, 9689 1, 0037 0, 9999
     
     
0, 9535 1, 0056 0, 9999
     
     
0, 9379 1, 0075 0, 9999
     
     
0, 9224 1, 0093 0, 9999
x(2)
 (3) 
= ; x =   ;(...); x(8) =  ;
   
0, 9069 1, 0112 0, 9999
     
0, 8914 1, 0131 0, 9999
     
     
0, 8759 1, 0149 0, 9999
     
0, 8604 1, 0168 0, 9999
     
     
0, 8449 1, 0187 0, 9999
 
1, 0001
1, 0000
 
 
1, 0000
 
 
1, 0000
 
 
1, 0000
x(9) =
 
1, 0000

 
1, 0000
 
 
1, 0000
 
1, 0000
 
 
1, 0000

c) Método Gauss-Seidel
Para este método iterativo hay que hallar la B de Gauss-Seidel
(Bgs) Bgs = −(D + L)−1 ∗ U , tal que;

24
2 3 4 5 6 7 8 9
0 − 59 − 59 − 59 − 59 − 59 − 59 − 59 − 59 − 10
 
59
4 6 8 10 12 14 16 18 20 
0 3481

 3481 3481 3481 3481 3481 3481 3481 3481 

0 6 9 12 15 18 21 24 27 30 
 3481 3481 3481 3481 3481 3481 3481 3481 3481 
 
0 8 12 16 20 24 28 32 36 40 
 3481 3481 3481 3481 3481 3481 3481 3481 3481 
 10
0 3481 15 20 25 30 35 40 45 50 
3481 3481 3481 3481 3481 3481 3481 3481 

Bgs = 

12 18 24 30 36 42 48 54 60 
0 3481 3481 3481 3481 3481 3481 3481 3481 3481 
 
0 14 21 28 35 42 49 56 63 70 
 3481 3481 3481 3481 3481 3481 3481 3481 3481 
 
0 16 24 32 40 48 56 64 72 80 
 3481 3481 3481 3481 3481 3481 3481 3481 3481 
 18
0 3481 27 36 45 54 63 72 81 90 
3481 3481 3481 3481 3481 3481 3481 3481 


20 30 40 50 60 70 80 90 100
0 3481 3481 3481 3481 3481 3481 3481 3481 3481

Ahora hay que hallar dgs = (D + L)−1 ∗ b tal que;


 113 
59
 3373 
 3481 
 
 3319 
 3481 
 3265 
 
 3481 
 3211 
 3481 
dgs= 
 3157 
 3481 
 
 3103 
 3481 
 3049 
 
 3481 
 2995 
 3481 
2941
3481

Con estos datos, utilizamos el algoritmo x(n) = Bgsx(n−1) + dgs


para hallar la respectiva solución:

25
2 3 4 5 6 7 8 9 10 
0 − 59 − 59 − 59 − 59 − 59 − 59 − 59 − 59 − 59

4 6 8 10 12 14 16 18 20 
0 3481

 3481 3481 3481 3481 3481 3481 3481 3481 

0 6 9 12 15 18 21 24 27 30 
 3481 3481 3481 3481 3481 3481 3481 3481 3481 
 
0 8 12 16 20 24 28 32 36 40 
 3481 3481 3481 3481 3481 3481 3481 3481 3481 
 10
0 3481 15 20 25 30 35 40 45 50 
3481 3481 3481 3481 3481 3481 3481 3481 

x(1) = 60  ∗

12 18 24 30 36 42 48 54
0 3481 3481 3481 3481 3481 3481 3481 3481 3481 
 
0 14 21 28 35 42 49 56 63 70 
 3481 3481 3481 3481 3481 3481 3481 3481 3481 
 
0 16 24 32 40 48 56 64 72 80 
 3481 3481 3481 3481 3481 3481 3481 3481 3481 
 18
0 3481 27 36 45 54 63 72 81 90 
3481 3481 3481 3481 3481 3481 3481 3481 


20 30 40 50 60 70 80 90 100
0 3481 3481 3481 3481 3481 3481 3481 3481 3481
 113 
59
   3373 
0  3481 
 
3319 
0 
   3481 

0  3265 
   3481 
0  
   3211 
0  3481 
  +  3157 
0  
0  3481 
   3103 
0  3481  
  
0  3049  
 3481 
0  2995 
 3481 
2941
3481

26
1,9153
 
0,9689
 
 
0,9535
 
 
0,9379
 
0,9224
 
x(1) =
0,9069

 
 
0,8914
 
 
0,8759
 
0,8603
 
 
0,8449

Ahora realizamos la iteración hasta x(9)


     
1, 1009 1, 0111 1, 0000
0, 9966 0, 9996 0, 9999
     
     
0, 9948 0, 9994 0, 9999
     
     
0, 9932 0, 9992 0, 9999
     
     
0, 9914 0, 9906 0, 9999
x(2) = 
 (3) 
; x =   ;(...); x(8) =  ;
   
0, 9897 0, 9887 0, 9999
     
0, 9880 0, 9985 0, 9999
     
     
0, 9863 0, 9949 0, 9999
     
0, 9856 0, 9983 0, 9999
     
     
0, 9829 0, 9981 0, 9999

27
 
1, 0000
0, 9999
 
 
0, 9999
 
 
0, 9999
 
 
0, 9999
x(9) =
 
0, 9999

 
0, 9999
 
 
0, 9999
 
0, 9999
 
 
0, 9999

d) Método SOR
Para este método iterativo utilizaremos w=0,5, además debemos
conocer la B de SOR (Bsor) que resulta de:
Bsor = −(D + wL)−1 ∗ (wU + (w − 1)D), tal que;

1 1 3 2 5 3 7 4 9 5
− 59 − 118 − 59 − 118 − 59 − 118 − 59 − 118 − 59
 
2
 1 3481 3 2 5 3 7 4 9 5 
 − 118 6962 6962 3481 6962 3481 6962 3481 6962 3481 
 
− 3 3 2711 3 15 9 21 6 27 15 
 6962 6962 2711 3481 13924 6962 13924 3481 3481 6962 
 1 2 3 3489 5 6 7 8 9 10 

−
 59 3481 3481 6962 3481 3481 3481 3481 3481 3481 
 5 5 15 5 3773 15 35 10 45 25 
 − 236 6962 3481 6962 7519 6962 13924 3481 13924 6962 

Bsor= 3

3 9 6 15 3499 21 12 27 15 
 − 118 3481 6962 3481 6962 6962 6962 3481 6962 3481 
 
− 7 7 21 7 35 21 2647 14 63 35 
 118 6962 13924 3481 13924 6962 5257 3481 13924 6962 
 2 4 6 8 10 12 14 3513 18 20 

−
 59 3481 3481 3481 3481 3481 3481 6962 3481 3481 
 9 9 27 9 45 27 63 18 2652 45 
 − 236 6962 13924 3481 13924 6962 13924 3481 5243 6962 


5 5 15 10 25 15 35 20 45 3531
− 118 3481 6962 3481 6962 3481 6962 3481 6962 6962

Para hallar la d de SOR empleamos dsor = w(D + wL)−1 b en


donde;

28
 113 
118
 1743 
 3481 
 
 1628 
 3249 
 3491 
 
 6962 
 3773 
 7519 
dsor= 
 1748 
 3481 
 
 2299 
 4575 
 3501 
 
 6962 
 545 
 1083 
1753
3481

Con estos datos podemos encontrar x(n) = Bsorx(n−1) + dsor para


hallar la solución:
x(1) =
1 1 3 2 5 3 7 4 9 5 
− 59 − 118 − 59 − 118 − 59 − 118 − 59 − 118 − 59

2
 1 3481 3 2 5 3 7 4 9 5 
 − 118 6962 6962 3481 6962 3481 6962 3481 6962 3481 
 
− 3 3 2711 3 15 9 21 6 27 15 
 6962 6962 2711 3481 13924 6962 13924 3481 3481 6962 
 1 2 3 3489 5 6 7 8 9 10 

−
 59 3481 3481 6962 3481 3481 3481 3481 3481 3481 
 5 5 15 5 3773 15 35 10 45 25 
 − 236 6962 3481 6962 7519 6962 13924 3481 13924 6962 

15 ∗

 3 3 9 6 15 3499 21 12 27
 − 118 3481 6962 3481 6962 6962 6962 3481 6962 3481 
 
− 7 7 21 7 35 21 2647 14 63 35 
 118 6962 13924 3481 13924 6962 5257 3481 13924 6962 
 2 4 6 8 10 12 14 3513 18 20 

−
 59 3481 3481 3481 3481 3481 3481 6962 3481 3481 
 9 9 27 9 45 27 63 18 2652 45 
 − 236 6962 13924 3481 13924 6962 13924 3481 5243 6962 


5 5 15 10 25 15 35 20 45 3531
− 118 3481 6962 3481 6962 3481 6962 3481 6962 6962

29
 113 
118
   1743 
0  3481 
 
1628 
0  3249 
  
0  3491


   6962 
0  
   3773 
0  7519 
  +  1748 
0  
0  3481 
   2299 
0  4575  
  
0  3501  
 6962 
0  545 
 1083 
1753
3481

0,9576
 
0,5007
 
 
0,5011
 
 
0,5014
 
0,5018
 
x(1) =
0,5022

 
 
0,5025
 
 
0,5029
 
0,5032
 

0,5036

Ahora realizamos la iteración hasta x(9)

30
     
1, 2064 1, 2222 1, 0365
0, 7468 0, 8697 0, 9940
     
     
0, 7453 0, 8669 0, 9929
     
     
0, 7437 0, 8643 0, 9919
     
     
0, 7421 0, 8616 0, 9908
x(2)
 (3) 
= ; x =   ;(...); x(8) =  ;
   
0, 7406 0, 8589 0, 9898
     
0, 7390 0, 8563 0, 9888
     
     
0, 7374 0, 8536 0, 9877
     
0, 7359 0, 8509 0, 9867
     
     
0, 7343 0, 8483 0, 9857
 
1, 0234
0, 9966
 
 
0, 9959
 
 
0, 9951
 
 
0, 9945
x(9) =
 
0, 9937

 
0, 9930
 
 
0, 9923
 
0, 9916
 
 
0, 9909

31
Descripción
Método
Jacobi obtiene los valores en una iteración y los utiliza
hasta en la siguiente para volver a obtener los valores
mas aproximados. Si la matriz de coeficientes original
del sistema es diagonalmente dominante el método con-
Jacobi verge. Si el radio espectral de la matriz original es menor
a uno, el método converge. El método no siempre con-
verge y calcular el radio espectral de la matriz puede ser
muy extenso.
El metodo de Gauss-Seidel utiliza los valores obtenidos
de las incognitas de iteraciones pasadas para despejar las
actuales. este método puede aplicarse a cualquier siste-
Gauss-
ma de ecuaciones lineales que produzca una matriz de
Seidel
coeficientes con los elementos de su diagonal no-nulos.
El metodo de Gauss Seidel converge mas rápido.
Este método intenta mejorar la convergencia del método
de Gauss- Seidel mediante el refinamiento de la apro-
ximación actual. Proporciona mayor probabilidad de
SOR
convergencia para los sistemas. Da mayor rapidez que
Gauss-Seidel a algunos de los métodos.

32

También podría gustarte