% This m-file runs a simulation of the two-tank system
% described in ME 244L Lab 1, pp. 18-19.
% Jan 21, 1997 rgl; Updated July 15, 1998 by rgl
%
% This routine uses rkfixed.m and calls the
% m-file 'twotanks'
%
% The initial conditions are V1(t=0) = 0.5 and V2(t=0) = 0.5
%
% clear memory of previous values (not always necessary)
clear
% Set the initial condition vector
V0 = [0.75;0.25];
%
% rk4fixed.m syntax: [T,X]=rk4fixed(Fcn,Tspan,X0,N)
%
t0 = 0;
tf = 2;
N = 100;
%
[t,V] = rk4fixed('twotanks',[t0 tf],V0,N);
plot(t,V)
title('Volume in Tanks vs. Time'); xlabel('Time'); ylabel('Volume');
