What's wrong with my CVX about SDP problem?

Uncategorized
Apr 1, 2022
J

My code is as follow:

 cvx_begin sdp
	cvx_solver Mosek
    	variable V(Nt,Nt,U) hermitian semidefinite
    	variable lambda(U) nonnegative 
    	expression A(Nt,Nt,U) 
    	expression X(Nt^2+1,Nt^2+1,U) 
    	expression b(Nt^2,U) 
    	expression c(U) 
   	minimize (real(trace(sum(V,3))))
    	subject to 
    		for u = 1:U
    			A(:,:,u) = gamma(u)*(sum(V,3)-V(:,:,u))-V(:,:,u);
    			b(:,u)   = -lambda(u)*vec(sqrtm(Q(:,:,u)));
    			c(u)     = lambda(u)*trace(Q(:,:,u))-sigma(u)^2*gamma(u)-lambda(u)*alphaR(u)^2;
    			X(:,:,u) = [-kron(INt,A(:,:,u))+lambda(u)*INt2, b(:,u); b(:,u)', c(u)];
    			X(:,:,u) == hermitian_semidefinite(Nt^2+1);
    		end 
 cvx_end

M

CVX transforms your problem, including perhaps taking the dual, before providing to the solver. You should pay attention to the optimal variable and objective values reported by CVX, which may differ from what is reported by the solver.

Given that the objective is the sum of traces of semidefinite matrices, the optimal objective value reported by CVX should be nonnegative (within tolerance of slightly negative diagonal elements). That doesn’t mean the primal or dual objectives (essentially equal at optimality) reported by the solver will be nonnegative.

J
Replying to #2

that is wahy?
By the way, is there any way to let me save the information of the decision variables in every step?

J
Replying to #2

How can I know what CVX has turned my problem into

M

You can’t see the variable values at every iteration.

You can’t really know what CV has turned your problem into, in a way which is likely intelligible to you. The closest you can get to that is:

cvx_solver_settings( 'dumpfile', <filename> )

is a setting supported by
all solvers. If set, it will save a .MAT file containing the exact
input arguments delivered to the solver. This file will be created
immediately before the solver is called, so you will be able to examine
their contents even if the solver fails with an error. This feature is
to be used primarily by solver developers.

You can also read the material at Disciplined Convex Programming .

J

Thanks for your reply very much. I think I need some time to try that.

J
Replying to #5

hmm, one more question. Can I assign an initial value to the decision variables?

M

Not possible in CVX.

J
Replying to #8

Thank you so much. Your reply speed is amazing! :100: