ismember becomes higher-dimensional

36 views
Skip to first unread message

Marc Wijnand

unread,
May 13, 2015, 10:21:06 AM5/13/15
to yal...@googlegroups.com
I have two 2D sets X,Y. The set Z is defined using these two sets, and although it physically represents a 2D set with variable z (cf. plot(Z,z)), it is [6D] in Yalmip. Therefore, it is not possible to use the set Z as constraint of a new 2D variable. What can I do?

CODE:
%given sets X,Y
X = Polyhedron([rand(2,2);-rand(2,2)],rand(4,1));
y = sdpvar(2,1);
Y = [y'*y<=1];

%calculate set Z = X+Y (Minkowski sum)
x = sdpvar(2,1);
z = sdpvar(2,1);
Z = [z==x+y ismember(x,X) ismember(y,Y)];
%plot(Z,z)

%use Z in constraints of optimization problem
t = sdpvar(2,1);
plot([ismember(t,Z)]); %error
Error using sdpvar/replace (line 37)
Both arguments must have same size

Error in lmi/replace (line 24)
    F.clauses{i}.data = replace(F.clauses{i}.data,X,W,expand);

Error in lmi/ismember (line 4)
F = replace(F,recover(depends(F)),x);


Johan Löfberg

unread,
May 13, 2015, 10:52:32 AM5/13/15
to yal...@googlegroups.com
Of course, you have explicitly constructed it as an object living in 6d (z,x,y). I would not be surprised if it is impossible to represent the Minkowski sum of a polytope and an ellipsoid as a constraint in 2d using e.g. an intersection of quadratic inequalities. perhaps there exist an sdp representation or something like that. The representation that t is in the minkowski sum is done just as you've done with z, i.e, the variable z is in the minkowski sum.
Reply all
Reply to author
Forward
0 new messages