PSORLab / EAGO.jl

A development environment for robust and global optimization
MIT License
144 stars 16 forks source link

Potential bug #98

Closed Downsite closed 2 years ago

Downsite commented 2 years ago

I have the following minimal problem that seems to be falsely declared as infeasible.

#Julia 1.6.2
using JuMP #v0.21.10
using EAGO #v0.6.1
solver = EAGO.Optimizer
model = Model(solver)
ny=2
@variable(model, -5<=y[1:ny]<=5)
@variable(model,-1000<=s<=1000)
@variable(model,-1000<=t<=1000)
@objective(model,Max,s)
@constraint(model,s<=t)
myeps=0.05
x_disc=[-0.7,0,0.2,0.7]
for x in x_disc
    a=@variable(model,[p=1:ny+1],lower_bound=0.0,upper_bound=1.0)
    #commenting this out causes the solver to return a solution
    #@constraint(model,[p = 1:ny], a[p]==0)
    @constraint(model,sum(a[i] for i=1:(ny+1))==1)      
    l=x^4-5x^2+4
    @constraint(model,a[ny+1]*(t-l)<=0)
    for j=1:ny
        @NLconstraint(model,a[j]*(myeps-(y[j]*x+0.5-(x^4-5x^2+4)))<=0.01)
    end    

end
optimize!(model)
println("Termination:",JuMP.termination_status(model))

I might have made a mistake, as I am quite new to using JuMP, but it seems like a potential bug to me.

mewilhel commented 2 years ago

Resolved by v0.7.