You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
% Nominal case without any uncertainty
x = sdpvar(2,1);
Model = [-3 <= x <= 3, norm(x - [0.1;0.2],1) >= 1];
optimize(Model, x'*x)
clf
plot(Model);hold on;plot(value(x(1)),value(x(2)),'*')
% Add uncertainty, fails due to infeasibility
x = sdpvar(2,1);
w = sdpvar(2,1);
Model = [-3 <= x <= 3, norm(x + w - [0.1;0.2],1) >= 1];
Model = [Model, -0.5 <= w <= 0.5,uncertain(w)]
optimize(Model, x'*x)
clf
plot(Model);hold on;plot(value(x(1)),value(x(2)),'*')
% Manual derivation of nonconvex constraint
% and it works as expected
x = sdpvar(2,1);
w = sdpvar(2,1);
d = binvar(4,1);
q = x + w - [0.1;0.2];
M = 10;
Model = [-3 <= x <= 3, q(1) + q(2) >= 1-M*(1-d(1)),
q(1) - q(2) >= 1-M*(1-d(2)),
-q(1) + q(2) >= 1-M*(1-d(3)),
-q(1) - q(2) >= 1-M*(1-d(4)),
sum(d)==1]
Model = [Model, -0.5 <= w <= 0.5,uncertain(w)]
optimize(Model, x'*x)
clf
plot(Model,x);hold on;plot(value(x(1)),value(x(2)),'*')
% Semimanual, represent the polytope
A = [1 1;-1 1;1 -1;-1 -1];
b = [1;1;1;1];
x = sdpvar(2,1);
w = sdpvar(2,1);
d = binvar(4,1);
q = A*(x + w - [0.1;0.2]) - 1;
Model = [-3 <= x <= 3, implies(d,q>=0),sum(d)==1];
Model = [Model, -0.5 <= w <= 0.5,uncertain(w)]
optimize(Model, x'*x)
clf
plot(Model,x);hold on;plot(value(x(1)),value(x(2)),'*')
The text was updated successfully, but these errors were encountered:
The text was updated successfully, but these errors were encountered: