function dif =pp3(W,F);

%  A  +  B --> C + 2D  +  2E
%  A  +  7.5 B --> 6D +   3E
% C  +    3B -->   4D +   E                  F inerte Nitrogeno

Fa=F(1);
Fb=F(2);
Fc=F(3);
Fd=F(4);
Fe=F(5);
T=F(6);
 Y=F(7);
Y=1;

 
%Parametros                          Unidades
 
%Y=1;
To=450+273;                             %K
Po=15;                                  %atm
%Flujos Molares Iniciales
Fao=3;                %mol/sg
Fbo=20;              %mol/sg
Ffo=Fbo*.79/.21;     %mol/sg
Fco=0;                   %mol/sg
Fdo=0;                  %mol/sg
Feo=0;
Ff=Ffo;


R=0.082;                                 %atm.lt/mol.K
Ha=-19820;                               % cal/gmol
Hb=0;
Hc=-11233;
Hd=-94052;
He=-57797;
Hf=0;
deltaHr1o= Hc+2*Hd+2*He-Ha-4.5*Hb;                 % cal/mol
deltaHr2o=3*He+6*Hd-7.5*Hb-Ha;                     %cal/mol
deltaHr3o=He+4*Hd-3*Hb-Hc;

alpha=0.001;
Ta=300;
UA=0;
Ta=300;
%Capacidades Calorificas
cpa= 75.11;            % cal/mol K
cpb=24.01;              % cal/mol K
cpc=39.2;               % cal/mol K
cpd=52.15;              % cal/mol K
cpe=39.38;              % cal/mol K
cpf=7.22;               % cal/mol K

deltaHr1=deltaHr1o+(cpc+2*cpd+2*cpe-cpa-4.5*cpb)*(T-273)
deltaHr2=deltaHr2o+(6*cpd+3*cpe-cpa-7.5*cpb)*(T-273)
deltaHr3=deltaHr3o+(cpe+4*cpd-cpc-3*cpb)*(T-273)



 
Ft= Fa+Fb+Fc+Fd+Fe+Ff

Cto=Po/(0.082*To)
Ca=Cto*(Fa/Ft)*(To/T)*Y
Cb=Cto*(Fb/Ft)*(To/T)*Y; 
Cc=Cto*(Fc/Ft)*(To/T)*Y; 
Cd=Cto*(Fd/Ft)*(To/T)*Y; 
Ce=Cto*(Fe/Ft)*(To/T)*Y; 
Cf=Cto*(Ff/Ft)*(To/T)*Y; 

%k3=3.7e6*exp(-20143/(1.987*T));
k3=7.7e6*exp(-25143/(1.987*T))
k2=5.31e6*exp(-29850/(1.987*T))
k1=2.33e6*exp(-21429/(1.987*T))


%Velocidades de Reacción
r1=k1*Ca
r2=k2*Ca
r3=k3*Cc*Cb

%Ecuaciones Diferenciales
dFa=-r1-r2
dFb=-4.5*r1-7.5*r2-3*r3
dFc=r1-r3
dFd=2*r1+6*r2+4*r3
dFe=2*r1+3*r2+r3

dT=((UA*(Ta-T))+r1*(-deltaHr1)+(r2)*(-deltaHr2)+(r3)*(-deltaHr3))/(Fa*cpa+Fb*cpb+Fc*cpd+Fd*cpd+Fe*cpe+Ff*cpf)              
dy=(-alpha/(2*Y))*(Ft/Fto)*(T/To) ;
pause
 dP = 0;
dif=[dFa;dFb;dFc;dFd;dFe;dT;dP];

 