[37] | 1 | function F = robustify_sdp_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) > 1 |
---|
| 11 | [BilinearizeringConstraints,failure] = deriveBilinearizing(Fi,w); |
---|
| 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_xw = F_xw + Ftemp; |
---|
| 20 | |
---|
| 21 | if any(Zmodel.K.q) | any(Zmodel.K.s) |
---|
| 22 | error('Only polytope uncertainty supported for uncertain SDPs'); |
---|
| 23 | else |
---|
| 24 | % FIX : Assumes all uncertainty in all constraints |
---|
| 25 | K = Zmodel.K; |
---|
| 26 | A = -Zmodel.F_struc((1+K.f):(K.f + K.l),2:end); |
---|
| 27 | b = Zmodel.F_struc((1+K.f):(K.f + K.l),1); |
---|
| 28 | |
---|
| 29 | try |
---|
| 30 | vertices = extreme(polytope(A,b))'; |
---|
| 31 | catch |
---|
| 32 | disp('You probably need to install MPT (needed for vertex enumeration)') |
---|
| 33 | disp('http://control.ee.ethz.ch/~joloef/wiki/pmwiki.php?n=Solvers.MPT') |
---|
| 34 | error('MPT missing'); |
---|
| 35 | end |
---|
| 36 | if K.f > 0 |
---|
| 37 | Aeq = -Zmodel.F_struc(1:K.f,2:end); |
---|
| 38 | beq = Zmodel.F_struc(1:K.f,1); |
---|
| 39 | feasible = sum(abs(Aeq*vertices - repmat(beq,1,size(vertices,2))),1) < 1e-6; |
---|
| 40 | vertices = vertices(:,feasible); |
---|
| 41 | if isempty(feasible) |
---|
| 42 | error('The uncertainty space is infeasible.') |
---|
| 43 | end |
---|
| 44 | end |
---|
| 45 | |
---|
| 46 | F = set([]); |
---|
| 47 | for j = 1:length(F_xw) |
---|
| 48 | for i = 1:size(vertices,2) |
---|
| 49 | F = F + set(replace(F_xw(j),w,vertices(:,i))); |
---|
| 50 | end |
---|
| 51 | end |
---|
| 52 | end |
---|
| 53 | end |
---|