taller autonomo lopez
Post on 14-Apr-2016
213 Views
Preview:
TRANSCRIPT
Taller Autónomo Andrés David López 3 de diciembre 2015a)Dados los siguientes pares ordenados: A(5,20);B(10,35);C(20,48);D(30,44);E(40,22)1. Trazar la gráfica correspondiente2. Estime el modelo matemático y aplique el método de los mínimos cuadrados3. Interpole para x=25b) Dados los siguientes pares ordenados: A(0,0.12);B(2,0.153);C(3,0.17);D(6,0.25);E(7,0.26)Aplique el método de los mínimos cuadrados y considérese un polinomio de ´primer gradoInterpole cuando x=4c) Formular un polinomio de segundo grado y encuentre las diferencias divididas de primero, segundo y tercer grado.a)x=[5,10,20,30,40]x = 5 10 20 30 40 y=[20,35,48,44,22]y = 20 35 48 44 22plot(x,y)grid on
y=a0+a1x+a2x^2a0+a1(5)+a2(5^2)=20a0+a1(10)+a2(10^2)=35a0+a1(20)+a2(20^2)=48a0+a1(30)+a2(30^2)=44a0+a1(40)+a2(40^2)=22A=[1 5 25;1 10 100;1 20 400;1 30 900;1 40 1600]A = 1 5 25 1 10 100 1 20 400 1 30 900
1 40 1600b=[20,35,48,44,22]'b = 20 35 48 44 22C=A'C = 1 1 1 1 1 5 10 20 30 40 25 100 400 900 1600
x=[(C*A)^-1*(C*b)]x = 2.1237 4.1191 -0.0906a0=2.1237;a1=4.1191;a2=-0.0906a2 = -0.0906y=a0+a1*x+a2*x.^2y = 10.4629 17.5534 1.7497x=[5:5:40]x = 5 10 15 20 25 30 35 40y=a0+a1*x+a2*x.^2y = 20.4542 34.2547 43.5252 48.2657 48.4762 44.1567 35.3072 21.9277plot (x,y)grid on
plot(x,y,X,Y)grid on
x=25x = 25y=a0+a1*x+a2*x.^2y = 48.4762
b)A(0,0.12);B(2,0.153);C(3,0.17);D(6,0.25);E(7,0.26)x=[0 2 3 6 7]x = 0 2 3 6 7y=[0.12 0.153 0.17 0.225 0.26]y = 0.1200 0.1530 0.1700 0.2250 0.2600plot(x,y)grid on
y=a0+a1xa0+a1(0)=0.12
a0+a1(2)=0.153a0+a1(3)=0.17a0+a1(6)=0.225a0+a1(7)=0.26A=[1 0;1 2;1 3;1 6;1 7]A = 1 0 1 2 1 3 1 6 1 7b=[0.12 0.153 0.17 0.225 0.26]'b = 0.1200 0.1530 0.1700 0.2250 0.2600 C=A'
C =
1 1 1 1 1 0 2 3 6 7
x=[(C*A)^-1*(C*b)]
x =
0.1156 0.0194
a0=0.1156;a1=0.0194
a1 =
0.0194 y=a0+a1*xy =
0.1178 0.1160
x= [0:1:7]
x =
0 1 2 3 4 5 6 7y=a0+a1*x
y =
0.1156 0.1350 0.1544 0.1738 0.1932 0.2126 0.2320 0.2514plot(x,y)grid on
X=[0 2 3 6 7]
X =
0 2 3 6 7
Y=[0.12 0.153 0.17 0.225 0.26]
Y =
0.1200 0.1530 0.1700 0.2250 0.2600
plot(x,y,X,Y)grid on
x=4 x = 4y=a0+a1*xy = 0.1932
c) Formular un polinomio de 2do grado y encuentre las diferencias divididas de 1re grado 2do grado y 3er grado
>> x0=-2;x1=-1;x2=0;x3=2;x4=3;x5=6;f0=-18;f1=-5;f2=-2;f3=-2;f4=7;f5=142;a0=(f1 -f0)/(x1-x0)
a0 = 13
>> x0=-2;x1=-1;x2=0;x3=2;x4=3;x5=6;f0=-18;f1=-5;f2=-2;f3=-2;f4=7;f5=142;a0=(f1 -f0)/(x1-x0);a01=(f2-f1)/(x2-x1);a02=(f3-f2)/(x3-x2);a03=(f4-f3)/(x4-x3);a04=(f5-f4)/(x5-x4)
a04 = 45
>> x0=-2;x1=-1;x2=0;x3=2;x4=3;x5=6;f0=-18;f1=-5;f2=-2;f3=-2;f4=7;f5=142;a0=(f1 -f0)/(x1-x0);a01=(f2-f1)/(x2-x1);a02=(f3-f2)/(x3-x2);a03=(f4-f3)/(x4-x3);a04=(f5-f4)/(x5-x4);v0=[a0 a01 a02 a03 a04]
v0 = 13 3 0 9 45
>> x0=-2;x1=-1;x2=0;x3=2;x4=3;x5=6;f0=-18;f1=-5;f2=-2;f3=-2;f4=7;f5=142;a0=(f1 -f0)/(x1-x0);a01=(f2-f1)/(x2-x1);a02=(f3-f2)/(x3-x2);a03=(f4-f3)/(x4-x3);a04=(f5-f4)/(x5-x4);v0=[a0 a01 a02 a03 a04]'
v0 = 13
3
0
9
45
>> x0=-2;x1=-1;x2=0;x3=2;x4=3;x5=6;f0=-18;f1=-5;f2=-2;f3=-2;f4=7;f5=142;b0=(f2-f0)/(x2-x0);b01=(f3-f1)/(x3-x1);b02=(f4-f2)/(x4-x2);b03=(f5-f3)/(x5-x3);v0=[b0 b01 b02 b03]'
v0 =
8
1
3
36
>> x0=-2;x1=-1;x2=0;x3=2;x4=3;x5=6;f0=-18;f1=-5;f2=-2;f3=-2;f4=7;f5=142;c0=(f3-f0)/(x3-x0);c01=(f4-f1)/(x4-x1);c02=(f5-f2)/(x5-x2);v0=[c0 c01 c02]'
v0 = 4
3
24
top related