function vA=Transform_gen(x,p,d)
% reactor with perfect level control
cA   = x(1);                                    % state, concentration of A
T    = x(2);                                   % state, reactor temperature

cA0  = d(2);                             % disturbance, inlet concentration
q    = d(3);                                        % disturbance, flowrate

Tref = p(1);                          %reference temp for rate constant [K]
V    = p(2);                                              %tank volume [m3]
%cp   = p(3);                              %specific heat capacity [kJ/kgK]
E    = p(4);                                   %activation energy [kJ/kmol]
%rho  = p(5);                                              %density [kg/m3]
k0   = p(6);                               %reference rate constant [min-1]
R    = p(7);                             %universal gas constant [kJ/Kkmol]
%Hrx  = p(8);                                   %heat of reaction [kJ/kmol]
A    = p(9);                                             % tuning parameter
k    = k0*exp(-E/R*(1/T-1/Tref));                           % reaction rate
          
vA = q/V*(cA0-cA)- k*cA - A*cA;                         % transformed input
end


