function [J,Jacobian] = myfcost(zeta)
zeta=min(zeta,3);zeta=max(.001,zeta);
assignin('base','zeta',zeta)
sim('mymod');
out=eval('base','out');   % get J in the  workspace 
dout=eval('base','dout'); % get dJ/dzeta  workspace 
J=out;                    % Objective function 
if nargout > 1            % Two output arguments
   Jacobian = dout;       % Jacobian of the function (ADGM) 
end
