Documentos de Académico
Documentos de Profesional
Documentos de Cultura
Tarea 4
Tarea 4
𝒇𝟏(𝒙, 𝒚) = 𝒚𝟐 𝒙 − 𝟖𝒙 + 𝟐𝒚 + 𝟓
𝒇𝟏(𝒙, 𝒚) = 𝒙𝟐 𝒚 + 𝒙 − 𝟏𝟎𝒚 + 𝟑
i x y d
0 0 0
1 0.625 0.3 0.69327123 i x y d
2 0.70703125 0.37421875 0.11062346 0 0 0
3 0.73093124 0.38941007 0.02831935 1 0.625 0.3625 0.7225173
4 0.73620734 0.39389776 0.00692652 2 0.72589111 0.39168989 0.10502888
5 0.73775276 0.39497004 0.00188099 3 0.73684334 0.39495067 0.01142733
6 0.73812881 0.39527267 0.0004827 4 0.73810483 0.39532735 0.00131653
7 0.73823387 0.39534869 0.00012967 5 0.73825106 0.39537102 0.00015261
8 0.73826047 0.39536947 3.3755E-05 6 0.73826802 0.39537609 1.7704E-05
9 0.7382677 0.39537481 8.992E-06 7 0.73826999 0.39537668 2.054E-06
10 0.73826957 0.39537625 2.3563E-06 8 0.73827022 0.39537675 2.3829E-07
11 0.73827007 0.39537662 6.2483E-07 9 0.73827024 0.39537676 2.7646E-08
12 0.7382702 0.39537672 1.6428E-07 10 0.73827025 0.39537676 3.2074E-09
13 0.73827023 0.39537675 4.3459E-08 11 0.73827025 0.39537676 3.7211E-10
14 0.73827024 0.39537675 1.1446E-08 12 0.73827025 0.39537676 4.3172E-11
15 0.73827025 0.39537676 3.0243E-09
16 0.73827025 0.39537676 7.9724E-10
MÉTODO DE NEWTON RAPHSON
%metodo de newton raphson
%teniendo en cuenta que Tte=x Tti=y Ts=z
clc,clear
%la primera ecuacion
%8.7459*10^-9*x^4+9.5504*10^-6*x^3+3.9110*10^-3*x^2+4.2556*x-7.7359*10^-
9*y^4+8.4474*10^-6*y^3-3.4592*10^-3*y^2+0.62958*y-361.58
%la segunda ecuacion
%1.0100*10^-9*x^4+1.1029*10^-6*x^3+4.5164*10^-4*x^2+3.626*x+9.896*y-
4.948*z-440.75
%la tercera ecuacion
%1.0100*10^-9*x^4+1.1029*10^-6*x^3+4.5164*10^-4*x^2+3.626*x+3.5326*10^-
8*z^3-9.3743*10^-5*z^2+0.7002*z-372.76
syms x
syms y
syms z
cf1=input('ingrese la primera ecuacion=','s');
f1=inline(cf1);
cf2=input('ingrese la segunda ecuacion=','s');
f2=inline(cf2);
cf3=input('ingrese la tercera ecuacion=','s');
f3=inline(cf3);
dcf1=diff(cf1,x,1);
a=inline(dcf1);
dcf2=diff(cf1,y,1);
b=inline(dcf2);
dcf3=diff(cf1,z,1); %constante
c=inline(dcf3);
dcf4=diff(cf2,x,1);
d=inline(dcf4);
dcf5=diff(cf2,y,1); %constante
e=inline(dcf5);
dcf6=diff(cf2,z,1); %constante
f=inline(dcf6);
dcf7=diff(cf3,x,1);
g=inline(dcf7);
dcf8=diff(cf3,y,1); %constante
h=inline(dcf8);
dcf9=diff(cf3,z,1);
j=inline(dcf9);
x=input('ingrese el valor de x=');
y=input('ingrese el valor de y=');
z=input('ingrese el valor de z=');
dist=1;
k=0;
disp('---------------------------------------------------------');
disp('------------------TABLA DE RESPUESTAS--------------------');
disp('---------------------------------------------------------');
while dist>0.0001
m=[a(x) b(y) dcf3 -f1(x,y);d(x) dcf5 dcf6 -f2(x,y,z);g(x) dcf8 j(z) -
f3(x,z)];
n=rref(m);
r=n(1,4);
s=n(2,4);
t=n(3,4);
disp('---------------------------------------------------------');
k=k+1
x1=x+r
y1=y+s
z1=z+t
dist=[(x1-x)^2+(y1-y)^2+(z1-z)^2]^0.5
x=x1;
y=y1;
z=z1;
end
n xk yk zk d
1 0.000000 0.000000 0.000000 ----------
2 84.965692 44.538197 532.362182 540.936515
3 74.002805 279.183799 71.026512 517.696189
4 69.634305 52.637871 146.966734 238.975016
5 73.294539 92.245482 171.689745 46.833614
6 71.279841 103.235166 151.532379 23.046726
7 70.906125 93.911814 162.664805 14.525683
8 71.214426 99.618072 164.739826 6.079650
9 71.019812 100.540052 163.039476 1.943994
10 70.990072 99.762807 164.113061 1.325737
11 71.015073 100.310743 164.277234 0.572549
12 70.997413 100.383462 164.139332 0.156898
13 70.995081 100.321128 164.236747 0.115674
14 70.997079 100.370709 164.249608 0.051261
15 70.995490 100.376392 164.238587 0.012501
16 70.995308 100.371476 164.247355 0.010053
17 70.995465 100.375928 164.248359 0.004567
18 70.995323 100.376372 164.247490 0.000986
19 70.995308 100.375991 164.248277 0.000874
20 70.995321 100.376389 164.248355 0.000407
21 70.995308 100.376424 164.248288 0.000077
MÉTODO DE BROYDEN
%INTEGRACION POR EL METODO DE BROYDEN
clc,clear all
disp(' Método de integración de BROYDEN ')
syms x
syms y
for i=1:5
x0=0;
y0=0;
f1=4*x0+2*y0+x0^2-6;
f2=x0*y0^2+x0-10*y0-3;
n=[x0; y0];
J=[2*x0+4, 2;y0^2+1, 2*x0*y0-10];
f0=[4*x0+2*y0+x0^2-6; x0*y0^2+x0-10*y0-3];
IJ=inv(J);
x=(n-(IJ*f0));
dist=abs(sqrt(n-x));
disp(':::::::::::::::::::::::::::::::::::::::')
disp([ x dist ])
n=x;
end
1.5714 1.2536
-0.1429 0.3780
1.2341 0.5808
-0.1727 0.1727
1.2171 0.1305
-0.1746 0.0434
1.2170 0.0093
-0.1746 0.0033
1.2170 0.0037
-0.1746 0.0033
POLINOMIO DE LAGRANGE
Elaboración del programa en Matlab para la primera pregunta:
function polinomio_de_Lagrange
clc,clear
% programa para el uso de cinco varialbes %
t0=input('ingrese el valor de t0 = ');
t1=input('ingrese el valor de t1 = ');
t2=input('ingrese el valor de t2 = ');
t3=input('ingrese el valor de t3 = ');
t4=input('ingrese el valor de t4 = ');
c0=input('ingrese el valor de c0 = ');
c1=input('ingrese el valor de c1 = ');
c2=input('ingrese el valor de c2 = ');
c3=input('ingrese el valor de c3 = ');
c4=input('ingrese el valor de c4 = ');
syms t
l0=((t-t1)*(t-t2)*(t-t3)*(t-t4))/((t0-t1)*(t0-t2)*(t0-t3)*(t0-t4));
l1=((t-t0)*(t-t2)*(t-t3)*(t-t4))/((t1-t0)*(t1-t2)*(t1-t3)*(t1-t4));
l2=((t-t0)*(t-t1)*(t-t3)*(t-t4))/((t2-t0)*(t2-t1)*(t2-t3)*(t2-t4));
l3=((t-t0)*(t-t1)*(t-t2)*(t-t4))/((t3-t0)*(t3-t1)*(t3-t2)*(t3-t4));
l4=((t-t0)*(t-t1)*(t-t2)*(t-t3))/((t4-t0)*(t4-t1)*(t4-t2)*(t4-t3));
y=l0*c0+l1*c1+l2*c2+l3*c3+l4*c4;
disp('..................................................................'
)
disp('........... INTERPOLACIÓN CON EL POLINOMMO DE
LAGRANGE............')
disp('..................................................................'
)
%la ecución es de cuarto orden%
%donde t: es el tiempo en segundos%
%donde c: esla velocidad de cambio de concentración%
ecuacion=simplify(y)
t=input('ingrese el valor de t = ');
disp('------------------------------------------------------------------
')
c=eval(y)
CORRIDA DEL PROGRAMA PARA LA PRIMERA PREGUNTA:
ingrese el valor de t0 = 40
ingrese el valor de t1 = 60
ingrese el valor de c0 = 6
ingrese el valor de c1 = 5
ingrese el valor de c2 = 3
ingrese el valor de c3 = 2
ingrese el valor de c4 = 1
.............................................................................................................
.............................................................................................................
ecuacion =
------------------------------------------------------------------
c= 1.4670
DIFERENCIAS DIVIDIDAS
function program_diffdivididas
clc
clear
y=[1 2 5 10 20 30 40];
xa=x;ya=y;
d=zeros(length(y));
d(:,1)=y';
for k=2:length(x)
for j=1:length(x)+1-k
d(j,k)=(d(j+1,k-1)-d(j,k-1))/(x(j+k-1)-x(j));
end
end
for w=1:length(x)
ds=num2str(abs(d(1,w)));
if w>1
if x(w-1)<0
sg1='+';
else
sg1='-';
end
end
if d(1,w)<0
sg2='-';
else
sg2='+';
end
if w==1
acum=num2str(d(1,1));
elseif w==2
else
end
end
disp(xa);
disp(ya);
los valores de X e Y son 56.5000 78.6000 113.0000 144.5000 181.0000 205.0000 214.5000
1 2 5 10 20 30 40
puntos 0 1 2 3 4 5
T(°C) 50 60 70 80 90 100
P(atm) 40.94 49.11 56.05 62.84 68.57 72.3
puntos x fx 1er 2do 3ro 4to 5to
0 50 40.94
8.17
1 60 49.11 -1.23
6.94 1.08
2 70 56.05 -0.15 -1.99
6.79 -0.91 1.96
3 80 62.84 -1.06 -0.03
5.73 -0.94
4 90 68.57 -2
3.73
5 100 72.3
hacia adelante
h 10 p1 75.254
x 92 p2 66.9884
xo 50 p3 72.31064
s 4.2 p4 71.79904
p5 71.9149466
0.0031 0 t(10,1)=0.0050
0.0023 -0.0008
0.0043 0.0020 t(9,2)=0.0015
0.0033 -0.0010
xint=T∞2
0.0041 0.0008
0.0031 -0.0010
0.0018 -0.0013
0.0047 0.0029
0.0035 -0.0012
0.0050 0.0015
ingrese el valor de xint=980
t(980.000000)=0.279888
-------------------------------------------------------------------------
------
-------------------------------------------------------------------------
------
---------------------LA ECUACION QUE SE HA DE FORMAR ES------------------
------
Cp=0.285+s*0.005+s*(s+1)/2*0.0015.........unidades en
btu/lb °C
Cp=6.0751*10^-8*xint^2-8.1092*10^-5*xint+0.30104.....unidades en
btu/lb °c
m =
0.2799
INTEGRACIÓN NUMERICA
5
∫ (cos 𝑥 + 𝑥 2 + 3)𝑑𝑥
2
f(x)
n= 3 x0= 2 6.58385316
a= 2 x1= 3 11.0100075
b= 5 x2= 4 18.3463564
h= 1 x3= 5 28.2836622
I= 46.1012276 I= 46.7901216
f(x)
n= 4 x0= 2 6.58385316
a= 2 x1= 2.75 9.63819762
b= 5 x2= 3.5 14.3135433
h= 0.75 x3= 4.25 20.6164125
x4= 5 28.2836622
I= 46.132755 I= 46.1282606
f(x)
n= 5 x0= 2 6.58385316
a= 2 x1= 2.6 8.90311125
b= 5 x2= 3.2 12.2417052
h= 0.6 x3= 3.8 16.6490323
x4= 4.4 22.0526671
x5= 5 28.2836622
I= 46.1323234 I= 46.3681641
80
T K y = 4E-05x2 - 0.079x + 74.304
70
R² = 0.9943
0 73 60
100 67 50
200 62 40
30
300 55
20
400 48 10
600 40 0
800 36 0 200 400 600 800 1000 1200
1000 35
𝐾 = 4 ∗ 10−5 ∗ 𝑇 2 − 0.079 ∗ 𝑇 + 74.304 … … … … … … 𝑒𝑐𝑢𝑎𝑐𝑖ó𝑛 1
Del enunciado se tiene:
𝐴 = 2∗𝜋∗𝑟∗𝐿 , 𝐿 = 2𝑚
𝑅1 = 20𝑐𝑚 , 𝑅2 = 120𝑐𝑚 (En metros)
𝑇1 = 900°𝐶 , 𝑇2 = 250°𝐶
𝑑𝑇
𝑞 = −𝐾𝐴 … … … … . 𝑒𝑐𝑢𝑎𝑐𝑖ó𝑛 2
𝑑𝑟
𝑑𝑇
𝑞 = −(4 ∗ 10−5 ∗ 𝑇2 − 0.079 ∗ 𝑇 + 74.304) ∗ (2 ∗ 𝜋 ∗ 𝑟 ∗ 2)
𝑑𝑟
𝑅2 =120𝑐𝑚 𝑑𝑟 𝑇 =250°𝐶
∫𝑅 𝑞 2
= ∫𝑇 =900°𝐶 −(4 ∗ 10−5 ∗ 𝑇2 − 0.079 ∗ 𝑇 + 74.304) ∗ (4 ∗ 𝜋)𝑑𝑇
1 =20𝑐𝑚 𝑟 1
𝑇2 =250°𝐶
q[ln(𝑟)]1.2
0.2 = (4 ∗ 𝜋) ∫𝑇 −(4 ∗ 10−5 ∗ 𝑇 2 − 0.079 ∗ 𝑇 + 74.304)𝑑𝑇
1 =900°𝐶
(4∗𝜋) 𝑇 =250°𝐶
q=
ln(1.2)−ln(0.2)
∫𝑇
2
=900°𝐶
1
−(4 ∗ 10−5 ∗ 𝑇 2 − 0.079 ∗ 𝑇 + 74.304)𝑑𝑇
ingrese el valor de n: 3
fx1 = 38.9984
fx2 = 46.1484
fx3 = 57.0540
------------------------------------
--------Hallando la integral-------
------------------------------------
I1 = -2.8283e+04
q = 1.9836e+05 (=198361.2794)