Solved but provided with NaN

Hi,

Could anyone help me with this output?

Thank you so much

Successive approximation method to be employed.
SDPT3 will be called several times to refine the solution.
Original size: 2761 variables, 181 equality constraints
80 exponentials add 640 variables, 400 equality constraints

Cones | Errors |
Mov/Act | Centering Exp cone Poly cone | Status
--------±--------------------------------±--------
80/ 80 | 6.780e+00 1.992e+01 0.000e+00 | Solved
80/ 80 | 6.417e+00s 1.257e+01 0.000e+00 | Solved
80/ 80 | 5.549e+00 6.251e+00 0.000e+00 | Solved
80/ 80 | 3.834e+00 1.965e+00 0.000e+00 | Solved
0/ 0 | 0.000e+00 0.000e+00 0.000e+00 | Failed
80/ 80 | 5.240e+00 5.057e+00 0.000e+00 | Solved
80/ 80 | 3.541e+00 1.593e+00 0.000e+00 | Solved
80/ 80 | 1.245e+00 1.439e-01 0.000e+00 | Solved
80/ 80 | 4.226e-01 1.402e-02 0.000e+00 | Solved
56/ 76 | 5.176e-01 2.301e-02 0.000e+00 | Solved
56/ 76 | 4.163e-01 1.361e-02 6.385e-08 | Solved
40/ 72 | 1.920e-01 3.062e-03 0.000e+00 | Solved
56/ 72 | 3.010e-01s 7.190e-03s 4.435e-09 | Solved
60/ 72 | 4.687e-01s 1.878e-02s 0.000e+00 | Solved
56/ 76 | 2.646e-01 5.861e-03 0.000e+00 | Solved
52/ 72 | 1.834e-01 2.793e-03 1.615e-06 | Solved
40/ 76 | 1.488e-01 1.782e-03 0.000e+00 | Solved
48/ 68 | 1.666e-01 2.300e-03 0.000e+00 | Solved
52/ 80 | 1.534e-01 1.963e-03 2.843e-05 | Solved
48/ 72 | 2.379e-01 4.519e-03 0.000e+00 | Solved
60/ 80 | 3.207e-01 8.148e-03 0.000e+00 | Solved
56/ 76 | 4.913e-01 2.068e-02 0.000e+00 | Solved
56/ 80 | 2.879e-01 6.585e-03 0.000e+00 | Solved
44/ 68 | 1.860e-01 2.776e-03 0.000e+00 | Solved
60/ 72 | 2.812e-01 6.631e-03 0.000e+00 | Solved

Status: Failed
Optimal value (cvx_optval): NaN

Those are subproblems in the Successive Approximation method which were solved. But the overall algorithm failed, Status: Failed

Thank you so much Mark,

I will use CVXQUAD. Hopefully, I could get a reliable result.

I was wondering that if I am in the correct path since my problem is SDP!
I add the CVXQUAD path and replace log(cvx_expression) with -rel_entr(1,cvx_expresion).
Is this OK?

Please find the my cvx code below:

cvx_begin sdp
cvx_precision low
variable W(BBS_antennas,BBS_antennas,F) hermitian
R_sum=0;
for b=1:B
for k=1:K
for f=1:F
temp0 = reshape(G_tilda(b,k,f,:,:),BBS_antennas,BBS_antennas);
temp1 = reshape(W_int(:,:,f),BBS_antennas,BBS_antennas);
temp2 = alpha_kf(k,f)real(trace(temp0temp1));
temp=0;
tempp=0;
temp_derivative=0;
for j=1:K
temp7 = reshape(W_int(:,:,f),BBS_antennas,BBS_antennas);
temp8 = reshape(G_tilda(b,j,f,:,:),BBS_antennas,BBS_antennas);
temp = temp+alpha_kf(j,f)real(trace(temp8temp7));
temp77 = reshape(W(:,:,f),BBS_antennas,BBS_antennas);
tempp = tempp+alpha_kf(j,f)real(trace(temp8temp77));
temp_derivative = temp_derivative+alpha_kf(j,f)temp8;
end
noise = norm(reshape(V_bfk(b,f,k,:),1,BS_antennas))^2
sigma2;
tempp = tempp+noise;
temp = temp-temp2+noise;
derivative = (1/log(2))(temp_derivative)/temp;
R_sum = R_sum-rel_entr(1,tempp)/log(2)-log(temp)/log(2)-real(trace(derivative
(W(:,:,f)-W_int(:,:,f))));
end
end
end
maximize(R_sum)
subject to
summ = cvx(zeros(B,1));
for b = 1:B
temp5 = reshape(Z_b(b,:,:),BBS_antennas,BBS_antennas);
for f=1:F
summ(b,1) = summ(b,1) + real(trace(temp5reshape(W(:,:,f),BBS_antennas,BBS_antennas))) ;
end
summ(b,1) <= P_max;
end
for k=1:K
for f=1:F
real(trace(reshape(H_kf(k,f,:,:),B
BS_antennas,BBS_antennas)
reshape(W(:,:,f),BBS_antennas,BBS_antennas)))>=EH(k,f)/(1-alpha_kf(k,f));
end
end
for f=1:F
real(W(:,:,f)) >= 0;
end
cvx_end

It looks like you forgot about log(temp) on the RHS of R_sum = ...

Also, I suggest you get rid of cvx_precision low, and let CVX use its default precision settings.

Thanks Mark for your prompt reply. It would be greatly appreciated!

I remove cvx_precision low. The second term i.e., log(temp) is constant which does not include optimization variable (W). Also, W_int is a initial point for W.

I ran it for two time and got the following results! Still, it is not working!

Thank you so much for your help.

Successive approximation method to be employed.
SDPT3 will be called several times to refine the solution.
Original size: 2761 variables, 181 equality constraints
80 exponentials add 640 variables, 400 equality constraints

Cones | Errors |
Mov/Act | Centering Exp cone Poly cone | Status
--------±--------------------------------±--------
80/ 80 | 6.798e+00 2.034e+01 0.000e+00 | Inaccurate/Solved
80/ 80 | 6.495e+00s 1.361e+01 0.000e+00 | Solved
80/ 80 | 5.720e+00 7.001e+00 6.790e-05 | Inaccurate/Solved
80/ 80 | 4.153e+00 1.988e+00 0.000e+00 | Inaccurate/Solved
72/ 72 | 1.673e+00 2.329e-01 0.000e+00 | Inaccurate/Solved
0/ 0 | 0.000e+00 0.000e+00 0.000e+00 | Inaccurate/Solved
0/ 0 | 0.000e+00 0.000e+00 0.000e+00 | Inaccurate/Solved
4/ 4 | 1.236e+00 8.940e-02 0.000e+00 | Inaccurate/Solved
0/ 0 | 0.000e+00 0.000e+00 0.000e+00 | Failed

Status: Inaccurate/Solved
Optimal value (cvx_optval): -12077.6

Successive approximation method to be employed.
SDPT3 will be called several times to refine the solution.
Original size: 2761 variables, 181 equality constraints
80 exponentials add 640 variables, 400 equality constraints

Cones | Errors |
Mov/Act | Centering Exp cone Poly cone | Status
--------±--------------------------------±--------
80/ 80 | 6.783e+00 1.988e+01 0.000e+00 | Inaccurate/Solved
80/ 80 | 6.423e+00s 1.262e+01 0.000e+00 | Inaccurate/Solved
80/ 80 | 5.578e+00 6.377e+00 2.407e-04 | Solved
80/ 80 | 3.831e+00 1.961e+00 0.000e+00 | Inaccurate/Solved
80/ 80 | 1.537e+00 2.266e-01 1.575e-06 | Solved
80/ 80 | 3.217e-01 8.718e-03 2.024e-09 | Solved
80/ 80 | 9.243e-01s 6.416e-02s 0.000e+00 | Inaccurate/Solved
80/ 80 | 8.718e-01s 6.773e-02s 1.260e-06 | Solved
80/ 80 | 2.457e-01 5.045e-03 0.000e+00 | Inaccurate/Solved
80/ 80 | 4.890e-01s 1.866e-02s 1.212e-09 | Inaccurate/Solved
72/ 72 | 5.463e-01 2.465e-02 0.000e+00 | Solved
80/ 80 | 6.815e-01 3.562e-02 0.000e+00 | Solved
80/ 80 | 3.954e-01 1.326e-02 3.636e-08 | Solved
80/ 80 | 5.714e-01s 2.819e-02s 6.014e-07 | Solved
80/ 80 | 1.156e+00s 1.229e-01s 0.000e+00 | Inaccurate/Solved

Status: Failed
Optimal value (cvx_optval): NaN

I also use MOSEK solver, NO results! :frowning:
My problem is feasible. I try it with objective as 1.

CVX Warning:
Models involving “rel_entr” 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: 2761 variables, 181 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

MOSEK warning 710: #8 (nearly) zero elements are specified in sparse col ‘’ (0) of matrix ‘A’.
MOSEK warning 710: #12 (nearly) zero elements are specified in sparse col ‘’ (1) of matrix ‘A’.
MOSEK warning 710: #8 (nearly) zero elements are specified in sparse col ‘’ (2) of matrix ‘A’.
MOSEK warning 710: #8 (nearly) zero elements are specified in sparse col ‘’ (3) of matrix ‘A’.
MOSEK warning 710: #12 (nearly) zero elements are specified in sparse col ‘’ (4) of matrix ‘A’.
MOSEK warning 710: #8 (nearly) zero elements are specified in sparse col ‘’ (5) of matrix ‘A’.
MOSEK warning 710: #8 (nearly) zero elements are specified in sparse col ‘’ (6) of matrix ‘A’.
MOSEK warning 710: #12 (nearly) zero elements are specified in sparse col ‘’ (7) of matrix ‘A’.
MOSEK warning 710: #8 (nearly) zero elements are specified in sparse col ‘’ (8) of matrix ‘A’.
MOSEK warning 710: #8 (nearly) zero elements are specified in sparse col ‘’ (9) of matrix ‘A’.
Warning number 710 is disabled.
Problem
Name :
Objective sense : min
Type : CONIC (conic optimization problem)
Constraints : 181
Cones : 80
Scalar variables : 1461
Matrix variables : 4
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 started.
Freed constraints in eliminator : 0
Eliminator terminated.
Eliminator - tries : 2 time : 0.00
Lin. dep. - tries : 1 time : 0.03
Lin. dep. - number : 0
Presolve terminated. Time: 0.08
Problem
Name :
Objective sense : min
Type : CONIC (conic optimization problem)
Constraints : 181
Cones : 80
Scalar variables : 1461
Matrix variables : 4
Integer variables : 0

Optimizer - threads : 2
Optimizer - solved problem : the primal
Optimizer - Constraints : 101
Optimizer - Cones : 81
Optimizer - Scalar variables : 1462 conic : 1441
Optimizer - Semi-definite variables: 4 scalarized : 1300
Factor - setup time : 0.09 dense det. time : 0.00
Factor - ML order time : 0.00 GP order time : 0.00
Factor - nonzeros before factor : 5151 after factor : 5151
Factor - dense dim. : 0 flops : 5.53e+06
ITE PFEAS DFEAS GFEAS PRSTATUS POBJ DOBJ MU TIME
0 1.9e+01 8.0e+02 5.5e+03 0.00e+00 5.396812042e+03 -6.440816013e+01 1.0e+00 0.78
1 5.0e+00 2.1e+02 2.8e+03 -1.00e+00 5.108502071e+03 -3.546228511e+02 2.6e-01 0.92
2 6.0e-01 2.5e+01 9.8e+02 -1.00e+00 2.180861701e+03 -3.310269891e+03 3.2e-02 0.92
3 9.3e-02 3.9e+00 4.0e+02 -1.02e+00 -1.770130390e+04 -2.331190722e+04 4.9e-03 0.94
4 1.8e-02 7.5e-01 1.7e+02 -1.03e+00 -1.127843241e+05 -1.172272700e+05 9.4e-04 0.94
5 4.9e-05 2.1e-03 8.9e+00 -1.00e+00 -4.293765450e+07 -4.254096903e+07 2.6e-06 0.95
6 3.1e-07 1.3e-05 7.0e-01 -1.00e+00 -6.764357378e+09 -6.700189981e+09 1.6e-08 0.95
Optimizer terminated. Time: 1.00

Interior-point solution summary
Problem status : DUAL_INFEASIBLE
Solution status : DUAL_INFEASIBLE_CER
Primal. obj: -1.0845878003e+02 nrm: 1e+00 Viol. con: 3e-07 var: 0e+00 barvar: 0e+00 cones: 0e+00
Optimizer summary
Optimizer - time: 1.00
Interior-point - iterations : 6 time: 0.97
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

The output shows that the Successive Approximation method was still used. Not because of the CVX warning message (which due to a bug, is printed regardless of whether it is actually used, but because of the Cones | Errors|... output.

However, as seen in your new post, you have access to Mosek, so just use that instead of CVXQUAD.

Mosek issued warnings about near zero elements. So the first thing to do is to fix the scaling so that non-zero input data is within a small number of orders of magnitude of one. Then re-run it, and see what happens.

I don’t see where it says that Mosek is solving the dual problem, but apparently so, because Mosek reports dual infeasible, and CVX reports unbounded. if after fixing the scaling, the problem is still reported by CVX to be unbounded, follow the advice in https://yalmip.github.io/debuggingunbounded .

Thank you so much Mark!