1 | function F = robustify_eq_conic(F_xw,Zmodel,x,w) |
---|
2 | |
---|
3 | if length(F_xw) == 0 |
---|
4 | F = []; |
---|
5 | return; |
---|
6 | else |
---|
7 | Ftemp = []; |
---|
8 | for i = 1:length(F_xw) |
---|
9 | Fi = sdpvar(F_xw(i)); |
---|
10 | if degree(Fi(:),w) > 0 |
---|
11 | [BilinearizeringConstraints,failure] = deriveBilinearizing(Fi,w,0); |
---|
12 | if failure |
---|
13 | error('Cannot get rid of nonlinear uncertainty in uncertain SDP') |
---|
14 | else |
---|
15 | Ftemp = Ftemp + BilinearizeringConstraints; |
---|
16 | end |
---|
17 | end |
---|
18 | end |
---|
19 | F = Ftemp; |
---|
20 | |
---|
21 | |
---|
22 | if any(Zmodel.K.q) | any(Zmodel.K.s) |
---|
23 | error('Only polytope uncertainty supported for uncertain equalities'); |
---|
24 | else |
---|
25 | % FIX : Assumes all uncertainty in all constraints |
---|
26 | K = Zmodel.K; |
---|
27 | A = -Zmodel.F_struc((1+K.f):(K.f + K.l),2:end); |
---|
28 | b = Zmodel.F_struc((1+K.f):(K.f + K.l),1); |
---|
29 | |
---|
30 | vertices = extreme(polytope(A,b))'; |
---|
31 | if K.f > 0 |
---|
32 | Aeq = -Zmodel.F_struc(1:K.f,2:end); |
---|
33 | beq = Zmodel.F_struc(1:K.f,1); |
---|
34 | feasible = sum(abs(Aeq*vertices - repmat(beq,1,size(vertices,2))),1) < 1e-6; |
---|
35 | vertices = vertices(:,feasible); |
---|
36 | if isempty(feasible) |
---|
37 | error('The uncertainty space is infeasible.') |
---|
38 | end |
---|
39 | end |
---|
40 | |
---|
41 | for j = 1:length(F_xw) |
---|
42 | for i = 1:size(vertices,2) |
---|
43 | F = F + set(replace(F_xw(j),w,vertices(:,i))); |
---|
44 | end |
---|
45 | end |
---|
46 | end |
---|
47 | |
---|
48 | end |
---|