%
% Example 3.1: Constant Volume Tank
%
% Bob Newell, March 1996
%
%-----------------------------------------------------------
% parameters
%
global p
p = [];
%-----------------------------------------------------------
% initial states
M = 1000;
%
xo = [ M ];
%-----------------------------------------------------------
% integrate the state equation
to = clock;
[ t, x ] = ode45( 'Constant_Volume_Tank', [0 300], xo );
etime( clock, to )
%-----------------------------------------------------------
% evaluate the outputs
y = Constant_Volume_Tank_Outputs( t, x ); 
%-----------------------------------------------------------
% plot the results
figure;
hax = plotyy( t, y(:,1), t, y(:,2) );
axesyy( hax, [ 0 300 -15 15 0 30 ], ...
   'Time in seconds', ...
   'Inlet flowrate in kg/s', ...
   'Outlet flowrate in kg/s', 2, ...
   [ 0 5 10 15 ], [0 5 10 15 ] );
%
print -f1 -deps2 ex3-1.eps
%-----------------------------------------------------------
% the end!   
