SumOfSquares.jl icon indicating copy to clipboard operation
SumOfSquares.jl copied to clipboard

A trivial example that returns infeasible

Open AlexandreAmice opened this issue 2 years ago • 2 comments

The following univariate example returns infeasible even though it should be a very simple problem. For the purposes of debugging, is it possible to have the domain of the SOS constraint printed out?

using DynamicPolynomials
using SumOfSquares
using MosekTools
@polyvar x
S = @set -1 <= x && x <= 1

import Mosek
model = SOSModel(Mosek.Optimizer)
set_silent(model)
con_ref = @constraint(model, x^2 <= 1.1, domain = S)
optimize!(model)
solution_summary(model)

AlexandreAmice avatar Mar 29 '23 16:03 AlexandreAmice

@blegat is this expected?

I think it's because you don't actually have a free decision variable in your model?

odow avatar Apr 10 '23 20:04 odow

is it possible to have the domain of the SOS constraint printed out?

Yes, that shouldn't be too hard

Maybe try increasing the maxdegree in the constraint keyword argument ?

I'm guessing the issue is that you're using the Putinar certificate instead of the Schmudgen one which would add (x + 1) * (x - 1) as well. See https://jump.dev/SumOfSquares.jl/latest/generated/Extension/certificate We could add an easy way to do Schmudgen (or even do it by default). I was a bit worried that it would add 2^(n-1) polynomials but you quickly get a too high degree anyway so you never really add that many polynomials.

blegat avatar Apr 11 '23 05:04 blegat