function [gf_nlp,gg_nlp,C,B] = grad (x,y)

if size(x,2) > 3
  y = x(4:6);         % NLP com integralidade relaxada
end

% * * *  exemplo 1 - Kocis e Grossmann(1987) * * *
gf_nlp(1) =-8.9/(1+x(1))+1.8;
gf_nlp(2) =-10.44/(1+x(2))+1.8;
gf_nlp(3) =-2.9;
gg_nlp(1,1) =0.9/(1+x(1));
gg_nlp(1,2) =1.08/(1+x(2));
gg_nlp(1,3) =0.9;
gg_nlp(2,1) =1/(1+x(1));
gg_nlp(2,2) =0;
gg_nlp(2,3) =0;
gg_nlp(3,1) =0;
gg_nlp(3,2) =1.2/(1+x(2));
gg_nlp(3,3) =0;
gg_nlp(4,1) =0;
gg_nlp(4,2) =0;
gg_nlp(4,3) =0;

if nargout > 2 | size(x,2) > 3
  C = [3.5, 1, 1.5];  
  B = [-1, 0, 0; 0, -10, 0; 0, 0, -10; 0, 1, 1];
end

if size(x,2) > 3         % NLP com integralidade relaxada
  gf_nlp = [gf_nlp C];
  gg_nlp = [gg_nlp B];
end
gg_nlp=gg_nlp';

