using JuMP
using Ipopt
m=Model(solver=IpoptSolver())
@variable(m, x1)
@variable(m, x2)
@variable(m, x3)
@NLobjective(m, Max, (log(x1)+log(x2)+log(x3)-1/(1-x1-x2-x3)^2))
@constraint(m,0<=x1)
@constraint(m,0<=x2)
@constraint(m,0<=x3)
@constraint(m,x1+x2+x3<=1)
solve(m)
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?