Curve fitting for coupled monod equation
Show older comments
Hello,
I have a code here that solves Monod's kinetics. This is a model for 2 different organisms. The product of the first one is the substrate for the second one.
I have used ode45 to solve the differential equation. And for most of the variables in equation I have given an estimated value. Now I am attempting to do non-linear fitting procedures like lsqcurvefit.
The SolveMonod has the ODE45 and gives values of time, substrate concentration and Biomass concentration.
Now I need to estimate the values in the differential equation, I understand that I need to use curvefitting (non-linear fitting) lsqcurvefit. Can you please guide me as I am new to coding and struggling for quite a few days.
Thank you
function S = SolveMonod1(MuYKsb,t)
sx0 = [1000 10000000 0 10000000];
timespan = [0 200];
MuYKsb = [0.2 1e8 300 0.01 0.2 1e8 300 0.01];
[T,SX] = ode45(@Monod, timespan, sx0);
function dSX = Monod(t,sx);
sxdot = zeros(4,1);
sxdot(1) = -(MuYKsb(1).* sx(2).* sx(1))./(MuYKsb(2).*(MuYKsb(3)+sx(1)));
sxdot(2) = (MuYKsb(1).* sx(2).* sx(1))./(MuYKsb(3)+ sx(1))-(MuYKsb(4).*sx(2));
sxdot(3) = -(MuYKsb(5).* sx(4).* sx(3))./(MuYKsb(6).*(MuYKsb(7)+sx(3)))-sxdot(1);
sxdot(4) = (MuYKsb(1).* sx(4).* sx(3))./(MuYKsb(7)+ sx(3))-(MuYKsb(8).*sx(4));
dSX = sxdot;
end
S1 = SX(:,1);
X1 = SX(:,2);
X1 = X1/100000000;
S2 = SX(:,3);
X2 = SX(:,4);
X2 = X2/100000000;
plot(T,S1,T,S2,T,X1,T,X2);
end
Accepted Answer
More Answers (0)
Categories
Find more on Systems of Nonlinear Equations in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!