I have stumbled upon some weird behaviour with optimizer in conjunction with sedumi. The following code will yield different results from optimizer and solvesdp, when using sedumi. When using gurobi, the results are the same! Am I doing something wrong here, or is this a bug?
I guess that my code uses the beta version of general variable substitution in optimizer, but both 'gurobi' and '+gurobi' seem to work equally fine.
% Parameters, and generate input data
Mt = 3;
Nd = 2;
Pt = 100;
alpha = 5/100;
Wsqrtm = crandn(Nd,Nd); W = Wsqrtm*Wsqrtm';
G = crandn(Mt,Nd);
t = crandn(Mt,Mt); T = t*t' + G*G'; Tsqrtm = sqrtm(T);
Ssqrtm = crandn(Mt,Mt); S = Ssqrtm*Ssqrtm';
% Solve in standard way
Vs = sdpvar(Mt,Nd,'full','complex');
ctsq = sdpvar(Mt,1);
constraints = [norm(Vs,'fro')^2 + sum(ctsq) <= Pt];
for m = 1:Mt
constraints = constraints + [ctsq(m) >= (alpha^2)*norm(Vs(m,:),'fro')^2];
end
options = sdpsettings('solver','sedumi','verbose',1);
objective = trace(W) - 2*real(trace(Wsqrtm*G'*Vs)) + norm(Tsqrtm*Vs,'fro')^2 + diag(T)'*ctsq + (alpha^2)*norm(Ssqrtm*Vs,'fro')^2;
solvesdp(constraints,objective,options);
double(Vs)
% Solve using optimizer
Vs_opt = sdpvar(Mt,Nd,'full','complex');
ctsq_opt = sdpvar(Mt,1);
constraints_opt = [norm(Vs_opt,'fro')^2 + sum(ctsq_opt) <= Pt];
for m = 1:Mt
constraints_opt = constraints_opt + [ctsq_opt(m) >= (alpha^2)*norm(Vs_opt(m,:),'fro')^2];
end
W_in = sdpvar(Nd,Nd,'full','complex');
Wsqrtm_in = sdpvar(Nd,Nd,'full','complex');
G_in = sdpvar(Mt,Nd,'full','complex');
Tsqrtm_in = sdpvar(Mt,Mt,'full','complex');
T_in = sdpvar(Mt,Mt,'full','complex');
Ssqrtm_in = sdpvar(Mt,Mt,'full','complex');
options_opt = sdpsettings('solver','sedumi','verbose',2);
objective_opt = trace(W_in) - 2*real(trace(Wsqrtm_in*G_in'*Vs_opt)) + norm(Tsqrtm_in*Vs_opt,'fro')^2 + diag(T_in)'*ctsq_opt + (alpha^2)*norm(Ssqrtm_in*Vs_opt,'fro')^2;
solver = optimizer(constraints_opt,objective_opt,options_opt,{W_in,Wsqrtm_in,G_in,Tsqrtm_in,T_in,Ssqrtm_in},Vs_opt);
optimizer_solution = solver{{W,Wsqrtm,G,Tsqrtm,T,Ssqrtm}};
double(optimizer_solution)