Hi,
I've been using and greatly appreciating nlopt. I've been using COBYLA
and ISRES with good success, and I'd like to use AUGLAG. I use the
Octave interface (Matlab at work), but I can't seem to get AUGLAG to
work. I've attached a sample optimization below, which returns -2 -
invalid arguments. As the COBYLA runs clean on the same code (less the
local local optimization stuff), any hints on what I'm forgetting?
function y= obj(x)
y=26.*x(1)+30.*x(2)+20.*x(3)+8.*x(4);
end
function y = production(x)
y=1000.*x(1)+1000*x(2)+1000.*x(3)+x(4)
end
function y = manganese(x)
y=4.5*x(1)+5*x(2)+4.0*x(3)+x(4)
end
function y = sil(x)
y=40*x(1)+10*x(2)+6*x(3)
end
opt=struct;
opt.min_objective=@obj;
%opt.algorithm=NLOPT_LN_COBYLA;
opt.algorithm=NLOPT_AUGLAG_EQ;
opt.local_optimizer.algorithm = NLOPT_LN_BOBYQA;
opt.local_optimizer.ftol_rel = 1e-6;
opt.maxeval=500;
%opt.xtol_abs=.0001;
opt.verbose=1;
opt.h{1}=@(x) 1000-production(x);
opt.fc{1}=@(x) 4.5-manganese(x);
opt.fc{2}=@(x) 32.5-sil(x);
opt.fc(3)=@(x) sil(x)-55;
opt.lower_bounds=[0 0 0 0];
[xopt,fopt,retcode]=nlopt_optimize(opt, [1 1 1 1]);
Thanks,
--Mike Williams
_______________________________________________
NLopt-discuss mailing list
[email protected]
http://ab-initio.mit.edu/cgi-bin/mailman/listinfo/nlopt-discuss