
function [x2]=Transform_Static(x,u,d,p,v)

%Defining states
T_1 = x(1);                                   %Temperature of tank 1 [degC]
T_2 = x(2);                                   %Temperature of tank 2 [degC]
h_1 = x(3);                                           %Height of tank 1 [m]
h_2 = x(4);                                           %Height of tank 2 [m]

%Defining inputs
T_0 = u(1);                          %Temperature of inlet to tank 1 [degC]
F_2 = u(2);
F_1 = u(3);

%Defining disturbances
F_0 = d(1);                               %Flow of inlet to tank 1 [m3/min]
F_d = d(2);                         %Flow of disturbance to tank 2 [m3/min]
T_d = d(3);                    %Temperature of disturbance to tank 2 [degC]

%Defining parameters
A_1 = p(1);                                            %Area of tank 1 [m2]                                                     
A_2 = p(2);                                            %Area of tank 2 [m2]
c_p = p(3);                     %specific heat capacity of fluid [kJ/(kgK)]
rho = p(4);                                       %density of fluid [kg/m3]
g = p(5);                             %acceleration due to gravity [m/min2]

%Defining Transformed Inputs
v = v(1);

%x2 = (F_1*T_1+F_d*T_d)/(F_1 +F_d);

x2 = (-F_d*(T_d-v)+F_1*v)/F_1;

end

