function rxn = calc_rxn_times(rxn,tnow) global molecdata for i = 1:length(rxn) permut = 1; for j = 1:length(rxn{i}.subs(:,1)) molnum = rxn{i}.subs(j,2); permut = permut .* molecdata(molnum); end ai = rxn{i}.rate .* permut; if ai ~= 0 rxn{i}.time = (1./ai) .* log(1./rand) + tnow; else rxn{i}.time = inf; end end