How to Combine ODE Plots with Different Initial Concentration
5 views (last 30 days)
Show older comments
Hello everyone. I want to plot the effect of initial substrate concentration to the substrate consumption, biomass growth, and product formation. My matlab code right now plots the substrate, biomass, and product concentration in one graph; hence if I want to know the effect of initial substrate concentration, I need to make separate graph for each initial substrate concentration and it is hard to see the trend/effect of initial substrate to the biomass and product. Here is the picture to illustrate what I meant:
To overcome that, I want to change my graph so that I only have 3 graphs: (1) substrate, (2) biomass, (3) product, but in each graph, there are several plots based on the initial substrate concentration. Here are some graphs from Nandasana and Kumar (2008) to illustrate what I meant:
I would like to ask, how to do the matlab code in order to achieve the graph that I am aiming for? Should I use the "hold" function? I also attach the file that I use to code my graph. Thank you everyone for your attention, any little help or advice are welcomed! Have a good day!
Here is a little explanation about my code:
function Substrate5
Rentang = linspace(0, 48, 50);
C0 = [0.2781456954 5.197889182 52.77015848]; %biomass, substrate, product initial concentration
%change the substrate concentration for variation
The number "5.197889192" represent the initial substrate concentration and I change the number manually into 11, 20, and 40 g/L respectively to simulate the effect of substrate variation to substrate consumption, biomass production, and product formation.
Miumax=0.14824;
Ks=1.84795;
Ki=53.86082;
Kp=9386.18165;
gamma=2.67784;
Yxs=0.39971;
alfa=380.88450;
betha=1.51685;
ms=0.00001;
[t,C]=ode45(@(t,C)ParameterLuna(t,C,Miumax,Ks,Ki,Kp,gamma,Yxs,alfa,betha,ms),Rentang,C0);
These code above shows the kinetic parameters and the ODE code
figure
hold on
yyaxis left
plot(t,C(:,1),'-g',t,C(:,2),'-b');
ylabel('Biomassa (g/L), Substrat (g/L)')
ylim([min(C(:,1)) max(ylim)])
ylim([min(C(:,2)) max(ylim)])
yyaxis right
plot(t,C(:,3),'r');
ylabel('Astaksantin(\mug/L)')
ylim([min(C(:,3)) max(ylim)])
hold off
xlabel('Waktu (jam)')
grid
legend('Biomassa','Substrat','Karotenoid', 'Location','best')
xlswrite('data.xlsx',[t(:),C(:,:)]);
end
These code above shows how to plot the graph
function dCdt=ParameterLuna(t,C,Miumax,Ks,Ki,Kp,gamma,Yxs,alfa,betha,ms)
mu = ((Miumax*C(2))/(Ks+C(2)+(C(2)^2/Ki)))*((1-C(3)/Kp)^gamma);
dCdt(1,:) = mu*C(1);
dCdt(2,:) = -C(1)*((mu/Yxs)+ms);
dCdt(3,:) = C(1)*((alfa*mu)+betha);
end
The code above shows the kinetic equations that will be solved by the ODE function.
0 Comments
Accepted Answer
VBBV
on 15 Mar 2022
Rentang = linspace(0, 48, 50);
C0 = [0.2781456954 5.197889182 52.77015848]; %biomass, substrate, product initial concentration
%change the substrate concentration for variation
Miumax=0.14824;
Ks=1.84795;
Ki=53.86082;
Kp=9386.18165;
gamma=2.67784;
Yxs=0.39971;
alfa=380.88450;
betha=1.51685;
ms=0.00001;
C0 = C0+rand(3,3) % assuming you have matrix of concentration values
for k = 1:length(C0)
[t,C]=ode45(@(t,C)ParameterLuna(t,C,Miumax,Ks,Ki,Kp,gamma,Yxs,alfa,betha,ms),Rentang,C0(k,:));
figure(1)
plot(t,C(:,1),'-g')
hold on
ylabel('Biomassa (g/L)')
figure(2)
plot(t,C(:,2),'-b');
hold on
ylabel('Substrat (g/L)')
figure(3)
plot(t,C(:,3),'r');
hold on
ylabel('Astaksantin(\mug/L)')
end
function dCdt=ParameterLuna(t,C,Miumax,Ks,Ki,Kp,gamma,Yxs,alfa,betha,ms)
mu = ((Miumax*C(2))/(Ks+C(2)+(C(2)^2/Ki)))*((1-C(3)/Kp)^gamma);
dCdt(1,:) = mu*C(1);
dCdt(2,:) = -C(1)*((mu/Yxs)+ms);
dCdt(3,:) = C(1)*((alfa*mu)+betha);
end
3 Comments
More Answers (0)
See Also
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!