I am considering the following semidefinite programming:
Variable y =[y00 ; y10 ; y01 ; y20 ; y11 ; y02] so the dimension is 6.
My MATLAB code is
A1 = zeros(3,3); A2 = zeros(3,3); A3 = zeros(3,3);
A4 = zeros(3,3); A5 = zeros(3,3); A6 = zeros(3,3);
A0 = zeros(3,3); % F0
A1(1,1)=1; %y00 F1
A2(1,2)=1; A2(2,1)=1; %y10 F2
A3(1,3)=1; A3(3,1)=1; %y01 F3
A4(2,2)=1; %y20 F4
A5(2,3)=1; A5(3,2)=1; %y11 F5
A6(3,3)=1; %y02 F6
F0 = A0;
F1 = A1; F2 = A2; F3 = A3; F4 = A4; F5 = A5; F6 = A6;
c = [0;0;0;1;0;1]; btt = -c; % object function
A = [0 0 1 0 0 0;
0 0 0 0 2 0]; % Equality constraint A
b = [-1;-1]; delta = [10^-8;10^-8]; hatb = b-delta;
At = -[vec(F1) vec(F2) vec(F3) vec(F4) vec(F5) vec(F6)]; Att = [-A;At];
ctt = [-hatb;vec(F0)];
K.l = size(A,1);
K.s = size(F0,1);
[x,y,info] = sedumi(Att,btt,ctt,K);
y
I read the following tutorial:
https://www.ece.uvic.ca/~wslu/Talk/SeDuMi-Remarks.pdf (SDP from p.7)
Note that
I am not sure where I make error. Please give me some suggestions.
Thanks in advance.
Why would subtracting a small delta have anything to do with converting an inequality to an equality? An equality would be a double-sided inequality (i.e. two equalities would give four elementwise constraints)
However, the correct way here would be to use the K.f field to communicate equalities.
Even better, your model should be interpreted as an representation of the primal standard form, meaning you only should have two A matrices to communicate the two equalities.
Perhaps you should use a modelling tool such as YALMIP or CVX to avoid all this low-level gritty details which are horrible for anything but these small trivial problems