%
% Example 4.3A: Simple Fermentation Process
%
% Bob Newell, May 1996
%
%-----------------------------------------------------------
%
function dxdt = Simple_Fermentation( t, x )
global p
%
% x = [ 1=V 2=Xs 3=Sf 4=Sa 5=Xh ];
% p = [ 1=Kh 2=Kx 3=qfe 4=Kfe 5=fsi ];
%
%-----------------------------------------------------------
%
  hydrol = p(1) * x(2) / ( p(2) + x(2) / x(5) );
  ferment = p(3) * x(3) * x(5) / ( p(4) + x(3) );
%
  dxdt = zeros( 5, 1 );
  dxdt(1) = 0;
  dxdt(2) = - hydrol;
  dxdt(3) =  hydrol * ( 1 - p(5) ) - ferment;
  dxdt(4) = ferment;
  dxdt(5) = 0;
%-----------------------------------------------------------
% the end!   
