function OD_estimation_exp(filename) % estimates the behaviour of the optical density of a continuous % clostridial culture as a function of the pH assuming an acid- and % solvent-forming population which are prevalently present either during % acidogenesis or solventogenesis. The estimated growth of these % populations is used to describe the pH-induced switch as an shift in the % dominant phenotype. Here, only 'forward'-shift experiments are % considered. % % The decline of the acidogenic population is decribed employing en % exponential function, whereas a hyperbolic tangent (logistic growth) is % used to describe the raise of the solventogenic population. % % The data must be stored in a Matlab-file using the variable names: 'time' % and 'OD' % % options and preparations clc clear all close all % OD during steady states OD_acid=5.5; OD_solv=5.0; % load data load(filename,'time','OD'); % estimate parameters foptions=fitoptions('Method','NonlinearLeastSquares','Lower',[0.05, 130, 0.05, 160],'Upper',[0.5, 170,0.5, 190],'StartPoint',[0.1, 150,0.1,170]); f=fittype('OD_acid*(heaviside(b-x)+exp(-a*(x-b))*heaviside(x-b))+OD_solv/2.0*(tanh(c/2*(x-d))+1)','options',foptions); [c2,gof2] = fit(time,OD,f); par_OD=coeffvalues(c2) conf_pH=confint(c2); % compute time-dependent pH value tm=linspace(0,300,500); % acidogenic population pH_m1=OD_acid*(heaviside(par_OD(2)-tm)+exp(-par_OD(1)*(tm-par_OD(2))).*heaviside(tm-par_OD(2))); % solventogenic population pH_m2=OD_solv/2.0*(tanh(par_OD(3)/2*(tm-par_OD(4)))+1); % comparison of experimental data and fit figure plot(time,OD,'LineStyle','none','Marker','o','MarkerFaceColor',[0 0 1],'Color',[0 0 1]); xlabel('time [hours]'); ylabel('OD'); plot(tm,pH_m1,tm,pH_m2,tm,pH_m1+pH_m2); legend('Experimental data','acidogenic','solventogenic','acidogenic+solventogenic'); hold off