%
% Example 5.3: Carbon Removal Process
%
% - constant volume
% - well mixed
% - Monod kinetics
% - no biomass in effluent
% - no clarifier dynamics
% - same substrate in effluent, recycle & wastage
% - no oxygen in recycle & wastage
%
% Bob Newell, March 1996
%
%-----------------------------------------------------------
% parameters
muhat = 3.733;
Ks = 20;
Koh = 0.2;
Yh = 0.6;
bh = 0.4;
fp = 0.1;
a = 166;
b = 16;
So_sat = 10;
air = 6.3;
%
global p
p = [ muhat Ks Koh Yh bh fp a b So_sat air ];
%-----------------------------------------------------------
% initial states
V = 12.5;
Ss = 4.4;
So = 3;
Xh = 850;
%
xo = [ V Ss So Xh ];
%-----------------------------------------------------------
% integrate the state equation
p(10) = 7.3;
[ t, x ] = ode45( 'Carbon_Removal', [ 0 3/24 ], xo );
figure;
h1 = plot( 24*t, x(:,3), '--' );
set( gca, 'fontsize', 20 );
axis( [ 0 3 2 4 ] );
xlabel( 'Time in hours' )
ylabel( 'Dissolved Oxygen in mg/l' )
hold on
% integrate the state equation
p(10) = 5.3;
[ t, x ] = ode45( 'Carbon_Removal', [ 0 3/24 ], xo );
h2 = plot( 24*t, x(:,3), '--' );
% integrate the state equation
p(10) = 7.3;
[ t, x ] = ode45( 'Linear_Carbon_Plant', [ 0 3/24 ], [ 0; 0 ] );
h3 = plot( 24*t, x(:,2)+3, '-' );
% integrate the state equation
p(10) = 5.3;
[ t, x ] = ode45( 'Linear_Carbon_Plant', [ 0 3/24 ], [ 0; 0 ] );
h4 = plot( 24*t, x(:,2)+3, '-' );
hold off
legend( [ h3 h1 ], 'Linear', 'Nonlinear', 0 );
%
print -f1 -deps2 ex5-3.eps
%-----------------------------------------------------------
% the end! 