Accessing a specific constraint in the model

20 views
Skip to first unread message

Mohammadali

unread,
May 15, 2019, 3:49:53 PM5/15/19
to YALMIP
Hello all
I have a question regarding accessing the constraints specifically in my model. For example I have the following set of constraints x_min<=x<=x_max where x has 10 entries. Yalmip identifies this expression as "Element-wise inequality 20x1"; however, I want to know what ,say, the third constraint is here? Or another example is that after I run "dual" command I only get a series of numbers without knowing which dual number is assigned to which constraint in this set. I really appreciate it if someone can help me on this.
Thank you

Johan Löfberg

unread,
May 16, 2019, 1:19:04 AM5/16/19
to YALMIP
Double-sided is stacked as [x_max-x;x-x_min] >=0

>> x = sdpvar(3,1);
>> F = [[1;2;3] <= x <= [4;5;6]];
>> sdisplay(sdpvar(F))

ans =

  6×1 cell array

    {'-1+x(1)'}
    {'-2+x(2)'}
    {'-3+x(3)'}
    {'4-x(1)' }
    {'5-x(2)' }
    {'6-x(3)' }

The duals are simply ordered in the same order as the constraint

Reply all
Reply to author
Forward
0 new messages