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.