function u = CalcBlockCase4(x,v,d,p)
% model for level and concentration 
q2   = d(1);                           % [kg/s], inlet flow 2
c1    = d(2);                          % [kg/kg] inlet flow 1 concentration 
c2    = d(3);                          % [kg/kg] inlet flow 2 concentration 
A     = p(1); 
c    = x;                                          % [kg/kg], concentration
%backcalculate u from v
u = (A*(c-v)+q2*(c-c2))/(c1-c);
% u = (q2*(c-c2)+q2*v+A*c)/(c1-c-v);
end