# Infeasible and optimal value

function [Q_,P_] = CVX_theta_Optimal(M,P_max,K,Z,v,q,p,BER)

cvx_solver mosek
cvx_begin
cvx_quiet false;
variable Q(M+1,M+1) hermitian semidefinite

``````expression F(K)
expression G(K)
expression P(K)

for i=1:K
if i == 1
s_inter = 0;
G_tmp = 0;
else
s_inter = 0;
G_tmp = 0;
for j=1:i-1
s_inter = p(j).*(trace(Z(:,:,j)*q)+ sum(abs(v(:,i)).^2)) + s_inter;
G_tmp = G_tmp + Z(:,:,j).';
end
end
F(i) = -(-rel_entr(1,(real(trace(Z(:,:,i)*Q)+sum(abs(v(:,i)).^2)))))/log(2);
end
%expression N
minimize sum(P)
subject to
diag(Q) == 1 ;

for i=1:K
0<=P(i)<=P_max;
end

for i=1:K
P(i)-exp(log(2)*(log(2.^(1+(sqrt(1/200)*qfuncinv(BER)/log(2)))-1)/log(2)+real(G(i)+F(i))))>=0;
end

%N = 0;
``````

cvx_end
%Q
P
Q_ = Q;
P_ = P;

end
My code is as above.This is my output.

## Cones | Errors | Mov/Act | Centering Exp cone Poly cone | Status --------±--------------------------------±-------- 0/ 2 | 8.000e+00 6.868e+02 3.299e+43 | Infeasible

Status: Infeasible
Optimal value (cvx_optval): +Inf

P =

NaN
NaN
NaN
NaN

How can I modify my code to make it work properly?

Make sure you are using CVX 2.2 and Mosek 9.x. Otherwise you would not be getting the output with Cones | Errors … which shows the Successive approximation method was used.

I change my version to CVX 2.2 and Mosek 9.1,but I don’t get the Cones|Erros…;Why is this?
CVX Warning:
Models involving “log” or other functions in the log, exp, and entropy
family are solved using an experimental successive approximation method.
This method is slower and less reliable than the method CVX employs for
other models. Please see the section of the user’s guide entitled
The successive approximation method
for more details about the approach, and for instructions on how to
suppress this warning message in the future.

## Calling Mosek 9.1.9: 4241 variables, 81 equality constraints

MOSEK Version 9.1.9 (Build date: 2019-11-21 11:34:40)
Copyright © MOSEK ApS, Denmark. WWW: mosek.com
Platform: Windows/64-X86

Problem
Name :
Objective sense : min
Type : CONIC (conic optimization problem)
Constraints : 81
Cones : 4
Scalar variables : 16
Matrix variables : 1
Integer variables : 0

Optimizer started.
Presolve started.
Linear dependency checker started.
Linear dependency checker terminated.
Eliminator started.
Freed constraints in eliminator : 0
Eliminator terminated.
Eliminator - tries : 1 time : 0.00
Lin. dep. - tries : 1 time : 0.00
Lin. dep. - number : 0
Presolve terminated. Time: 0.00
Problem
Name :
Objective sense : min
Type : CONIC (conic optimization problem)
Constraints : 81
Cones : 4
Scalar variables : 16
Matrix variables : 1
Integer variables : 0

Optimizer - threads : 8
Optimizer - solved problem : the primal
Optimizer - Constraints : 72
Optimizer - Cones : 4
Optimizer - Scalar variables : 12 conic : 12
Optimizer - Semi-definite variables: 1 scalarized : 8515
Factor - setup time : 0.00 dense det. time : 0.00
Factor - ML order time : 0.00 GP order time : 0.00
Factor - nonzeros before factor : 2628 after factor : 2628
Factor - dense dim. : 0 flops : 4.63e+07
ITE PFEAS DFEAS GFEAS PRSTATUS POBJ DOBJ MU TIME
0 2.4e+00 1.3e+00 3.0e+00 0.00e+00 0.000000000e+00 -1.951364912e+00 1.0e+00 0.03
1 7.7e-01 4.2e-01 3.5e+00 1.31e+00 0.000000000e+00 3.963016052e+00 3.2e-01 0.08
2 9.0e-02 4.9e-02 4.9e-01 -1.16e-01 0.000000000e+00 1.602696416e+01 3.8e-02 0.09
3 7.1e-05 3.9e-05 1.8e-02 -9.66e-01 0.000000000e+00 4.045377357e+04 3.0e-05 0.09
4 1.1e-09 5.9e-10 6.9e-05 -1.00e+00 0.000000000e+00 2.651394713e+09 4.6e-10 0.11
Optimizer terminated. Time: 0.13

Interior-point solution summary
Problem status : PRIMAL_INFEASIBLE
Solution status : PRIMAL_INFEASIBLE_CER
Dual. obj: 7.1488371446e-01 nrm: 7e+00 Viol. con: 0e+00 var: 4e-10 barvar: 5e-10 cones: 0e+00
Optimizer summary
Optimizer - time: 0.13
Interior-point - iterations : 4 time: 0.11
Basis identification - time: 0.00
Primal - iterations : 0 time: 0.00
Dual - iterations : 0 time: 0.00
Clean primal - iterations : 0 time: 0.00
Clean dual - iterations : 0 time: 0.00
Simplex - time: 0.00
Primal simplex - iterations : 0 time: 0.00
Dual simplex - iterations : 0 time: 0.00
Mixed integer - relaxations: 0 time: 0.00

Status: Infeasible
Optimal value (cvx_optval): +Inf

Because cvx2.2 models your exponential cone problem directly with Mosek in one go and does not have to apply the approximation procedure.

OK，Thank you very much!