function [T] = Transform_fitted(x,u,v,d,p)

Q = u(1);

v = v(1);

c_A = x(1);
T = x(2);


T_1 = d(1);

c_Af = d(2); 
q_1 = d(3);

T_ref = p(1);                          %reference temp for rate constant [K]
V = p(2);                                                    %tank volume [m3]
c_p = p(3);                               %specific heat capacity [kJ/kgK]
E = p(4);                                     %activation energy [kJ/kmol]
rho = p(5);                                                %density [kg/m3]
k_ref = p(6);                               %reference rate constant [min-1]
R = p(7);                               %universal gas constant [kJ/Kkmol]
H_rx = p(8);                                   %heat of reaction [kJ/kmol]
%q_1 = p(9);                                     %inlet flow [m3/min]
A = p(10);

%k = k_ref*exp((-E/R)*((1/T)-(1/T_ref)));
 
recip_T = (1/T_ref)-(R/E)*log((1/(k_ref*c_A))*(((q_1*(c_Af-c_A))/V) - A*c_A - v));

T = 1/recip_T;
end