Quadratic Constraint in my SDP programming, which leads to No suitable solver.

248 views
Skip to first unread message

Chang Deng

unread,
Sep 4, 2018, 10:00:05 PM9/4/18
to YALMIP
Dear professor Löfberg:

Sorry to bother you. see the picture attached. now i define a semidefinite matrix G=P^T*P. therefore,G >=0, and there are lots of zero in G(this doesn't hurt, because it is linear constraints). now from the relationship of different elements in P, we know there is another equality constraints.for example,G(1, 3) = a11a12G(13)=a12a11,G(1, 1) = a211, G(3, 3) = a212, so we require  G(1,3)*G(3,1)=G(1,1)*G(3,3) or G(1,3)^2=G(1,1)*G(3,3), which is quadratic constraints, and when i use YALMIP to solve this problem ,it reminds me that "No suitable solver".

professor, can you offer me some suggestion or comment?i also attached my motivation to build a matrix P like this.Thanks in advance.
WX20180904-185652@2x.png
1536111860541.jpg

Erling D. Andersen

unread,
Sep 5, 2018, 1:32:02 AM9/5/18
to YALMIP
If your quadratic constraint is convex you can rewritte it to an SOCP constraint. Then MOSEK and SDPT3 can solve your problem. 

Johan Löfberg

unread,
Sep 5, 2018, 1:37:52 AM9/5/18
to YALMIP
G == P^TP is a nonconvex constraint, and thus you typically don't have any solver if you have this in the context of semidefinite programming.

It is not clear from your description if you have assigned G=P^TP, or if you've added a constraint G==P'*P.

What does your full problem look like.

Chang Deng

unread,
Sep 5, 2018, 1:46:31 AM9/5/18
to YALMIP
I just use G as variable, but from my problem modeling, i know G should be equal to some P^T*P, if i can solve this semidefinite problem, obtain a symmetric semidefinite matrix G(of course, G has some special structure as i describe before), then i will decompose G into P^T*P, get what i want, that is P.
Sorry i just start to learn optimization. maybe i can us P as variable directly?

Johan Löfberg

unread,
Sep 5, 2018, 1:59:15 AM9/5/18
to yal...@googlegroups.com

This is a very bad model (nonlinear equality)

 

G = sdpvar(2);
P
= [0 sdpvar(1);sdpvar(1) 0];
optimize
([G == P'*P],trace(G))

 

This is a very simple problem (convex QP)

 

P = [0 sdpvar(1);sdpvar(1) 0];
G = P'*P;
optimize
([],trace(G))

 

I fear you are doing something along the lines of the first case

Chang Deng

unread,
Sep 5, 2018, 3:51:37 PM9/5/18
to YALMIP

G=[sdpvar(1) 0;0 sdpvar(1)];

Objective=G(1,1);

Constraints=[0<=G(1,1)<=1];

Constraints=[Constraints,0<=G(2,2)];

a=optimize(Constraints,-Objective);

 

P=[sdpvar(1) 0;0 sdpvar(1)];

G_=P'*P;

Objective_=[1,0]*G_*[1;0];

Constraints_=[0<=[1,0]*G_*[1;0]<=1];

Constraints_=[Constraints_,0<=[0,1]*G_*[0;1]];

b=solvesdp(Constraints_,-Objective_);


Second one always return zero solution,G_=[0 0; 0 0] and P=[Na 0;0 Na].

Chang Deng

unread,
Sep 5, 2018, 4:14:24 PM9/5/18
to YALMIP
try3.m I use G as variable, because it involves quadratic constraints.No suitable solver
try4.m i use P as variable, then solver tells me all elements in P is zero.this is meaningless.

i upload my code that i used to solve problem. and picture is my model, it is just similar to coordinate gradient descent. every time i just  update on coordinate, and fix others.
try3.m
try4.m
IMG_0862.JPG

Johan Löfberg

unread,
Sep 5, 2018, 4:37:12 PM9/5/18
to YALMIP
First, it is called optimize, not solvesdp

Second, you second problem is nonconvex as you maximize a convex quadratic, hence you are unlikely to be able to solve that to global optimality for anything but trivial problems, and with a local solver (I guess you are using fmincon) what you get is hopefully a locally optimal solution and nothing more. P cannot be NaN in the second case if G_ is 0. You must have looked at something else. 

Johan Löfberg

unread,
Sep 5, 2018, 4:42:07 PM9/5/18
to yal...@googlegroups.com
As I said above, as you are maximizing a convex quadratic, you have a very hard problem (theoretically intractable)

try3 is not only nasty due to nonconvex objective, but you also have nonconvex equalities, and a semidefinite constraints which means you don't have any solver (there are essentially no solvers for nonlinear SDPs)

try4 lacks the semidefinite constraints and the nonconvex equalities, hence it is only nasty due to  the nonconvex objective, and fmincon can be used. Alas, fmincon is a local solver, so it can easily get stuck in a local crap solution

Johan Löfberg

unread,
Sep 5, 2018, 4:46:20 PM9/5/18
to YALMIP
and I hope you realize you can write G_(1,1) instead of the weird [1,0]*G_*[1;0] notation

Chang Deng

unread,
Sep 5, 2018, 9:10:33 PM9/5/18
to YALMIP
Thank you very much! it seems i am dealing with a very difficult problem.

I really appreciate your times and kindness! 
Reply all
Reply to author
Forward
0 new messages