Hi,
In my model I iterate over a lot of different values and solve a
constrained optimisation problem but for some values of my lower and upper
bounds I get an error saying "invalid NLopt arguments". I am not sure why
as my lower bound is < upper bound in all the iterations. I tried to
understand this using a more simple example such as the following but even
for this simple example if I set the bounds to (1,100) it's fine but if I
use (2,100) I get the same error. Why is this?:
using NLopt
function simpleopt(lbA1, ubA1)
z=1
function test_max(x,z)
x[1]^2 + z
end
count = 0
function func(x::Vector, grad::Vector)
global count +=1
println("f_$count($x)")
test_max(x[1],z)
end
opt = Opt(:LN_SBPLX,1)
lower_bounds!(opt, [lbA1])
upper_bounds!(opt, [ubA1])
min_objective!(opt, func)
(minf,minx,ret)=optimize(opt,[1])
println("got $minf at $minx after $count iterations (returned $ret)")
end