# Why Status: Unbounded Optimal value (cvx_optval): +Inf

Hello, everyone. When I use cvx, I encounter some problems, as follows

``````Calling Mosek 9.1.9: 6250 variables, 884 equality constraints
For improved efficiency, Mosek is solving the dual problem.
------------------------------------------------------------

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

MOSEK warning 710: #12 (nearly) zero elements are specified in sparse col '' (32) of matrix 'A'.
MOSEK warning 710: #3 (nearly) zero elements are specified in sparse col '' (46) of matrix 'A'.
MOSEK warning 710: #3 (nearly) zero elements are specified in sparse col '' (100) of matrix 'A'.
MOSEK warning 710: #4 (nearly) zero elements are specified in sparse col '' (133) of matrix 'A'.
MOSEK warning 710: #1 (nearly) zero elements are specified in sparse col '' (147) of matrix 'A'.
MOSEK warning 710: #1 (nearly) zero elements are specified in sparse col '' (201) of matrix 'A'.
MOSEK warning 710: #8 (nearly) zero elements are specified in sparse col '' (430) of matrix 'A'.
MOSEK warning 710: #2 (nearly) zero elements are specified in sparse col '' (444) of matrix 'A'.
MOSEK warning 710: #2 (nearly) zero elements are specified in sparse col '' (498) of matrix 'A'.
MOSEK warning 710: #4 (nearly) zero elements are specified in sparse col '' (531) of matrix 'A'.
Warning number 710 is disabled.
Problem
Name                   :
Objective sense        : min
Type                   : CONIC (conic optimization problem)
Constraints            : 884
Cones                  : 16
Scalar variables       : 1482
Matrix variables       : 20
Integer variables      : 0

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

Optimizer  - solved problem         : the primal
Optimizer  - Constraints            : 855
Optimizer  - Cones                  : 17
Optimizer  - Scalar variables       : 743               conic                  : 735
Optimizer  - Semi-definite variables: 20                scalarized             : 9832
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 : 6.38e+04          after factor           : 6.46e+04
Factor     - dense dim.             : 2                 flops                  : 6.95e+07
ITE PFEAS    DFEAS    GFEAS    PRSTATUS   POBJ              DOBJ              MU       TIME
0   1.3e+02  1.3e+00  1.3e+01  0.00e+00   1.531135369e+01   3.509105336e+00   1.0e+00  0.05
1   3.5e+01  3.5e-01  5.6e+00  -6.88e-01  4.678028163e+01   3.862443819e+01   2.7e-01  0.13
2   5.1e+00  5.1e-02  2.1e+00  -8.83e-01  3.321001950e+02   3.385156753e+02   4.0e-02  0.14
3   6.6e-01  6.6e-03  7.1e-01  -9.45e-01  2.187548819e+03   2.293596718e+03   5.1e-03  0.16
4   1.1e-01  1.1e-03  2.8e-01  -8.77e-01  1.198185847e+04   1.261379843e+04   8.6e-04  0.19
5   2.3e-02  2.3e-04  1.2e-01  -9.35e-01  5.195964428e+04   5.470518257e+04   1.8e-04  0.20
6   2.3e-03  2.3e-05  3.8e-02  -9.87e-01  5.213111896e+05   5.486210202e+05   1.8e-05  0.23
7   2.8e-04  2.8e-06  1.3e-02  -9.98e-01  4.418116376e+06   4.645422545e+06   2.2e-06  0.25
8   9.6e-05  9.7e-07  7.7e-03  -9.93e-01  1.444187640e+07   1.509070424e+07   7.5e-07  0.27
9   2.3e-05  2.3e-07  3.8e-03  -9.91e-01  6.798052006e+07   7.070005298e+07   1.8e-07  0.30
Optimizer terminated. Time: 0.31

Interior-point solution summary
Problem status  : PRIMAL_INFEASIBLE
Solution status : PRIMAL_INFEASIBLE_CER
Dual.    obj: 1.8023539098e+01    nrm: 4e+04    Viol.  con: 0e+00    var: 4e+04    barvar: 2e-07    cones: 0e+00
Optimizer summary
Optimizer                 -                        time: 0.31
Interior-point          - iterations : 9         time: 0.30
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: Unbounded
Optimal value (cvx_optval): +Inf
``````

My code
cvx_clear
cvx_begin
% cvx_solver mosek
cvx_save_prefs
variable W(M,M,K) hermitian semidefinite
variables relax_S1_lamda(L) relax_S2_lamda(L) tau_max(K) gammaa(K,L) R(K,K)
expressions LMI_S1(M+N_all+1,M+N_all+1,K) LMI_S2(M+N_all+1,M+N_all+1,K)
P=0;

``````    S=0;
for k=1:K
for l=1:L
E(:,l)=[h_rE(:,l)',h_BE(:,l)'];
A(:,:,k)=[Theta*G*sum(W(:,:,k+1:K),3)*G'*Theta',Theta*G*sum(W(:,:,k+1:K),3);...
sum(W(:,:,k+1:K),3)*G'*Theta',sum(W(:,:,k+1:K),3)];
a(:,:,k,l)=A(:,:,k)+relax_S1_lamda(l)*eye(M+N_all);
b(:,k,l)=E(:,l)'*A(:,:,k);
c(k,l)=E(:,l)'*A(:,:,k)*E(:,l)+noise-gammaa(k,l)-relax_S1_lamda(l)*epsilong(l);
LMI_S1(:,:,k,l)=[a(:,:,k,l)   b(:,k,l);...
b(:,k,l)'    c(k,l)];
right_up(k,l)=(exp(tau_max_t(1,k))-1)*gammaa(k,l)+gamma_t(k,l)*exp(tau_max_t(1,k))*...
(tau_max(k)-real(tau_max_t(1,k)));
B(:,:,k)=[Theta*G*W(:,:,k)*G'*Theta',Theta*G*W(:,:,k);...
W(:,:,k)*G'*Theta',W(:,:,k)];
a0(:,:,k,l)=relax_S2_lamda(l)*eye(M+N_all)-B(:,:,k);
b0(:,k,l)=-E(:,l)'*B(:,:,k);
c0(k,l)=-E(:,l)'*B(:,:,k)*E(:,l)+right_up(k,l)-relax_S2_lamda(l)*epsilong(l);
LMI_S2(:,:,k,l)=[a0(:,:,k,l)   b0(:,k,l);...
b0(:,k,l)'    c0(k,l)];
end
S=S-rel_entr(1,R(k,k))/log(2)-tau_max(k)*log2(exp(1));
end
maximize real(trace(R))
subject to
for k=1:K
for l=1:L
LMI_S1(:,:,k,l) ==hermitian_semidefinite(M+N_all+1);
LMI_S2(:,:,k,l) ==hermitian_semidefinite(M+N_all+1);
relax_S1_lamda(l)>0;
relax_S2_lamda(l)>0;
end

P=P+trace(W(:,:,k));
tau_max(k)*log2(exp(1))<=M_E;
end

for j=2:K
for k=1:j-1
W_temp3=0;
for i=k+1:K
W_temp3=W_temp3+h_k(:,j)'*W(:,:,i)*h_k(:,j);
end
pow_pos((R(j,k)-1)*real(A_t(j,k)),2)+pow_pos((real(W_temp3)+noise)/real(A_t(j,k)),2)<=...
2*real(h_k(:,j)'*W(:,:,k)*h_k(:,j));%Convert R (j, k) to convex constraint by AMG
R(j,k)>=R(k,k);
end
end

cvx_end
``````

Some initial values

What is the reason for the unbounded？

The infeasibility certificate is of pretty bad quality. I would suggest you first try with the latest Mosek 10.

And perhaps improve the input data scaling to not have near zero elements, which Mosek warned about.