function u = CalcBlock(v,y,d,p)
% static calculation block to solve for u = f(ut)

c1    = p(1);                           %[kg/kg] inlet flow 1 concentration 
c2    = p(2);                           %[kg/kg] inlet flow 2 concentration 
tau02 = p(3);                                            % tuning parameter
  
M     = y(1);                                                  % CV1: level
c     = y(2);                                          % CV2: concentration

% reformulate as linear system: Au=B with u = [u1;u2]-original inputs
A = [1 1; tau02/M*(c1-c) tau02/M*(c2-c)]; % condition: c1 different that c2
B = [v(1)+d; v(2)-c];

u = A\B;                                         % solve as a linear system

end