jump-dev / Pavito.jl

A gradient-based outer approximation solver for convex mixed-integer nonlinear programming (MINLP)
Other
60 stars 10 forks source link

Constraints of type MathOptInterface.VectorAffineFunction{Float64}-in-MathOptInterface.PowerCone{Float64} are not supported by the solver. #66

Closed freemin7 closed 2 years ago

freemin7 commented 2 years ago

Minimal working example:

using HiGHS, MadNLP, JuMP, Pavito

oa_solver = optimizer_with_attributes(HiGHS.Optimizer,
    MOI.Silent() => true,
    "mip_feasibility_tolerance" => 1e-8,
    "mip_rel_gap" => 1e-6,
)

madnlp = optimizer_with_attributes(MadNLP.Optimizer,
                 "print_level" => MadNLP.INFO)

opt = optimizer_with_attributes(Pavito.Optimizer,
        "mip_solver" => oa_solver,
        "cont_solver" => madnlp,
    )
mc = Model(opt)

np = 5

@variable(mc, 0 <= q[1:(2*np)] <= Qmax)
@variable(mc, 0 <= hfq[1:(2*np)])

for i in 1:(2np)
  @constraint(mc, [hfq[i]/Resistance[i], 1, q[i]] in MOI.PowerCone(1/1.852))
end
odow commented 2 years ago

Pavito passes your model to the continuous inner solver. In this case, it's MadNLP, which doesn't support PowerCones. Did you expect this to work?

freemin7 commented 2 years ago

I expected to Pavito or some bridge to translate it so an NLP solver can solve it.

"For algorithms that use a conic solver instead of an NLP solver, use Pajarito."

suggested to me that Pavito could take any NLP solver not just Ipopt.

odow commented 2 years ago

I expected to Pavito or some bridge to translate it so an NLP solver can solve it.

We don't do this. You can use Pavito if you write your constraints using @NLconstraint. Otherwise, use Pajarito and a conic solver.

freemin7 commented 2 years ago

I have been operating under the wrong mental model. Sorry. I will think about a suggestion for the ReadMe which would have prevented that misunderstanding on my end.

freemin7 commented 2 years ago

Just a clarification. You perform no check that the problem is actually is non convex? How would the solver behave when given a non convex problem?

odow commented 2 years ago

I will think about a suggestion for the ReadMe which would have prevented that misunderstanding on my end.

Open a PR?

You perform no check that the problem is actually is non convex?

No

How would the solver behave when given a non convex problem?

¯_(ツ)_/¯

freemin7 commented 2 years ago

I will think about a suggestion for the ReadMe which would have prevented that misunderstanding on my end.

Open a PR?

If i thought of something i will.