function tg = tg_function(Tg_0,c,rho_L) R = 8.31; % J/(mol K) gas constant z = 2; % - lattice coordnation number M_p = 100.12*10^-3; % kg/mol molecular weight polymer repeat unit M_d = 44.01*10^-3; % kg/mol molecular weight gas molecule delta_Cp = 355; % J/(kg K) c_weight = c*M_d/(rho_L); theta = M_p*c_weight/(z*M_d*(1-c_weight)); beta = z*R/(M_p*delta_Cp); tg = Tg_0*exp(beta*((1-theta)*log(1-theta)+theta*log(theta))); end