function [u, du_dUcool] = uinlet(y,params)

Uhot  = params(1);
Ucool = params(2);
Thot  = params(3);
Tcool = params(4);
kg    = params(5);
kw    = params(6);
L     = params(7);
tw    = params(8);
h     = params(9);

if (y > h),
  u = Uhot;
  du_dUcool = 0.0;
elseif (y > 0),
  u = Ucool;
  du_dUcool = 1.0;
elseif (y < -tw),
  u = Ucool;
  du_dUcool = 1.0;
else,
  u = 0.0;
  du_dUcool = 0.0;
end
