Beruflich Dokumente
Kultur Dokumente
ARMADAS - ESPE
Diego Quispe
3 de enero de 2016
1
x
1
. 1 =
3
x2
1
n=2
ops = 3
1
0,333
3
2x1 + x2 = 1
x2 =
2x1 + (0,333) = 1
2x1 = 1,333
x1 = 0,666
2
0
0
1
5
0
x1
3
1
2 . x2 = 2
x3
1
4
n = 3, ops = 5
x3 =
1
0,250
4
5x2 + 2x3 = 2
5x2 + 2(0,250) = 2
5x2 = 1,500
x2 = 0,300
2x1 + x2 + x3 = 3
2x1 = 2,450
x1 = 1,225
ops = 2(n 1) + 1
ops = 2n 1
Ejercicio 2: En el sistema siguiente, pruebe que Ax = B es equivalente al
sistema triangular superior U x = y que se da y hallar su solucion.
4 8 4
1 5 4
1 4 7
1 3 0
Seg
un la teria quedara de esta
4 8
1 5
1 4
1 3
x1
0
8
x2 4
3
. =
2 x3 10
2
4
x4
forma
4
4
7
0
0
3
2
2
8
4
10
4
4 8
4
0
8
1 5
4 3
4
1 4
7
2
10
0 1 7 4
14
f4 f3 = f4
4
1
0
0
8
4
5
4
1
3
1 7
0
3
5
4
f3 f2 = f3
8
4
14
14
4
0
0
0
8
3
1
1
4
3
3
7
8
6
14
14
0
3
5
4
1
f2 f1 = f2
4
4 8
0 3
0 1
0 0
8
6
14
28
4
0
3
3
3
5
10 9
f4 f3 = f4
4
0
0
0
8
3
0
0
8
6
12
28
4
0
3
3
4
4
10 9
1
f3 f2 = f3
3
4
0
0
0
8
3
0
0
4
3
4
0
0
3
4
0,4
8
6
12
0,8
2
f4 + f3 = f4
5
4 8 4
0 3 3
0 0 4
0 0 0
0
3
4
1
8
6
12
2
5
= f4
2
Despues de obtener nuestra matriz triangular superior solicitada y procedemos a resolverla
x1 x2 x3 x4
B
4
8
4
0
8
3
3
3
6
0
0
4
4
12
0
0
0
1
2
f4
x4 = 2
4x3 + 4x4 = 12
4x3 = 12 4(2)
4x3 = 4
x3 = 1
3x2 = 3x : 3 3x4 = 6
3x2 + 3(2) 3(2) = 6
3x2 = 3
x3 = 1
x1 + 8x2 5x3 = 3
3x1 2x2 + 3x3 = 1
2x1 + 3x2 x3 = 4
Soluci
on
1
3
2
8 5
x1
3
2 3 . x2 = 1
3 1
x3
4
1 8 5 3
3 2 3 1
2 3 1 4
1
8
5 3
3 2
3
1
0 13 9 2
f 3 2f 1 = f 3
1
0
0
5
18
9
8
26
13
3
8
2
f 2 3f 1 = f 3
1
0
0
8
5
26 18
0
0
3
8
4
f 2 2f 3 = f 3
Como podemos ver la ultima fila se ha llenado con lavores de 0, esto nos
indica que el sistema propuesto no tiene solucion.
=5
x1 +x2
2x1 x2 +53
= 9
3x2 4x3 +2x4 = 19
2x3
+6x4 = 2
Pasamos a la forma Ax = B
1 1
2 1
0 3
0 0
0
5
4
2
x1
0
5
0
. x2 = 9
2 x3 19
6
x4
2
Seg
un la teria quedara de esta forma
1 1
0
2 1 5
0 3 4
0 0
2
Empezamos las operaciones en
triangular superior solicitada.
1 1
0 3
0 3
0 0
0
0
2
6
5
9
19
2
0
0
2
6
f 2 2f 1 = f 2
6
5
19
19
2
1
0
0
0
1
3
0
0
0 0
5 0
1 2
2 6
5
19
0
2
f3 + f2 = f3
1
0
0
0
1
3
0
0
0 0
5 0
1 2
0 2
5
19
0
2
f 4 2f 3 = f 4
Despues de obtener nuestra matriz triangular superior solicitada y procedemos a resolverla
x1 x2 x3 x4 1 1
0
0
5
0 3 5
0
19
0
0
1
2
0
0
0
0
2
2
x4 = 1
x3 + 2x4 = 0
x3 = 2(1)
x3 = 2
3x2 + 5x3 = 19
3x2 = 19 5(2)
x2 = 3
x1 + x2 = 5
x1 = 5 x2
x1 = 2
1
0
0
4
3
0
2
4
1
1 4 2 | 1 0 0
0 3 4 | 0 1 0
0 0 1 | 0 0 1
Ahora procedemos a sacar la inversa de la matriz con operaciones entre filas
1
0
0
4
3
0
| 1
| 0
| 0
0
4
1
2
0
1
0
1
0
f 1 2f 3 = f 1
1
0
0
4
3
0
| 1
| 0
| 0
0
0
1
2
4
1
0
1
0
f 2 4f 3 = f 2
0,750
0,000
0,000
0
3
0
0
0
1
| 0,750 1
| 0,000 1
| 0,000 0
2,50
4
1
0,750f 1 f 2 = f 1
1
0
0
0
1
0
0
0
1
| 1
| 0
| 0
1,333 3,333
1,3331 1,333
0
1
donde;
A1
1
= 0
0
1,333
1,3331
0
8
3,333
1,333
1
2 3
4
0
A=
16 4
0
7
8
1
2
1
1
1
1
10
,b =
1
1
1
5
Soluci
on
Primero triangular la matriz
2
0
0
0
A
3
6
28
7
8
15
66
1
1
12
7
5
f 3 = f 3 8f 1
f 2 = f 2 2f 1
2
0
0
0
3
6
28
0
8
15
66
33/2
1
12
7
19
f 4 = f 4 7/6f 2
2
0
0
0
3
6
0
0
8
1
15
12
4
49
0
1465/8
f 3 = f 3 14/3f 2
f 4 = f 4 33/8f 3
P A = LU
P =I
A = LU
2
0
0
0
3
6
28
7
8
15
66
1
1
1
12
= 2
7 8
0
5
2
0
0
0
1
0
0
. 0
14/3
1
0 0
0
7/6 33/8 1
3
6
0
0
8
1
15
12
4
49
0
1465/8
MX = B
LU X = B
UX = Y
LY = B
1
0
0
0
X1
1
2
X2 1
1
0
0
. =
8 14/3
1
0 X3 1
0 7/6 33/8 1
X4
1
Y1 = 1
2Y1 + Y2 = 1
Y2 = 1 2(1)
Y2 = 1
8Y1 + 14/3Y2 + Y3 = 1
Y3 = 1 8(1) 14/3(1)
Y3 = 7/3
7/6Y2 + 33/8Y3 + Y 4 = 1
Y 4 = 1 7/6(1) 33/8(7/3)
Y4 = 283/24
2
0
0
0
3
6
0
0
X1
1
8
1
15
12
. X2 = 1
4
49 X3 7/3
283/24
0
1465/8
X4
X4 = 0,0643
4X3 + 49X4 = 7/3
X3 = 7/349(0,0643)
4
x3 = 0,2043
6x2 15x3 12x4 = 1
x2 = 1+15(0,2043)+12(0,0643)
6
x2 = 0,215
10
2
0,0732
1
0,3678
0
2
0 0,0732
L(3, 0) =
1
x(x + 1)(x 2)
= (x3 x2 2x)
8
8
L(3, 1) =
L(3, 2) =
x(x + 2)(x 2)
1
= (x3 4x)
3
3
x(x + 1)(x22)
1
= (x3 + 3x2 + 2x)
24
24
f (x)dx
2
40
0,63
60
1,36
80
2,18
100
3,00
120
3,93
140
6,22
160
8,59
a) Por interpolaci
on polinomial simple.
b) Por interpolaci
on de Lagrange. (Aplicando el Programa).
c) Construya solo la matriz de diferencias divididas para aproximar todos los
puntos de la tabla.
d) Evaluar el polinomio interpolador de Newton.
a)
40 60 :
S1 =
(1,630,63)
(6040)
(x 60) + 1,36
S1 = 0,0365x 0,83
60 80 :
S2 =
(2,181,36)
(8060)
(x 80) + 2,18
S2 = 0,041x 1,1
80 100 :
S3 =
(32,18)
(10080)
(x 100) + 3
S3 = 0,041x 1,1
100 120 :
S4 =
(3,933)
(120100)
(x 120) + 3,93
S4 = 0,0465x 1,65
120 140 :
S5 =
(6,223,93)
(140120)
(x 140) + 6,22
S5 = 0,1145x 9,81
12
140 160 :
S6 =
(8,596,22)
(160140)
(x 160) + 8,59
S6 = 0,1185x 10,37
S(x)=
0,0365x 0,83
0,041x 1,1
0,041x 1,1
0,0465x 1,65
0,1145x 9,81
0,1185x 10,37
40 60
60 80
80 100
100 120
120 140
140 160
S(90)=
2,455
2,59
2,59
2,535
0,495
0,295
40 60
60 80
80 100
100 120
120 140
140 160
b)
Presentacion en Matlab
>> x=[40 60 80 100 120 140 160]
x =
40
60
80
100
120
140
160
1.3600
2.1800
3.0000
>> cont=interpolLagrange(x,fx)
cont =
13
3.9300
6.2200
8.5900
-0.0000
0.0000
-0.0000
0.0015
-0.0911
2.9206
-37.1100
P(x)=0.0015(x-40)(x-60)(x-80)(x-120)(x-140)(x-160)-0.0911(x-40)(x-60)(x-80)(x100)(x-140)(x-160)+2.9206(x-40)(x-60)(x-80)(x-100)(x-120)(x-160)-37.11(x-40)(x60)(x-80)(x-100)(x-120)(x-140)
Codigo Matlab
%INTERPOLACION DE LAGRANGE
function cont=interpolLagrange(x,fx)
s1=length(x);
s2=length(fx);
cont=0;
for k=1:s1
cont=cont+fx(k)*lagrange(x,k);
end
end
c)
14
f(x1)
f(x2)
f(x3)
f(x4)
f(x5)
f(x6)
f(x7)
0.63
1.36
2.18
3
3.93
6.22
8.59
f(x1-x2)=0.0365
f(x2-x3)=0.041
f(x3-x4)=0.041
f(x4-x5)=0.0465
f(x5-x6)=0.1145
f(x6-x4)=0.041
f(x1-x3)=0.0001125
f(x2-x4)=0
f(x3-x5)=0.0001375
f(x4-x6)=0.00017
f(x5-x7)=0.0001
f(x1-x4)=2,083x106
f(x1-x4)=2,292x106
f(x1-x4)=5,42x107
f(x1-x4)=1,1667x106
f(x1-x6)=2,956x105
f(x2-x4)=2,956x105
f(x1-x5)=5,469x108
f(x2-x6)=2,956x103
f(x1-x4)=2,14x108
f(x1-x7)=4,9267x107
d)
0 1 2
1 2 7
3
10
n
X
ai
i=1
n
X
fi (x)
i=1
En
Pn
i=1
Presentaci
on en Matlab
>> x=[0 0.5 1]
x =
0
0.5000
1.0000
0.1667
0.8890
>> cont=interpolLagrange(x,fx)
cont =
-0.8888
2.7778
-1.0000
function cont=interpolLagrange(x,fx)
s1=length(x);
s2=length(fx);
cont=0;
for k=1:s1
cont=cont+fx(k)*lagrange(x,k);
end
end
%INTERPOLACION DE LAGRANGE
%Calcula el L del polinomio de Lagrange
function LG=lagrange(x,k)
rr=1;
ss=1;
s=length(x);
for j=1:s
if j~=k
rr=conv(rr,poly(x(j)));
ss=ss*(x(k)-x(j));
else
poly(x(j))==1;
end
LG=(1/ss)*rr;
end
------------------------------------------------------------------------------------------\\
% PROGRAMA PARA CALCULAR LAS RAICES (METODO DE NEWTON)
x0=-10;
fx=@(x)(0.8888*x^2+2.778*x-1);
gx=@(x)(2*0.8888*x+2.778);
x(1)=x0-fx(x0)/gx(x0);
for i=1:1000
x(i+1)=x(i)-fx(x(i))/gx(x(i));
if abs(x(i+1)-x(i))<0.00001
disp(la raiz de la ecuacion es: )
disp(x(i+1))
return
end
end
17