Skip to content Skip to sidebar Skip to footer

Curve Fitting Of Monod Growth/degradation Equations To The Experimental Data

So the problem that is being faced here is the curve fitting of the Monod equations to the experimental data. The model of bacteria growth and degradation of the organic carbon loo

Solution 1:

The result of f() needs to have the same shape as the experimental data you feed into curve_fit as third parameter. In the last line of f() you just take the t = 0s value of the solution for both ODEs and return that, but you should return the complete solution. When fitting several sets of data at once using curve_fit, just concat them (stack horizontally), i.e.

deff(t, u, K, Y):
   .....
   return np.hstack((results[:,0], results[:,1]))

and call curve_fit like

k, kcov = curve_fit(f, t_exp, np.hstack([X_exp, S_exp]), p0=(1, 2, 2))

You will have to adapt the plotting part of your script, too:

compute = f(t_mod, u, K, Y)
compute = compute.reshape((2,-1))

Post a Comment for "Curve Fitting Of Monod Growth/degradation Equations To The Experimental Data"