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

c_A = x(1);

T_0 = p(1); %initial guess as reference T 
opts = optimoptions('fsolve','Display','off','Algorithm','trust-region');
T = fsolve (@(T) rootx2(c_A,T,u,v,d,p),T_0,opts);

    function [F] = rootx2(c_A,T,u,v,d,p)
        
        Q = u(1);

        v = v(1);

        T_1 = d(1);

        c_Af = d(2); 
        
        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]

        k = k_ref*exp((-E/R)*((1/T)-(1/T_ref)));

        F = ((q_1/V)*c_Af - ((q_1/V)+k-0.75)*c_A) - v;

    end

end