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

c1    = d(2)*1;                         %[kg/kg] inlet flow 1 concentration 
c2    = d(3)*1;                         %[kg/kg] inlet flow 2 concentration 
M     = d(4)*1;                                         % [kg], tank holdup


c    = x;                                          % [kg/kg], concentration

q1   = u;                                          % [kg/s], physical input 

q2   = d(1);                                          % [kg/s], disturbance



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

ode = dcdt;                                                         % model

end