doing MINLP with user-defined functions

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

doing MINLP with user-defined functions

anon
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.

--
You received this message because you are subscribed to the Google Groups "julia-opt" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
Visit this group at https://groups.google.com/group/julia-opt.
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|

Re: doing MINLP with user-defined functions

Miles Lubin
User-defined functions are not supported in AmplNLWriter. It's worth opening an issue complaining about the error message, however.

On Tuesday, November 8, 2016 at 11:07:35 AM UTC-5, anon wrote:
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.

--
You received this message because you are subscribed to the Google Groups "julia-opt" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
Visit this group at https://groups.google.com/group/julia-opt.
For more options, visit https://groups.google.com/d/optout.