Uptake kinetics

The upper and lower bounds for the exchange fluxes specified in exID in main.m are specified in this file. The output of this function is two matrices, lb and ub. Each row of these matrices contains the information of an FBA model. The bounds are specified in the same order used for exID in main.m.

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% DFBAlab: Dynamic Flux Balance Analysis laboratory %
% Process Systems Engineering Laboratory, Cambridge, MA, USA %
% July 2014 %
% Written by Jose A. Gomez and Kai Höffner %
% %
% This code can only be used for academic purposes. When using this code %
% please cite: %
% %
% Gomez, J.A., Höffner, K. and Barton, P. I. %
% DFBAlab: A fast and reliable MATLAB code for Dynamic Flux Balance %
% Analysis. Submitted. %
% %
% COPYRIGHT (C) 2014 MASSACHUSETTS INSTITUTE OF TECHNOLOGY %
% %
% Read the LICENSE.txt file for more details. %
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

function [lb,ub] = RHS( t,y,INFO )

% Y1 = Volume (L)
% Y2 = Biomass Yeast (gDW/L)
% Y3 = Biomass Algae (gDW/L)
% Y4 = Glucose (mmol/L)
% Y5 = O2 (mmol/L)
% Y6 = Total Carbon (mmol/L)
% Y7 = Ethanol (mmol/L)
% Y8 = Acetate (mmol/L)
% Y9 = Total Nitrogen (mmol/L)
% Y10 = Penalty
% Y11 = NH4+
% Y12 = NH3
% Y13 = CO2
% Y14 = HCO3-
% Y15 = CO3 -2
% Y16 = H +

% This subroutine updates the upper and lower bounds for the fluxes in the
% exID arrays in main. The output should be two matrices, lb and ub. The lb matrix
% contains the lower bounds for exID{i} in the ith row in the same order as
% exID. The same is true for the upper bounds in the ub matrix.

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% Yeast
% Glucose
if (y(4)<0)
lb(1,1) = 0;
else
lb(1,1) = -(20*y(4)/(0.5/0.18 + y(4)))*1/(1+y(7)/(10/0.046));
end
ub(1,1) = 0;

% Oxygen
lb(1,2) = -8*y(5)/(0.003/0.016 + y(5));
ub(1,2) = 0;

% CO2
lb(1,3) = 0;
ub(1,3) = 1000;

% Ethanol
lb(1,4) = 0;
ub(1,4) = 1000;

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% Algae
% HCO3
lb(2,1) = 0;
ub(2,1) = 0;

% Acetate
lb(2,2) = -14.9*y(8)/(2.2956+y(8)+y(8)^2/0.1557);
ub(2,2) = 0;

% Oxygen
lb(2,3) = -1.41750070911*y(5)/(0.009+y(5));
ub(2,3) = 1000;

% CO2
% if y(6) < 0
% lb(2,4) = 0;
% else
lb(2,4) = -2.64279793224*y(13)/(0.0009+y(13));
% end
ub(2,4) = 1000;

% Light
Ke1 = 0.32;
Ke2 = 0.03;
L = 0.4; % meters depth of pond
Ke = Ke1 + Ke2*(y(3)+y(2)/2);
Io = 28*(max(sin(2*pi()*t/48)^2,sin(2*pi()*5/48)^2)-sin(2*pi()*5/48)^2)/(1-sin(2*pi()*5/48)^2);
lb(2,5) = 0;
ub(2,5) = Io*(1-exp(-L*Ke))/(Ke*L);

for i=6:16
lb(2,i) = 0;
ub(2,i) = 0;
end

% H+
lb(2,17) = -10;
ub(2,17) = 1000;

% Autotrophic growth
lb(2,18) = 0;
ub(2,18) = 0;

% Mixotrophic growth
lb(2,19) = 0;
ub(2,19) = 1000;

% Heterotrophic growth
lb(2,20) = 0;
ub(2,20) = 0;

% Non-growth associated ATP maintenance
lb(2,21) = 0.183;
ub(2,21) = 0.183;

% Starch
lb(2,22) = 0;
ub(2,22) = 0;

% Photoevolved oxygen
lb(2,23) = 0;
ub(2,23) = 8.28;

% Ethanol
lb(2,24) = 0;
ub(2,24) = 0;

% H+
lb(2,25) = -10;
ub(2,25) = 1000;

end