function dy = BioChem_FBmodel(t,y)

% FBmodel2: Fed-batch simulation model file
% Initiated by BioChem_FBstart2

% Model parameters
qSmax   = 1.6;
Ks      = 0.1;
qm      = 0.04; 
Yem     = 0.5;
Si      = 500;
F0      = 0.03;
SFR     = 0.3;
Fmax    = 0.8;


% Feed Schedule
F = F0*exp(SFR*t);

if F > Fmax
    F = Fmax;
end

qS   = qSmax*y(2)/(y(2)+Ks);
My   = (qS-qm)*Yem;

dy = zeros(3,1);

dy(1) = -F/y(3)*y(1)+My*y(1);
dy(2) = F/y(3) *(Si-y(2))-qS*y(1);
dy(3) = F;

end