Академический Документы
Профессиональный Документы
Культура Документы
for k=p:-1:1
g(1,(q-k))=C(k,q);
end
X=min(datosx):0.001:max(datosx);
Y=polyval(g,X);
plot(X,Y,'r')
hold on
g=g';
DX=[0,1];
DY=[0,1];
plot(DX,DY)
F=input('Ingrese la alimentacin (F): ');
XF=input('Ingrese "x" en la alimentacin (xF): ');
YD=input('Ingrese "y" en el destilado (xD): ');
XD=YD;
Xw=input('Ingresa "x" en el residuo (xW): ');
%obtener la relacin de reflujo (L/V) mnima.
xL=XF;
yL=polyval(g,xL);
LV=(XD-yL)/(XD-xL);
XFF=XF*F;
R=solve('x*XD+Xw*F-Xw*x=XFF','x');
D=subs(R);
W=F-D;
DV=1-LV;
DVXD=DV*XD;
X=[0,XD];
Y=[DVXD,YD];
hold on
plot(X,Y,'y')
LD=1/((1/LV)-1);
L=LD*D;
Lp=L+F;
Vp=Lp-W;
LpVp=Lp/Vp;
WVp=W/Vp;
XI=datosx(N-3);
Ym=LpVp*XI-WVp*Xw;
hold on
XW=[Xw,XI];
YW=[Xw,Ym];
plot(XW,YW,'g');
xlabel('X');ylabel('Y')
legend('Puntos de Equilibrio [X,Y]','Curva de equilibrio [X,Y]','[0,1]->L/V=1','Recta de operacin de enriquecimiento','Recta de operacin de
agotamiento')
while YD>0
A=solve('a*x^3 + b*x^2 + c*x + d=YD','x');
a=g(1,1);b=g(2,1);c=g(3,1);d=g(4,1);
X=subs(A);
X=X';
x1=[X(1,1),YD];
y1=[YD,YD];
plot(x1,y1)
X1=[X(1,1),X(1,1)];
Y1=[X(1,1),YD];
plot(X1,Y1,'k')
YD=X(1,1);
PT=PT+1;
end
axis([-0.2,1.6,-0.2,1.2])
fprintf('\nEl nmero de platos tericos es: %g\n', PT)
fprintf('\nCon una relacin de reflujo (L/V) %g\n', LV)
GRAFICA.