SOS question

36 views
Skip to first unread message

Kristofer de Vera

unread,
Jun 11, 2025, 3:06:58 AMJun 11
to YALMIP
Dear Prof. Johan Löfberg,

I'm wondering if there is a way to circumvent the nonlinearity reported by MOSEK to solve:

Screenshot 2025-06-11 at 5.02.33 pm.png
My code is:

sdpvar x y a
p = (1+x*y)^6-x*y+(1-y)^4;
g = [1-x+a; 1+x+a; 1-y + a; 1+y + a];
[s1,c1] = polynomial([x y],10);
[s2,c2] = polynomial([x y],10);
[s3,c3] = polynomial([x y],10);
[s4,c4] = polynomial([x y],10);
options = sdpsettings('solver', 'mosek');
F = [sos(p-[s1 s2 s3 s4]*g), sos(s1), sos(s2), sos(s3), sos(s4), a>=0];
sol=solvesos(F,a,options,[c1;c2;c3;c4]); Thanks so much!
Cheers, Kristofer de Vera




Johan Löfberg

unread,
Jun 11, 2025, 3:34:06 AMJun 11
to YALMIP
Is this the actual problem you want to solve? You are minimizing a subject to (the sos-version of) {p(x)>=0 for all |x|_inf <= 1+a} which trivially will be either a=0 or infeasible, so optimizing over a gains nothing

Kristofer de Vera

unread,
Jun 11, 2025, 3:57:07 AMJun 11
to YALMIP
Dear Prof. Johan Löfbe, 

It's not the actual problem I want to solve, but the setup if similar where I have the parameter a in the SOS constraint (through the gi's) and in the objective. I just want to know how to properly code it.

Cheers, 

Kristofer

Johan Löfberg

unread,
Jun 11, 2025, 4:32:11 AMJun 11
to YALMIP
There is no trivial way to get around it as I see, it is a nonlinear SDP and thus you basically don't have any solver

If it is simple as above, you can maybe simply do bisection over a, which you can write do manually or with

SOSModel = compilesos(F,[],sdpsettings('sos.model','image'),[c1;c2;c3;c4;a]);
bisection(SOSModel,a,sdpsettings('bisection.solver','mosek'))

(solving the problem here, albeit with weird progress as the problem is trivially weird)

However, the specific example might allow as there might be variable transformations etc to derive an equivalent linear problem
Reply all
Reply to author
Forward
0 new messages