jump-dev / ECOS.jl

A Julia interface to the ECOS conic optimization solver
https://github.com/embotech/ecos
Other
41 stars 17 forks source link

feasible problem declared infeasible #21

Closed mlubin closed 9 years ago

mlubin commented 9 years ago

The problem is a bit messy, but if I simplify it any further then the issue goes away. The problem is trivially feasible if you set all variables (except aux3) to zero. Used ECOS 1.0.5 here.

using JuMP
import ECOS
m = Model(solver=ECOS.ECOSSolver())

@defVar(m, a1)
@defVar(m, a2)
@defVar(m, c1)
@defVar(m, c2)
@defVar(m, aux1)
@defVar(m, aux2)
@defVar(m, aux3 ≥ 0)

@addConstraint(m, aux3 == 1)
@addConstraint(m, a2 == 0)
@addConstraint(m, c1 == 0)
@addConstraint(m, a1 == 0)
@addConstraint(m, c2 == 0)

@defVar(m, t1 >= 0)

@defVar(m, aux1_l)
@defVar(m, aux1_u)
@defVar(m, term_a1)
@defVar(m, term_a2)
@addConstraint(m, term_a1 == a1)
@addConstraint(m, term_a2 == a2)

@addConstraint(m, aux1_l + aux1 == 0)
@addConstraint(m, aux1_u - aux1 == 0)
@addConstraint(m, aux1_l + 1.6448536269514715*t1 ≤ 0)
@addConstraint(m, aux1_u - 1.6448536269514715*t1 ≥ 0)
@addConstraint(m, aux1_u - aux1_l - 3.919927969080107*t1 ≥ 0)

@defVar(m, t2 >= 0)

@defVar(m, aux2_l)
@defVar(m, aux2_u)
@defVar(m, term_c1)
@defVar(m, term_c2)
@addConstraint(m, term_c1 == c1)
@addConstraint(m, term_c2 == c2)

@addConstraint(m, aux2_l + aux2 == 0)
@addConstraint(m, aux2_u - aux2 == 0)
@addConstraint(m, aux2_l + 1.6448536269514715*t2 ≤ 0)
@addConstraint(m, aux2_u - 1.6448536269514715*t2 ≥ 0)
@addConstraint(m, aux2_u - aux2_l - 3.919927969080107*t2 ≥ 0)

@addConstraint(m, aux1^2 + aux2^2 ≤ aux3^2)

@addConstraint(m, term_a1^2 + term_a2^2 ≤ t1^2)
@addConstraint(m, term_c1^2 + term_c2^2 ≤ t2^2)

solve(m)

CC @adomahidi @echu

IainNZ commented 9 years ago

Quite possibly fixed by now: https://github.com/embotech/ecos/issues/109 was fixed for example. We are quite far behind in terms of bug fixes.

tkelman commented 9 years ago

https://github.com/JuliaOpt/ECOS.jl/issues/16#issuecomment-72537761 and https://github.com/embotech/ecos/issues/112 are not yet fixed afaict (which is what's been holding up an upgrade to something more recent)

mlubin commented 9 years ago

Seems to be fine now

tkelman commented 9 years ago

Worth adding a test?