Académique Documents
Professionnel Documents
Culture Documents
(UNMSM)
Apellidos y nombres
Matricula
13190148
13190149
13190063
Curso
LABORATORIO DE METODOS
NUMERICOS
tema
SOLUCIN DE SISTEMA DE
ECUACIONES LINEALES Y NO
LINEALES
Mtodos Directos
1). Dado el sistema lineal de ecuaciones:
3x1 x3=5
x1 + 2x2 x3 =2
-x1 + x2+ ( + 1)x3=1
Indique para cuales valores de el sistema tiene una solucin.
Solucin:
Dado el sistema lineal de ecuaciones:
3 x1 x3 =5
Xx 1+2 x 23 x 3=2
x 1 + x 2+(X +1) x 3 =1
Sea :
3 0
A= X 2
1 1
1
3
X +1
3 0
X 2
1 1
1
3 =0
X +1
Hallando el det(A)
5X+7~=0
X~= -7/5 =-1.4
Cdigo
clc, clear
for i=2:3
for j=i:3
A(i-1,:)=A(i-1,:)+A(j,:)*(-A(i-1,j)/A(j,j));
A;
end
end
%Sustitucion hacia atras.
for i=3:-1:1
X(i)=A(i,3+1);
for j=i+1:3
X(i) = X(i) - X(j)*A(i,j);
end
X(i) = X(i)/A(i,i);
end
if det(M)~=0
disp('Se ha encontrado el valor de las incognitas: ')
X
A
else
end
a1,1 =
1
1
=
1+1 2
a1,2 =
1
1
=
1+2 3
a1,3 =
1
1
=
1+1 4
a2,1 =
2
2
=
2+1 3
a2,2 =
2
1
=
2+2 2
a2,3 =
2
2
=
2+3 5
a3,1 =
3
3
=
3+1 4
a3,2 =
3
3
=
3+ 2 5
a3,3 =
3
1
=
3+ 3 2
b1=21=2
b2=22=4
b3 =23=6
Por tanto el Sistema es el siguiente:
[ ]
1
2
2
3
3
4
1
3
1
2
3
5
1
4
x1
2
2
x2 = 4
5
x3
6
1
2
[ ][]
1
2
2
3
3
4
1
3
1
2
3
5
1
4
2
2
4
5
6
1
2
f 2=f 2
f1
(2 /3)
1/2
f 3=f 3
1
2
0
0
1
3
1
18
1
10
1
4
1
15
1
8
f 3=f 3
1
2
0
0
1
3
1
18
0
f 1=f 1
1
2
1
18
f 1=f 1
1
2
1
18
f 2=f 2
f1
(3/4 )
1/2
2
4
3
3
f2
(1/10)
1/18
1
4
1
15
1
200
2
4
3
3
5
f2
(1/3)
1/ 18
3
20
1
15
1
200
6
4
3
3
5
f3
(3/20)
1/200
0 12
4
1
3
15
3
1
5
200
f3
(1 /15)
1/200
1
2
1
18
12
20
0
3
3
1
5
200
[ ] []
1
2
1
18
12
20
x1
0 x2 = 3
x3
3
1
5
200
[]
x 1=
12
=24
1
2
20
3
x 2=
=120
1
18
3
5
x 3=
120
1
200
3. Los puntos (x, y): (1, 3) (2, 5) (4, 2) (5, 4) pertenecen a la siguiente
funcin:
f ( x )=a 1 x 2+ a2 e0.1 x + a3 x+ a4
a) Escriba el sistema de ecuacin con los puntos dados.
a1 (1)+a2 (1.105170918)+ a3 1+ a4 =3
1
0
0 0
D=0 1.2214 0 0
0
0
4 0
0
0
0 1
0
0
0
0
0
L= 4
16 1.4918 0
25 1.6487 5
0
0
0
0
0 1.1052 1 1
0
2 1
U= 0
0
0
0 1
0
0
0 0
3
b=5
2
4
alfa=D (L+U )
0
1.1052
1 1
0
1.6375 0.8187
alfa=32749
4
0.373
0
0.25
25
1.6487
5
0
3.1052
||alfa||= 5.7311
4.623
31.6487
||alfa||max=31.6487 >1
Por lo tanto no converge y no se sigue con el procedimiento
0.010 0.005
0.025 0.032
0.010 0.005
0.025 0.032
0.01 0.005 1 0
0.025 0.032 0 1
1
0.5 100 0
0 0.0195 2.5 1
1
0.5 100 0
0 0.0195 2.5 1
1 0 164.1026 25.6410
0 1 128.2051 51.2821
]
]
100(f 1)
f 22.5( f 1)
]
]
25.6410 ( f 2 ) +(f 1)
39
(f 2)
2000
1 0 164.1026 25.6410
0 1 128.2051 51.2821
I = 164.1026 25.6410
128.2051 51.2821
b. Calcule el nmero
condicionada?
de
condicin.
K ( A )= A1 A
A= 0.010 0.005
0.025 0.032
|a1 j|=|0.010|+|0.005|=0.015
j=1
|a2 j|=|0.025|+|0.032|=0.057
j=1
I=
164.1026 25.6410
128.2051 51.2821
|I 1 j|=|164.1026|+|25.6410|=189.7436
j=1
|I 2 j|=|128.2051|+|51.2821|=179.4872
j=1
][ ] [ ]
1 1/2 1 /3 x1
4
=
1 /4 1/5 1/6 x2
5
1/7 1/8 1/9 x3
6
Es
una
matriz
mal
SOLUCIN:
a) Resuelva el sistema usando el mtodo de Gauss-Jordan. Simultneamente encuentre la
inversa de la matriz.
[
[
[
[
1 1/2 1/3
1 /4 1/5 1/6
1/7 1/8 1/9
]
]
]
f 21/4 (f 1)
1
f 3 (f 1)
7
4
5
6
1 1/2 1/ 3
4
0 3/40 1/12 4
0 3 /56 4 /63 38/7
40/3(f2)
1 1/ 2 1/3
4
1 10/9 160/3
0
0 3 /56 4 /63 38/7
f 33 /56 (f 2)
1 1/2 1/3 4
0 1 10 /9 160/3 252( f 3)
0 0 1/252 18/7
[ ]
[ ]
[ ]
[ ]
1 1/ 2 1 /3 4
f 210 /9( f 3)
0 1 1/10 160 /3
648
0
0 1
1 1/2 1 /3
4
1
f 1 (f 2)
1 0 2000/3
0
2
648
0
0 1
1 0 1/3 1012/3
1
f 1 (f 3)
2000/3
1
0
0
3
648
0 0 1
1 0 0 364 /3
0 1 0 2000/3
648
0 0 1
X1= 364/3 ; X2= -2000/3 ; X3= 648.
[
[
[
[
1 1/2 1/3
1 /4 1/5 1/6
1/7 1/8 1/9
][ ]
1 0 0 f 21 /4(f 1)
0 1 0 f 3 1 ( f 1)
7
0 0 1
1 1/2 1/ 3
1
0 0
40 /3 (f 2)
0 3/40 1/12 1/4 1 0
0 3 /56 4 /63 1 /7 0 1
][
][
1 1/2 1/3
1
0 0
1 10/9 10/3 40/3 0 f 33 / 56( f 2)
0
0 3 /56 4 /63 1/7
0 1
][
1 1/2 1/3
1
0 0
0 1 10 /9 10/ 3 40/3 0 252(f 2)
0 0 1/252 1/28 5/7 1
[ ][
[ ][
[ ][
[ ][
1 1/ 2 1 /3
1
0 0
f 210 /9 (f 3)
0 1 10/9 10 /3
40 /3 0
0
9
0 1
180 252
1 1/ 2 1 /3
1
0 0
f 11/2( f 2)
1 0
0
40/3 640/3 280
0
9
0 1
180 252
1 0 1/3 23 /3
320 140
f 11/3(f 2)
0 1 0 40 /3 640/3 280
0 0 1
9
180 252
1 0 0 14 /3 140/3 56
f 11/3( f 2)
0 1 0 40/3 640 /3 280
0 0 1
9
180 252
14 / 3 140/3 56
40/3 640 /3 280
9
180 252
b) Modifique la matriz de coeficientes sustituyendo el valor de elemento a 1,1 con el valor 0.9.
Resuelva nuevamente el sistema. Encuentre la variacin en la solucin calculada.
[
[
10 / 9( f 1)
1 5/9 10/27 40 /9
f 21/4 (f 1)
5
1 /4 1/ 5 1 /6
6 f 31/7(f 1)
1/7 1/ 8 1/9
1
5/9 10/27
40/9
180
(f 2) ;
0 11 /180 2/27 35 /9
11
1
5/9 10/27
40/9
f 323/504( f 2)
700/11
0
1 40 /33
[
[
[
[
]
]
1 5 /9 10/27 40/9
693(f 3)
0 1 40/33 700/11
1 5 /9 10/ 27 40 /9
f 240/ 33( f 3)
0 1 40/33 700/11
3411 /4
0
0 1
]
]
1 5 /9 10/ 27 40 /9
f 15 /9(f 2)
970
1 0
0
3411 /4
0
0 1
1 0 10/27 1630 /3
f 110 /27 (f 3)
970
1 0
0
0
0 1 3411 /4
[ ]
1 0 0 455 /2 X 1
0 1 0 970 X 2
0 0 1 3411 /4 X 3
X1= 455/2 ; X2= -970 ; X3= 3411/4
La variacin de la solucin encontrada es:
[][ ][
][ ][
x1
x 1
121.3333
227.5
106.1667
=
x2
x 2 666.6667
970
303.3333
648
852.75
204.75
x 3
x3
K ( A )= A1 A
1 1/2 1 /3
A= 1/4 1/5 1 /6
1/7 1/8 1/9
|a1 j|=|1|+|0.5|+|0.3333|=1.83333
j=1
3
|a2 j|=|0.25|+|0.2|+|0.16666|=0.86666
j=1
|a3 j|=|0.1428|+|0.125|+|0.1111|=0.3798
j=1
14 /3
140/3 56
I = 40 /3 640/ 3 280
9
180 252
| || |
640
+|
+|280|=506.6666
|I |=|40
|
3
3 |
140
+
+|56|=107.3334
|I 1 j|= 14
3
3
j=1
3
j=1
|I 3 j|=|9|+|180|+|252|=441
j=1
e=
Ea
A
=0.01
cond ( a )=928.8889
(Nmero de condicin)
Sistemas singulares:
Solucin:
La funcin slin es un instrumento computacional que nos ayuda para resolver sistemas
singulares. Tal funcin est especificada en el siguiente cdigo:
function [x,a]=slin(a,b)
[n,m]=size(a);
z=max(max(a));
v=[n+1:m];
a(1:n,m+1)=b;
%Matriz aumentada
if n>m
x=[ ];
a=[ ];
return;
end
a=a/z;
for e=1:n
[z,p]=max(abs(a(e:n,e)));
p=p+e-1;
t=a(e,e:m+1);
%Cambiar filas
a(e,e:m+1)=a(p,e:m+1);
a(p,e:m+1)=t;
if abs(a(e,e))<1.0e-10
v=[v, e];
%Sistema singular
%Agregar variable libre y continuar
else
a(e,e:m+1)=a(e,e:m+1)/a(e,e); %Normalizar la fila e
for i=1:n
if i~=e
a(i,e:m+1)=a(i,e:m+1)-a(i,e)*a(e,e:m+1);
end
end
end
end
x=[ ];
if length(v)==0;
x=a(1:n,m+1);
a(:,m+1)=[ ];
return;
end
Dependiendo del valor asignado a x6, este sistema tiene infinitas soluciones.
Mtodos Iterativos:
3. La distribucin de dinero a 16 comunidades se describe en el
siguiente cuadro. No fue posible contactar a cinco comunidades X1,
X2, X3, X4 y X5 por lo que se decidi asignar a ellas el promedio del
valor asignado a las comunidades que estn a su alrededor, por
ejemplo, X1 recibir el promedio de 30 + X2 + X3 + 45 +50.
Determine cules son los valores que sern asignados a estas cinco
comunidades.
50
X1
30
40
45
X3
X2
25
60
X4
X5
10
55
20
15
35
Solucin:
Sea el sistema de ecuaciones:
5 X 1X 2 X 3+ 0 X 4+ 0 X 5=125
X 1X 2+8 X 3 X 4X 5=185
X 1+ 8 X 2X 3 X 4X 5=105
0 X 1X 2X 3+8 X 4 X 5=195
0 X 1X 2X 3 X 4+8 X 5=105
Lo resolveremos como sigue a continuacin:
5
1
( 1
0
0
det
det
det
det
1 1 0
0
1 8 1 1
8 1 1 1 )
1 1
8 1
1 1 1 8
S=det
125
125
( 105
195
105
1
1
8
1
1
1 0
0
8 1 1
1 1 1 )
1 8 1
1 1 8
S
x 1=
5
1
( 1
0
0
125
125
105
195
105
5
1
( 1
0
0
1
1
1
8
1
5
1
( 1
0
0
1
1
1
8
1
1 0
0
8 1 1
1 1 1 )
1
8 1
1 1 8
S
x 2=
125 0
0
125 1 1
105 1 1 )
195
8 1
105 1 8
S
x 3=
1
8
1
1
1
S
x 4=
125 0
125 1
105 1 )
195 1
105 8
det
5
1
( 1
0
0
1 0 125
8 1 125
1 1 105 )
1
8 195
1 1 105
S
x 5=
1
1
1
8
1
Por lo tanto:
+ k3
e 0 .15 x
10 100 4.4817
( 15 225 9.4877 )
20 400 20.0855
S=det
25 100 4.4817
( 15 225 9.4877 )
650 400 20.0855
det
S
K 1=
10 25 4.4817
( 15 15 9.4877 )
20 650 20.0855
det
S
K 2=
10 100 25
( 15 225 15 )
20 400 650
det
S
K 3=
Por lo tanto:
K1 = -17.3251
; K2 = -2.2422
K3 = 94.2653
+ 94.2653
0 .15 x
Graficando:
+ 94.2653
0 .15 x
ey
xy= 5
x2
y2
3xy= 7
3 (x2)
- 2 ( y3)
=5xy
Solucin: