Documentos de Académico
Documentos de Profesional
Documentos de Cultura
Metodos NUm
Metodos NUm
1.
a) Escriba un programa para leer los datos del archivo y asgnelos en las
variables V y P.
>> V=1:1:6
>> P= [2490, 1248, 832, 626, 198,414]
b) Use la interpolacin lineal para estimar la presin cuando el volumen es
3.8 m3.
>> V=1:1:6;
>> P=[2490,1248,832,626,198,414]
>> plot(V,P,'r*')
>> plot(V,P,'-r*')
>> VV=3.8
VV =
3.8000
>> PP=interp1(V,P,VV)
PP =
667.2000
>> plot(V,P,'-r*',VV,PP,'bo')
>> V=1:1:6
V=
>> P=[2490,1248,832,626,198,414]
P=
Columns 1 through 5
2490
Column 6
1248
832
626
198
414
>> VV=1:0.2:6
VV =
Columns 1 through 6
1.0000
1.2000
1.4000
1.6000
1.8000
2.0000
2.8000
3.0000
3.2000
4.0000
4.2000
4.4000
Columns 7 through 12
2.2000
2.4000
2.6000
Columns 13 through 18
3.4000
3.6000
3.8000
Columns 19 through 24
4.6000
4.8000
5.0000
5.2000
5.4000
5.6000
1.7448
1.4964
1.2480
0.9152
0.8320
0.7908
0.6260
0.5404
0.4548
Columns 25 through 26
5.8000
6.0000
>> PP=interp1(V,P,VV)
PP =
1.0e+003 *
Columns 1 through 6
2.4900
2.2416
1.9932
Columns 7 through 12
1.1648
1.0816
0.9984
Columns 13 through 18
0.7496
0.7084
0.6672
Columns 19 through 24
0.3692
0.2836
0.1980
0.2412
0.2844
0.3276
Columns 25 through 26
0.3708
0.4140
>> plot(V,P,'ro',VV,PP,'-b')
>> V=1:1:6
V=
>> P=[2490,1248,832,626,198,414]
P=
Columns 1 through 5
2490
1248
832
626
198
Column 6
414
>> VV=1:0.2:6
VV =
Columns 1 through 6
1.0000
1.2000
1.4000
1.6000
1.8000
2.0000
2.8000
3.0000
3.2000
Columns 7 through 12
2.2000
2.4000
2.6000
Columns 13 through 18
3.4000
3.6000
3.8000
4.0000
4.2000
4.4000
5.2000
5.4000
5.6000
1.4118
1.2480
Columns 19 through 24
4.6000
4.8000
5.0000
Columns 25 through 26
5.8000
6.0000
>> PPs=interp1(V,P,VV,'spline')
PPs =
1.0e+003 *
Columns 1 through 6
2.4900
2.1478
1.8571
Columns 7 through 12
1.6133
1.1172
1.0149
0.9363
0.8769
0.8320
0.7967
0.6260
0.5465
0.4543
0.1513
0.1399
0.1735
Columns 13 through 18
0.7649
0.7301
0.6860
Columns 19 through 24
0.3591
0.2705
0.1980
Columns 25 through 26
0.2617
0.4140
>> plot(V,P,'-r*',VV,PPs,'bo')
a) Escriba un programa para lee los datos del archivo y asgnelos en las
variables R y I.
>> R=[10,15,25,40,65,100]
>> I=[11.08,8.04,6.06,2.84,1.96,1.54]
>> plot(R,I,'-r*')
c) Use polyfit para calcular los coeficientes de la lnea recta que se muestra
en la grfica de la parte (b). la pendiente de la recta corresponde al voltaje
aplicado.
>> coef=polyfit(R,I,1)
coef =
-0.0946
9.2739
>> II=coef(1)*R+coef(2)
II =
8.3279
7.8549
6.9089
5.4898
>> II=coef(1)*R+coef(2);%a*x+b
>> plot(R,I,'-r*',R,II,'gh')
3.1248 -0.1863
d) Use polyval para encontrar valores calculados de corriente (I) con base en
los resistores usados. Grafique sus resultados en una nueva grafica con
los medidos.
>> RR=[10,15,25,40,65,100]
RR =
10
15
25
40
65 100
>> II=coef(1)*R+coef(2)
II =
8.3279
7.8549
6.9089
5.4898
3.1248 -0.1863
>> II_orden1=polyval(coef,RR)
II_orden1 =
8.3279
7.8549
6.9089
5.4898
3.1248 -0.1863