% This file calls the new ODE solver, ode113, which is a multi
% step integration routine to solve the tank model of section 
% 3.6.
%
[T, Z] = ode113('fun34',[ 0 3.0], 1.0);

%
% F1 is the dimensionless inflow rate;
% F2 is the dimensionless outflow rate;
% P2 is the dimensionless pressure at the tank bottom.
%
P2 = 0.735 + 0.2167*Z;
P1 = 1.;
P3 = .785;
F1 = 4.541*sqrt(P1-P2);
F2 = 4.541*sqrt(P2-P3);

plot(T,Z,'-', T,F1,'--', T,F2,'-.', T,P2,':');
title('Dimensionless Tank Response (tank34)');
xlabel('Dimensionless time');
text(0.5, 1.6, 'Dimensionless outflow rate');
text(0.5, 1.37, 'Dimensionless inflow rate');
text(0.5, 0.8, 'Dimensionless tank height');
text(0.5, 0.95, 'Dimensionless tank bottom pressure');
