function outvar = PBRSimplified(v,y,FeedN2,FeedH2,FeedAr,FeedCH4,P ...
    ,k0f,Ef,k0r,Er,eps,CpN2,CpH2,CpNH3,CpAr,CpCH4)
global Rgas
% unpack dependent variables
MflowN2 = y(1);
MflowH2 = y(2);
MflowNH3 = y(3);
T = y(4);
% total molar flow
TotFlow = MflowN2 + MflowH2 + MflowNH3 + FeedAr + FeedCH4;
% partial pressures in atm
PN2 = MflowN2/TotFlow*P;
PH2 = MflowH2/TotFlow*P;
PNH3 = MflowNH3/TotFlow*P;
% forward and reverse reaction rates
rf = k0f*exp(-Ef/Rgas/(T+273.15))*PN2^0.5*PH2^1.5;
rr = k0r*exp(-Er/Rgas/(T+273.15))*PNH3;
% differential balance on N2 in kgmol/h/m3
outvar(1) = -(rf-rr)*eps;  
% algebraic equations from stoichiometry for H2 and NH3
outvar(2) = MflowH2 - ( FeedH2 - 3*( FeedN2 - MflowN2) );
outvar(3) = MflowNH3 - 2*( FeedN2 - MflowN2 );
HtRx = HtRxnP(T,P);  % heat of reaction
% differential energy balance
outvar(4) = (rf-rr)*(-HtRx)*eps/(MflowN2*CpN2+MflowH2*CpH2 ...
    +MflowNH3*CpNH3+FeedAr*CpAr+FeedCH4*CpCH4);
outvar = outvar';


