function dae = TempMixDAE(u,p,d,x)
% model for temprature mixer (shower)

V    = p(1);                                            % [m3] tank holdup
T    = x;                                      % [degC] temperature = state

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

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

q    = q1+q2;                                   % steady-state mass balance
dTdt = 1/V*(q1*(T1-T)+q2*(T2-T)); % dynamic energy balance:temperature form   
dae  = [q; dTdt];                                      % system of DAE eqns
end