Dear Julia experts,
I have been using JuMP and NLopt for an optimization problem about a year ago and in trying to rerun the code which worked, I am getting an error message. I have three non-linear constraints (I am only showing one here) and I am trying to register my function(the actual function is not shown) using JuMP.register and find maximum of the function.
Please see my code below along with the error message.
p = 10
m1 = Model(solver=NLoptSolver(algorithm=:LN_COBYLA))
#- define variables
##-- my own function --##
JuMP.register(m1, :myf1, 2*p, myf1)
@NLobjective(m1, Max, myf1(a,a,a,a,a,a,a,a,a,a,b,b,b,b,b,b,b,b,b,b))
@constraint(m1, a’*a .== 1)
ERROR MESSAGE :
julia> JuMP.register(m1, :myf1, 2*p, myf1)
register has no method matching register(::JuMP.Model, ::Symbol, ::Int64, ::Function)
Closest candidates are:
register(::Symbol, ::Integer, ::Function, ::Function)
register(::Symbol, ::Integer, ::Function, ::Function, ::Function)
I tried to change the order to the candidates but cannot find the syntax that works.
Can someone please help me to fix the error?