function maxh = fobj_eta(lambda)

global Plothandle C1 H freq 

meq=lambda(1);
keq=lambda(2);
etaeq=lambda(3);
%ceq=2*meq*sqrt(keq/meq)*ksieq;

for ii=1:length(freq)
  omeg=2*pi*freq(ii);
  Hnum(ii)=-omeg^2/(-omeg^2*meq+keq*(1+1i*etaeq));
end;
  H12=20*log10(abs(Hnum)); 


set(Plothandle,'ydata',H12)
drawnow

erro=H-Hnum;

% for ii=1:2*length(lambda)
%     g(ii)=0;
% end
% 
% if meq - rest_meq(1) < 0
%     g(1) = - meq + rest_meq(1);
% end
% 
% if -meq + rest_meq(2) <0
%     g(2) = meq - rest_meq(2);
% end
% 
% if keq - rest_keq(1) < 0
%     g(3) = - keq + rest_keq(1);
% end
% 
% if -keq + rest_keq(2) <0
%     g(4) = keq - rest_keq(2);
% end
% 
% if etaeq - rest_ksieq(1) < 0
%     g(5) = rest_ksieq(1) - etaeq;
% end
% 
% if -etaeq + rest_ksieq(2) <0
%     g(6) = etaeq - rest_ksieq(2);
% end


emq = conj(erro)*erro.';

maxh = emq;% + (g(1)^6 + g(2)^6 + g(3)^6 + g(4)^6 + g(5)^6 + g(6)^6);
