SOCP, problem 'Cone object cannot be negated'

41 views
Skip to first unread message

Scapa

unread,
May 28, 2013, 8:46:08 AM5/28/13
to yal...@googlegroups.com
Hi

I tried the following minimal example of a second order cone program:

I use a rotated cone as constraint and two inequalities.

%%%%%%%%%%%%%%%%%%%%%%%%%
clear all

x = sdpvar(3,1);

Constraints = [rcone( x(3), 3 - x(1), 2 - x(2) ),    x(1) >= 0.6,  x(2) >= 0.6]


Objective = [0;0;-1]'*x;
options = sdpsettings('verbose',2,'showprogress',1,'solver','sedumi');%
sol = solvesdp(Constraints,Objective,options);

%%%%%%%%%%%%%%%%%%%%%%%%%

The solution should be: x = [0.6, 0.6, 2.5923]'



However, always the following error appears:


Error using sdpvar/uminus (line 25)
Cone object cannot be negated

Error in sdpvar/minus (line 255)
        y = addfactors(y,X,-Y);

Error in lmi/convertlorentz (line 17)
        F.clauses{i}.data = [(x+y)/sqrt(2);(x-y)/sqrt(2);z];

Error in compileinterfacedata (line 732)
    [F,changed] = convertlorentz(F);

Error in solvesdp (line 260)
[interfacedata,recoverdata,solver,diagnostic,F,Fremoved,ForiginalQuadratics] =
compileinterfacedata(F,[],logdetStruct,h,options,0,solving_parametric);

Error in temp (line 12)
sol = solvesdp(Constraints,Objective,options);



Where is the error in the formulation?

Johan Löfberg

unread,
May 28, 2013, 9:04:52 AM5/28/13
to yal...@googlegroups.com
There is no error in your code directly. However command rcone is supposed to be obsolete, I've forgotten to delete it.

Implement the condition z^z <= 2*x*y using norms
norm([sqrt(2)*x(3); (3 - x(1))-(2 - x(2))]) <=  (3 - x(1)) +  (2 - x(2))

which can be written using the low-level cone operator
cone([(3 - x(1)) +  (2 - x(2);2*x(3); (3 - x(1))-(2 - x(2))])

BTW, your objective is simply -x(3), no reason to introduce a vector to extract that element

Reply all
Reply to author
Forward
0 new messages