% HEAT EXCHANGER 1

function [sys,x0] = HX1(t,x,u,flag)

HXindex = 1; % HX number
N = 10; % Model order


if abs(flag) == 1
    display('flag = 1')
    sys = Dynamic(t,x,u,N,HXindex);
    disp(sys)
    
elseif abs(flag) == 3
    display('flag = 3')
    sys(1,1) = x(N); % Outlet hot temperature
    sys(2,1) = x(3*N); % Outlet cold temperature (Tend)
    disp(sys)
    
elseif flag == 0
    display('flag = 0')
    x0 = ssvar(HXindex,N);
    sys = [3*N,0,2,4,0,0];
    disp(sys)
    
else
   sys = [];
   
end

end
