function [zz,pe]=sscheck(data,varargin);
if length(varargin)==0, tol=5; % default steady-state tolerance
                                % threshold
elseif length(varargin)==1, tol=varargin{1};
end

[F, y, z, X]=unpack(data);  % Unpacks the data matrix into component parts
Ti=sum(F')+z';     % inputs
Tj=sum(F)+y;       % outputs
pe=abs(((Ti-Tj)./Tj))*100; % SSerror as percent of node throughflow
zz=sum(pe>=tol);      % determines if any node difference is greater than 5% of Tj

if zz==0
    %   disp('model is at steady-state')
else
    disp('model is not at steady-state')
    d=Ti-Tj;
    pe;
end


