Question about Ipopt solver

using JuMP
using Ipopt

@variable(m, x1)
@variable(m, x2)
@variable(m, x3)
@NLobjective(m, Max, (log(x1)+log(x2)+log(x3)-1/(1-x1-x2-x3)^2))
return getvalue(x1), getvalue(x2), getvalue(x3),getobjectivevalue(m)

After I run the code, it shows that “Invalid number in NLP function or derivative detected.” Could any one tell me what does that mean?

The default start value for variables is zero, so at the start value your objective function is taking the log of zero. You can use the start keyword when creating the variables to use a different value, see Variables · JuMP, or reformulate your problem with a change of variables yi = log(xi).


1 Like