function [c, ceq] = dumax(x)
global bb Hc ii x0 x_interior u1_armazenado u2_armazenado

FF = (length(Hc)-1); %variável auxiliar
% if ii ==1
% %     u1 = x0(1);
% %     u2 = x0(FF+1);
%      u1 = u1_armazenado(ii);
%      u2 = u2_armazenado(ii);
% else
%     u1 = u1_armazenado(ii+1);
%     u2 = u2_armazenado(ii+1);
% end
     u1 = u1_armazenado(ii);
%     u2 = u2_armazenado(ii);

u1op = [u1 x(1:FF)]; %Metade dos resultados correspondem aos refluxos ótimos
% u2op = [u2 x(FF+1:2*FF)]; %A metade final são as vazões de vapor


 for i = 1:FF;
     c2u1(i) = abs(u1op(i) - u1op(i+1)) - bb(1);
%      c2u2(i) = abs(u2op(i) - u2op(i+1)) - bb(2);
 end

%c(1:length(u1op)-1) = abs(u1op(1:length(u1op)-1) - u1op(2:end))' - bb(1:length(u1op)-1);
%c(length(u1op):length(x)) = abs(u2op(1:length(u1op)-1) - u2op (2:end))' - bb(length(u2op ):length(x));

% Nonlinear equality constraints
c = c2u1;
ceq = [];