Plotting Kinetic Model Monod, Haldane Equation

14 views (last 30 days)
Hello! I am trying to plot graphs (Substrate vs time, Biomass vs time, and Product vs time) from these kinetic equations below:
Where the parameter kinetic are shown in the following table
And the maintenance coefficient of cells (ms) gave a value less than 0.005 g g−1 h−1, it was neglected in the model.
I want to plot this paramaeter to the model kinetic to get plot data like this
where the data shown in the table below
I have tried code like this, but it is still error. Any little suggestion or solutions or comments are very welcomed! Thank you so much!
function CobaLunaFlores_ode23
Rentang = [0:10:80];
C0 = [28.90 0.62 0.07586];
Miumax=0.145;
Ks=1.6607;
Ki=50.3151;
Kp=8798.15;
gamma=3.6658;
Yxs=0.3941;
alfa=371.45;
betha=1.5502;
ms=0.005;
[t,C]=ode23(@LunaFlores,Rentang,C0)
plot(t,C)
end
function dCdt=LunaFlores(t,C)
dCdt(1,:)=((Miumax*C(1))/(Ks+C(1)+(C(1)^2/Ki))*(1-P(1)/Kp)^gamma)*C(2);
dCdt(2,:)= -C(2)*((((Miumax*C(1))/(Ks+C(1)+(C(1)^2/Ki))*(1-P(1)/Kp)^gamma)/Yxs)+ms);
dCdt(3,:)= C(2)*(alfa*((Miumax*C(1))/(Ks+C(1)+(C(1)^2/Ki))*(1-P(1)/Kp)^gamma)+betha);
end

Accepted Answer

Star Strider
Star Strider on 2 Nov 2021
I got it to run correctly, however I made no other changes (and there need to be other changes), leaving those for you.
It is necessary to pass all the parameters to ‘LunaFlores’ as extra parameters (see the documentation section on Passing Extra Parameters for details). Also, ‘P(1)’ should be ‘C(3)’. I made those corrections and corrected the resulting function call in the ode23 call, however it is still not workign correctly.
Those problems are fairly obvious, since the code does not match the posted symbolic code, and likely needs to. Code ‘C(1)’ as ‘X’, ‘C(2)’ as ‘S’, and ‘C(3) as ‘P’ throughout the code. With those changes and other corrections required for the code to match the posted symbolic differential equations, it should work.
CobaLunaFlores_ode23
function CobaLunaFlores_ode23
Rentang = linspace(0, 80, 50);
C0 = [28.90 0.62 0.07586];
Miumax=0.145;
Ks=1.6607;
Ki=50.3151;
Kp=8798.15;
gamma=3.6658;
Yxs=0.3941;
alfa=371.45;
betha=1.5502;
ms=0.005;
[t,C]=ode23(@(t,C)LunaFlores(t,C,Miumax,gamma,ms,betha,Kp,Ki,alfa,Ks,Yxs),Rentang,C0);
figure
plot(t,C)
% set(gca, 'YScale','log')
legend('C_1','C_2','C_3', 'Location','best')
end
function dCdt=LunaFlores(t,C,Miumax,gamma,ms,betha,Kp,Ki,alfa,Ks,Yxs)
dCdt(1,:)=((Miumax*C(1))/(Ks+C(1)+(C(1)^2/Ki))*(1-C(3)/Kp)^gamma)*C(2);
dCdt(2,:)= -C(2)*((((Miumax*C(1))/(Ks+C(1)+(C(1)^2/Ki))*(1-C(3)/Kp)^gamma)/Yxs)+ms);
dCdt(3,:)= C(2)*(alfa*((Miumax*C(1))/(Ks+C(1)+(C(1)^2/Ki))*(1-C(3)/Kp)^gamma)+betha);
end
I will provide further help if you require it, however the changes needed to get this running correctly are obvious and should be easy to fix.
.
  7 Comments

Sign in to comment.

More Answers (0)

Categories

Find more on View and Analyze Simulation Results 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!