function f = output_dynamic(X,U,D)

parameters_c

% Inputs
LT = U(1);                             % Reflux
VB = U(2);                             % Boilup

% Disturbances
F  = D(1);                             % Feedrate
qF = D(2);                             % Feed liquid fraction
zF = D(3:end);                         % Feed compositions

% Splitting the states
x = X(1,1:(NC-1)*NT);                   % Liquid compositions from btm to top
M = X(1,(NC-1)*NT+1:NC*NT)';            % Liquid hold up from btm to top
TL = X(1,(NC*NT)+1:(NC*NT)+NT)';        % Temperatures from btm to top

% Rearrange elements of composition vector (x) for later use
Iu = reshape(1:(NC-1)*NT,NT,NC-1);
x  = x(Iu);  

% The reactive distillation model
model_c_simple


%    1  2  3  4     5       6     7   8   9    10     11       12   
f = {L, V, D, B, GP_per, EP_per, GP, EP, CGL, CMet, CGL_per, CMet_per};