Curve fitting for coupled monod equation
5 views (last 30 days)
Show older comments
Sharmila Sathyamurthy
on 25 Sep 2020
Commented: Sharmila Sathyamurthy
on 26 Sep 2020
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
0 Comments
Accepted Answer
Star Strider
on 25 Sep 2020
There are several options. Two are linked to here.
A second option using the ga (genetic algorithm) function to estimate them, see: Parameter Estimation for a System of Differential Equations (It has the same title, however with a much different approach, and updated code.)
It will be straightforward to adapt those to your problem.
More Answers (0)
See Also
Categories
Find more on Smoothing 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!