doing MINLP with user-defined functions

32 views
Skip to first unread message

anon

unread,
Nov 8, 2016, 11:07:35 AM11/8/16
to julia-opt
Apologies for the fact that I keep posting issues, I just keep hitting roadblocks.

I have the code:

using JuMP
using AmplNLWriter

objfunc(n) = n^4 + n^3 -2n^2 + 1
JuMP.register(:objfunc, 1, objfunc, autodiff=true)

model = Model(solver=CouenneNLSolver())

@variable(model, -2 <= n <= 1, Int)

@NLobjective(model, Min, objfunc(n))
solve(model, suppress_warnings=true)

println(getvalue(n))

I get the error:

Error: LoadError: KeyError: objfunc not found.

If I just use the default solver and don't include the Int constraint, then it runs fine, so it has something to do with the CouenneNLSolver.

Miles Lubin

unread,
Nov 11, 2016, 1:41:46 PM11/11/16
to julia-opt
User-defined functions are not supported in AmplNLWriter. It's worth opening an issue complaining about the error message, however.
Reply all
Reply to author
Forward
0 new messages