function ode = model(x,u,d,p)
% model for level and concentration 

c1    = p(1);                           %[kg/kg] inlet flow 1 concentration 
c2    = p(2);                           %[kg/kg] inlet flow 2 concentration 
%tau02 = p(3);                                           % tuning parameter

M    = x(1);                                            % [kg], tank holdup
c    = x(2);                                  % [kg/kg], concentration

q1   = u(1);                                     % [kg/s], physical input 1
q2   = u(2);                                     % [kg/s], physical input 2

q    = d;                                             % [degC], disturbance

dMdt = q1+q2-q;                                              % mass balance

tau  = M/(q1+q2);                                          % rezidence time
dcdt = 1/tau*((q1*c1+q2*c2)/(q1+q2)-c);                 % component balance

ode = [dMdt; dcdt];                                                 % model

end