Help in constraint expression

58 views
Skip to first unread message

Abdulrahman Aldeek

unread,
Sep 10, 2021, 2:39:15 PM9/10/21
to YALMIP

Hello Johan

I'm trying to write the following constraint
sqrt(4*((PS(1:NT,1).^2)+(QS(1:NT,1).^2))+(Isqr(1:NT,1)-diag(W(TB(1:NT,1),TB(1:NT,1)))).^2)<=(Isqr(1:NT,1)+diag(W(TB(1:NT,1),TB(1:NT,1))))

in a way that would allow the use of the option "dualize", how can I do that?

Johan Löfberg

unread,
Sep 10, 2021, 4:12:58 PM9/10/21
to YALMIP
you will have to make it less specific to get rid of the irrelevant details

it simply looks like norm(x)  <= y which is a simple conic constraint cone([y;x])

(although the model does not appear to make sense as it looks like a vector on the right-hand side (you might mean norm(x)<=y with y vector meaning norm(x)<=y(i) 

Abdulrahman Aldeek

unread,
Sep 10, 2021, 4:38:17 PM9/10/21
to YALMIP
I'm trying to write
Wjj*Iij>PSij^2+QSij^2 in a factorized way. Wjj is the diagonal value of the PSD matrix W where j is the "to bus" index. This constraint should be written for each line (that has "from bus i" and "to bus j"). I tried to write it as norm([2PS;2QS;I-W])<=I+W but it didn't work. Can I write this constraint is a more proper way that can be used upon invoking the command "dualize"?

Johan Löfberg

unread,
Sep 10, 2021, 4:58:58 PM9/10/21
to YALMIP
you already have an socp-representation of that in some other post

it will never be a cone which benefits from dualization since it isn't a pure cone with equalities. Sure if the complete model is a massively simple primal conic + a few of these dualization might be beneficial, like

X = sdpvar(100,100);
Model = [X >= 0, X(1)==1, norm([X(3);X(100)]) <= X(7878)]

here the massive simple primal sdp conic model will benefit from dualization, but the non-primal socp wil have to be rewritten first but that is so little cost compared to gains in the SDP cone, hence the model YALMIP derives before dualization is

Model = [X >= 0, X(1)==1, cone(z), z == [X(7878);X(3);X(100)]]

i.e. it adds three equalities to the intended primal before dualization, meaning it effectively trades O(100^2) dual variables for 3 dual variables

Abdulrahman Aldeek

unread,
Sep 10, 2021, 5:28:48 PM9/10/21
to YALMIP
I'm sorry if my questions are trivial but I'm very recent to SDP. When you say:
"since it isn't a pure cone with equalities"
Does that mean that I should replace <= by ==??

Also, I have been noticing in papers that deal with SDP that the computational efficiency of SDP is O(n^3) by I don't understand what is the exact meaning of this notation. SDP is convex and should be solved in polynomial time but this notation is exponential, Why is that?

Johan Löfberg

unread,
Sep 11, 2021, 2:38:23 AM9/11/21
to YALMIP
Intending to use the command without understanding the (few) situations where it is relevant, and the underlying complexity theory is just not going to work. I do presume you have read the associated paper and understood it
O(n^3) is not exponential. It is n*n*n, cubic.

Johan Löfberg

unread,
Sep 11, 2021, 2:40:58 AM9/11/21
to YALMIP
and you cannot say complexity is O(n^3) since you haven't even defined what n is but more importantly it depends on more things than just one number. If the largest semidefinite constraint has dimension n, then a lower bound on complexity is O(n^3) since you regardless of everything else will have to do O(n^3) linear algebra along the solution process
Reply all
Reply to author
Forward
0 new messages