Error with couenne

medardo
Sat, 10 Feb 2024 21:12:50 +0000
Optimization (Mathematical)

Hi, please help me. I can’t see the problem. I am using this code:

using JuMP, AmplNLWriter, Couenne_jll
function run()
model = Model(() → AmplNLWriter.Optimizer(Couenne_jll.amplexe))
@variable(model, x)
@variable(model, y)
@NLobjective(model, Max, x + y)
@constraint(model, x + y <= 10)
@constraint(model, x <= 2)
@constraint(model, y <= 3)
optimize!(model)
println("Optimal objective value: ", objective_value(model))
println("Optimal value of x: ", value(x))
println("Optimal value of y: ", value(y))
end
run()

I have this error:
ERROR: LoadError: Result index of attribute MathOptInterface.ObjectiveValue(1) out of bounds. There are currently 0 solution(s) in the model.

7 posts - 3 participants