function v = InputTransfD(u,p,d,x)
% static calculation block to find v = f(u,x,d)

T1 = d(1);                   % [degC], disturbance inlet flow 1 temperature
T2 = d(2);                   % [degC], disturbance inlet flow 1 temperature

T  = x;                                    % diff state. temperature [degC]
V  = p(1);                                               % tank holdup [m3]
A  = p(2);                                               % tuning parameter
B  = p(3);                                               % tuning parameter

q1 = u(1);                                            % [m3/s] inlet flow 1
q2 = u(2);                                            % [m3/s] inlet flow 2

f2 = 1/V*(q1*(T1-T)+q2*(T2-T)); % dynamic energy balance:temperature form  

v1 = q1+q2;
v2 = B^(-1)*(f2-A*T);
v  = [v1;v2];                                          % transformed inputs
end