1 | function sol = solverobust(varargin) |
---|
2 | %SOLVEROBUST Solve robust conic problem |
---|
3 | % |
---|
4 | % sol = solverobust(F,h,options,uncertain) is used for finding a robust |
---|
5 | % solution to an uncertain conic problem. |
---|
6 | % |
---|
7 | % Currently, YALMIP supports robust solutions to conic problems where |
---|
8 | % uncertainty only enter in linear inequality constraints. The |
---|
9 | % uncertainty set is allowed to be an arbitrary conic set. For uncertain |
---|
10 | % SOCP and SDP constraints, the uncertainty set has to be polytopic. |
---|
11 | % |
---|
12 | % The robust problem supported can be formulated as |
---|
13 | % |
---|
14 | % min max_w f(x)+c(w)'*x |
---|
15 | % |
---|
16 | % subject to H(x) >(=) 0 |
---|
17 | % A(w)x <= b(w) for all w:G(w) >(=) 0 |
---|
18 | % |
---|
19 | % The data c, A and b are linearly parameterized by uncertainty w, |
---|
20 | % the constraints H and G are general conic sets. |
---|
21 | % |
---|
22 | % INPUT |
---|
23 | % F : SET object with constraints and uncertainty description |
---|
24 | % h : scalar SDPVAR object (can be []) |
---|
25 | % options : options structure obtained from SDPSETTINGS (can be []) |
---|
26 | % uncertain : SDPVAR object defining uncertain variables |
---|
27 | % |
---|
28 | % OUTPUT |
---|
29 | % sol : Solution diagnostic. |
---|
30 | % |
---|
31 | % EXAMPLE |
---|
32 | % sdpvar x w |
---|
33 | % F = set(x + w <= 1) + set(-0.5 <= w <= 0.5); |
---|
34 | % solverobust(F,-x,[],w) % Optimal value x=0.5 |
---|
35 | % |
---|
36 | % NOTES |
---|
37 | % |
---|
38 | % The constraints and objective have to satisfy a number of conditions |
---|
39 | % for the robustification to be tractable. Please refer to the YALMIP |
---|
40 | % Wiki for the current assumptions (this is constantly developing) |
---|
41 | % |
---|
42 | % See also SOLVESDP, SOLVESOS, SDPSETTINGS, SDPVAR, SET |
---|
43 | |
---|
44 | if nargin < 3 |
---|
45 | varargin{3} = sdpsettings; |
---|
46 | ops = varargin{3}; |
---|
47 | else |
---|
48 | ops = varargin{3}; |
---|
49 | if isempty(ops) |
---|
50 | ops = sdpsettings; |
---|
51 | varargin{3} = ops; |
---|
52 | end |
---|
53 | end |
---|
54 | |
---|
55 | % convert to robust model |
---|
56 | [F,h,failure] = robustify(varargin{:}); |
---|
57 | if failure |
---|
58 | error('Failed to create robustified model. Check the Wiki!') |
---|
59 | else |
---|
60 | % and solve this model instead |
---|
61 | sol = solvesdp(F,h,ops); |
---|
62 | end |
---|