%
% Example 4.5: Flowrate Damping
%
% Bob Newell, May 1996
%
%-------------------------------------------------------
%
global alpha
alpha = 360;
global beta
beta = 1.5;
global fin
fin = 1.5;
%
xo = [ 0.01976 0.01976 ];
[ t, x ] = ode45( 'Two_Weir_Tanks', [ 0 15 ], xo );
%
[ n, m ] = size( x );
flow = zeros( n, m );
for i = 1:n,
  flow(i,:) = alpha * x(i,:) .^ beta;
end;
%
font = 20;
figure
plot( t, flow )
axis( [ 0 15 1 1.6 ] )
set( gca, 'fontsize', font );
sylabel( '\20Flow in m^3/min' )
xlabel( 'Time in minutes' )
%legend( 'Settler', 'Aerator', -1 )
h = text( 1, 1.5, 'Settler' );
set( h, 'fontsize', font );
h = text( 4.5, 1.4, 'Aerator' );
set( h, 'fontsize', font );
%
printsto -f1 -deps2 ex4-5a.eps
close all;
%
disp( 'Final Heights above Weir:' );
x( n, : )
%
alpha = 180;
xo = [ 0.031368 0.031368 ];
[ t, x ] = ode45( 'Two_Weir_Tanks', [ 0 15 ], xo );
%
[ n, m ] = size( x );
flow = zeros( n, m );
for i = 1:n,
  flow(i,:) = alpha * x(i,:) .^ beta;
end;
%
figure
plot( t, flow )
axis( [ 0 15 1 1.6 ] )
set( gca, 'fontsize', font );
sylabel( '\20Flow in m^3/min' )
xlabel( 'Time in minutes' )
%legend( 'Settler', 'Aerator', -1 )
h = text( 2, 1.5, 'Settler' );
set( h, 'fontsize', font );
h = text( 7, 1.4, 'Aerator' );
set( h, 'fontsize', font );
%
disp( 'Final Heights above Weir:' );
x( n, : )
%
printsto -f1 -deps2 ex4-5b.eps
close all;
%
%-------------------------------------------------------
% the end
