function [sys,x0]=accum(T,x,u,flag,nc,M0)
%
% simple accumulator model with constant holdup
% state vector consists of composition vector
% input vector contains inflow + inflow composition vector
if (flag==1)
   qin=u(1);
   xin=u(2:nc);
   qout=qin;
   sys=qin*(xin-x(1:nc-1))/M0;
elseif (flag==3)
   sys=x;
end

   
   
