%
% Example 3.4: Simple Aerated Tank
%
% Bob Newell, March 1996
%
%-----------------------------------------------------------
% parameters
Ka = 2;
So_sat = 10;
%
global p
p = [ Ka So_sat ];
%-----------------------------------------------------------
% initial states
M = 1;
Ss = 200;
So = 3;
%
xo = [ M Ss So ];
%-----------------------------------------------------------
% integrate the state equation
to = clock;
[ t, x ] = ode45( 'Simple_Aerated_Tank', [0 1], xo );
etime( clock, to )
%-----------------------------------------------------------
% evaluate the outputs
y = Simple_Aerated_Tank_Outputs( t, x ); 
%-----------------------------------------------------------
% plot the results
figure;
hax = plotyy( 24*t, y(:,7), 24*t, y(:,6) );
axesyy( hax, [ 0 24 -10 10 0 20 ], ...
   'Time in hours', ...
   'Air flowrate in m^3/hr', ...
   'Outlet oxygen in mg/l', 0 );
%
print -f1 -deps2 ex3-4.eps
%-----------------------------------------------------------
% the end!   
