Problem solved without seemingly meaningless constraint

Hello!
I’m trying to solve my SDP with CVX MOSEK solver,
and having a problem with a seemingly meaningless(I think) constraint.

HH, Q and U are the matrices and all other variables which are not specified in the code are scalar.
For your information, Both Q and U are positive semidefinite.

``````    dd = ones(N, 1);
cvx_begin
cvx_solver mosek
variable X(N,N) complex semidefinite;
variable A(K);
variable Y(M,M) complex semidefinite;

maximize( det_rootn(Y) );
subject to
for k = 1:K
A(k) == eta(k) * trace(Q(:,:,k) * conj(X));
end
Y == eye(M) + sterm*HH*kron(diag(A), U)*HH';
Y == hermitian_semidefinite(M);
diag(X) == dd;
X == hermitian_semidefinite(N);
cvx_end
``````

Upper is the original code I make to solve the problem and this showed me this output.

``````Calling Mosek 9.1.9: 167 variables, 69 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: #1 (nearly) zero elements are specified in sparse col '' (1) of matrix 'A'.
MOSEK warning 710: #1 (nearly) zero elements are specified in sparse col '' (4) of matrix 'A'.
MOSEK warning 710: #1 (nearly) zero elements are specified in sparse col '' (6) of matrix 'A'.
Problem
Name                   :
Objective sense        : min
Type                   : CONIC (conic optimization problem)
Constraints            : 69
Cones                  : 3
Scalar variables       : 23
Matrix variables       : 3
Integer variables      : 0

Optimizer started.
Presolve started.
Linear dependency checker started.
Linear dependency checker terminated.
Eliminator started.
Freed constraints in eliminator : 1
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            : 69
Cones                  : 3
Scalar variables       : 23
Matrix variables       : 3
Integer variables      : 0

Optimizer  - solved problem         : the primal
Optimizer  - Constraints            : 66
Optimizer  - Cones                  : 4
Optimizer  - Scalar variables       : 19                conic                  : 19
Optimizer  - Semi-definite variables: 3                 scalarized             : 308
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 : 1979              after factor           : 1979
Factor     - dense dim.             : 0                 flops                  : 1.91e+05
ITE PFEAS    DFEAS    GFEAS    PRSTATUS   POBJ              DOBJ              MU       TIME
0   2.0e+00  1.0e+00  3.3e+01  0.00e+00   3.200000000e+01   0.000000000e+00   1.0e+00  0.00
1   3.7e-01  1.8e-01  2.7e+00  9.80e-01   6.307788768e+00   3.082104773e-01   1.8e-01  0.00
2   1.3e-01  6.7e-02  7.1e-01  8.32e-01   3.401261259e+00   8.766351912e-01   6.7e-02  0.00
3   4.0e-02  2.0e-02  9.5e-01  -2.27e-01  6.612565264e+01   5.321081965e+01   2.0e-02  0.00
4   4.5e-04  2.2e-04  4.7e-02  -6.20e-01  1.278822497e+03   1.314778188e+03   2.2e-04  0.00
5   9.6e-05  4.8e-05  2.1e-02  -9.96e-01  5.833675253e+03   6.012056551e+03   4.8e-05  0.00
6   2.9e-05  1.5e-05  1.0e-02  -9.63e-01  1.455839462e+04   1.501010873e+04   1.5e-05  0.00
7   1.4e-05  7.1e-06  6.7e-03  -9.72e-01  2.622676422e+04   2.704241850e+04   7.1e-06  0.00
8   1.2e-05  5.8e-06  3.3e-03  -2.25e-02  1.011210262e+04   1.041723352e+04   5.8e-06  0.00
9   1.5e-06  7.6e-07  2.3e-04  1.27e-01   3.511156007e+03   3.598023721e+03   7.6e-07  0.00
10  4.7e-07  2.3e-07  3.1e-05  1.15e+00   2.292507364e+03   2.309072579e+03   2.3e-07  0.00
11  1.3e-07  6.3e-08  4.5e-06  1.10e+00   1.977412466e+03   1.982152679e+03   6.3e-08  0.00
12  5.4e-08  2.4e-08  1.5e-06  8.19e-01   1.857577326e+03   1.861525077e+03   2.4e-08  0.00
13  2.1e-08  8.6e-09  5.1e-07  5.76e-01   1.788817354e+03   1.791973446e+03   8.6e-09  0.00
14  8.0e-09  3.3e-09  1.8e-07  5.19e-03   1.738542101e+03   1.741344123e+03   3.3e-09  0.00
15  2.9e-09  1.2e-09  5.9e-08  2.20e-01   1.690599174e+03   1.692878557e+03   1.2e-09  0.00
16  1.1e-09  4.3e-10  1.5e-08  5.92e-01   1.667907758e+03   1.669042287e+03   4.3e-10  0.00
17  4.7e-10  1.8e-10  7.4e-09  1.26e-01   1.638993550e+03   1.640469776e+03   1.9e-10  0.02
18  3.9e-10  1.8e-10  7.3e-09  7.08e-01   1.638906833e+03   1.640364749e+03   1.8e-10  0.02
19  3.7e-10  1.7e-10  6.8e-09  1.06e+00   1.637911402e+03   1.639306666e+03   1.8e-10  0.02
20  3.7e-10  1.7e-10  6.8e-09  6.90e-01   1.637911402e+03   1.639306666e+03   1.8e-10  0.02
21  3.7e-10  1.7e-10  6.8e-09  7.11e-01   1.637911402e+03   1.639306666e+03   1.8e-10  0.02
Optimizer terminated. Time: 0.02

Interior-point solution summary
Problem status  : UNKNOWN
Solution status : UNKNOWN
Primal.  obj: 1.6379114025e+03    nrm: 4e+06    Viol.  con: 4e+01    var: 0e+00    barvar: 0e+00    cones: 0e+00
Dual.    obj: 1.6393066663e+03    nrm: 4e+03    Viol.  con: 0e+00    var: 3e-06    barvar: 2e-05    cones: 0e+00
Optimizer summary
Optimizer                 -                        time: 0.02
Interior-point          - iterations : 22        time: 0.02
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: Failed
Optimal value (cvx_optval): NaN
``````

As you can see, CVX returns the status failed with NaN optimal value.
But if I just remove one constraint which I think meaningless,
`Y == hermitian_semidefinite(M);`
CVX solve the problem and show this result below.

``````Calling Mosek 9.1.9: 159 variables, 65 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: #1 (nearly) zero elements are specified in sparse col '' (1) of matrix 'A'.
MOSEK warning 710: #1 (nearly) zero elements are specified in sparse col '' (4) of matrix 'A'.
MOSEK warning 710: #1 (nearly) zero elements are specified in sparse col '' (6) of matrix 'A'.
Problem
Name                   :
Objective sense        : min
Type                   : CONIC (conic optimization problem)
Constraints            : 65
Cones                  : 2
Scalar variables       : 15
Matrix variables       : 3
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            : 65
Cones                  : 2
Scalar variables       : 15
Matrix variables       : 3
Integer variables      : 0

Optimizer  - solved problem         : the primal
Optimizer  - Constraints            : 63
Optimizer  - Cones                  : 3
Optimizer  - Scalar variables       : 12                conic                  : 12
Optimizer  - Semi-definite variables: 3                 scalarized             : 308
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 : 1792              after factor           : 1792
Factor     - dense dim.             : 0                 flops                  : 1.80e+05
ITE PFEAS    DFEAS    GFEAS    PRSTATUS   POBJ              DOBJ              MU       TIME
0   2.0e+00  1.0e+00  3.9e+01  0.00e+00   3.800000000e+01   0.000000000e+00   1.0e+00  0.00
1   4.6e-01  2.3e-01  4.4e+00  9.65e-01   9.308944730e+00   2.943703207e-01   2.3e-01  0.02
2   1.7e-01  8.7e-02  1.2e+00  8.29e-01   4.723708801e+00   8.653484228e-01   8.7e-02  0.02
3   5.7e-02  2.9e-02  9.6e-01  -5.74e-02  2.450453366e+01   1.724711316e+01   2.9e-02  0.02
4   1.5e-03  7.4e-04  1.0e-01  -6.11e-01  4.151953275e+02   4.237110696e+02   7.4e-04  0.02
5   1.5e-04  7.7e-05  3.3e-02  -9.94e-01  3.982819623e+03   4.102831236e+03   7.7e-05  0.02
6   3.7e-05  1.9e-05  1.5e-02  -9.84e-01  1.382927642e+04   1.425756571e+04   1.9e-05  0.02
7   1.7e-05  8.7e-06  1.0e-02  -9.85e-01  2.750131040e+04   2.835637414e+04   8.7e-06  0.02
8   1.5e-05  7.4e-06  5.7e-03  -3.23e-01  1.264475477e+04   1.303014196e+04   7.4e-06  0.02
9   2.3e-06  1.2e-06  5.3e-04  3.31e-02   4.848922403e+03   4.980446467e+03   1.2e-06  0.02
10  8.4e-07  4.3e-07  1.1e-04  1.01e+00   2.440959853e+03   2.482850920e+03   4.3e-07  0.02
11  3.7e-07  1.9e-07  3.0e-05  1.22e+00   2.263460409e+03   2.280332378e+03   1.9e-07  0.02
12  1.2e-07  6.3e-08  5.9e-06  1.04e+00   1.996817697e+03   2.002575374e+03   6.3e-08  0.02
13  6.0e-08  3.0e-08  2.9e-06  8.25e-01   1.880080559e+03   1.886106592e+03   3.0e-08  0.02
14  2.3e-08  1.1e-08  8.5e-07  7.17e-01   1.811011714e+03   1.814570412e+03   1.1e-08  0.02
15  1.1e-08  5.6e-09  5.0e-07  -2.37e-02  1.747817679e+03   1.753042286e+03   5.6e-09  0.02
16  3.7e-09  1.9e-09  1.0e-07  5.14e-01   1.716127989e+03   1.718035302e+03   1.9e-09  0.02
17  1.2e-09  6.2e-10  3.3e-08  1.65e-01   1.668259459e+03   1.670171636e+03   6.2e-10  0.02
18  3.5e-10  1.8e-10  6.4e-09  5.32e-01   1.644796895e+03   1.645679031e+03   1.8e-10  0.02
19  1.2e-10  6.2e-11  2.3e-09  2.33e-01   1.622348671e+03   1.623276414e+03   6.2e-11  0.02
20  3.5e-11  1.8e-11  4.3e-10  6.56e-01   1.612379915e+03   1.612772120e+03   1.8e-11  0.02
21  1.1e-11  5.7e-12  1.4e-10  2.98e-01   1.600903152e+03   1.601306146e+03   5.7e-12  0.02
22  3.3e-12  1.7e-12  2.8e-11  6.31e-01   1.596025768e+03   1.596212695e+03   1.7e-12  0.02
23  1.2e-12  1.2e-12  1.1e-11  2.70e-01   1.590863212e+03   1.591073537e+03   6.3e-13  0.02
24  3.4e-13  6.9e-13  2.0e-12  6.69e-01   1.588508094e+03   1.588595440e+03   1.7e-13  0.02
25  1.5e-13  1.3e-12  7.5e-13  3.12e-01   1.586069261e+03   1.586162597e+03   6.3e-14  0.02
26  4.4e-14  3.7e-13  1.5e-13  6.53e-01   1.584989059e+03   1.585031324e+03   1.9e-14  0.02
27  1.8e-14  1.5e-13  6.4e-14  2.76e-01   1.583868687e+03   1.583916711e+03   7.4e-15  0.02
28  5.0e-15  4.2e-14  1.2e-14  6.66e-01   1.583328752e+03   1.583349099e+03   2.1e-15  0.02
29  1.9e-15  1.6e-14  4.6e-15  3.11e-01   1.582792635e+03   1.582814172e+03   8.0e-16  0.03
30  5.9e-16  4.9e-15  9.6e-16  6.48e-01   1.582540447e+03   1.582550422e+03   2.5e-16  0.03
31  2.4e-16  2.0e-15  4.2e-16  2.68e-01   1.582281157e+03   1.582292377e+03   1.0e-16  0.03
32  6.3e-17  5.3e-16  7.7e-17  6.57e-01   1.582152444e+03   1.582157272e+03   2.9e-17  0.03
33  2.5e-17  1.8e-16  2.8e-17  3.06e-01   1.582025025e+03   1.582030085e+03   1.1e-17  0.03
34  9.5e-18  9.0e-17  6.4e-18  6.45e-01   1.581964862e+03   1.581967205e+03   3.3e-18  0.03
35  1.2e-15  9.0e-17  5.3e-18  2.68e-01   1.581964575e+03   1.581966919e+03   3.3e-18  0.03
36  1.1e-15  8.9e-17  6.4e-18  2.67e-01   1.581964286e+03   1.581966631e+03   3.3e-18  0.03
37  1.2e-15  8.3e-17  6.5e-18  2.65e-01   1.581961917e+03   1.581964271e+03   3.2e-18  0.03
38  1.1e-15  8.2e-17  6.9e-18  2.56e-01   1.581961621e+03   1.581963975e+03   3.1e-18  0.03
39  1.2e-15  6.4e-17  6.2e-18  2.55e-01   1.581956622e+03   1.581958983e+03   2.9e-18  0.03
40  4.0e-16  7.2e-17  3.1e-18  2.47e-01   1.581890105e+03   1.581892317e+03   9.0e-19  0.03
41  5.8e-16  7.2e-17  3.5e-18  6.18e-01   1.581890095e+03   1.581892306e+03   9.0e-19  0.03
42  6.2e-16  7.2e-17  4.8e-18  6.16e-01   1.581890084e+03   1.581892295e+03   9.0e-19  0.05
43  6.7e-16  7.2e-17  5.0e-18  6.14e-01   1.581890041e+03   1.581892250e+03   9.0e-19  0.05
44  7.2e-16  7.2e-17  4.7e-18  6.15e-01   1.581890020e+03   1.581892228e+03   9.0e-19  0.05
45  7.2e-16  7.2e-17  4.7e-18  6.06e-01   1.581890020e+03   1.581892228e+03   9.0e-19  0.05
46  7.0e-16  7.2e-17  4.9e-18  6.09e-01   1.581890017e+03   1.581892225e+03   9.0e-19  0.05
47  7.0e-16  7.2e-17  4.9e-18  6.20e-01   1.581890017e+03   1.581892225e+03   9.0e-19  0.05
48  7.0e-16  7.2e-17  4.9e-18  6.18e-01   1.581890017e+03   1.581892225e+03   9.0e-19  0.05
Optimizer terminated. Time: 0.05

Interior-point solution summary
Problem status  : PRIMAL_AND_DUAL_FEASIBLE
Solution status : OPTIMAL
Primal.  obj: 1.5818900171e+03    nrm: 2e+09    Viol.  con: 1e-04    var: 0e+00    barvar: 0e+00    cones: 0e+00
Dual.    obj: 1.5818922252e+03    nrm: 4e+03    Viol.  con: 0e+00    var: 2e-09    barvar: 4e-09    cones: 0e+00
Optimizer summary
Optimizer                 -                        time: 0.05
Interior-point          - iterations : 49        time: 0.05
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: Solved
Optimal value (cvx_optval): +1581.89
``````

Okay my point is it.

Is the constraint I deleted is really meaningless?

I thought so because I already declare the Y as hermitian semidefinite with these lines below.

``````variable Y(M,M) complex semidefinite;
Y == eye(M) + sterm*HH*kron(diag(A), U)*HH';`
``````

I would be wrong because I’m just a beginner in this field.
Can you please let me know the TRUTH?

Even if that constraint is redundant, looking at the information from Mosek, the problem provided to Mosek is different between your two versions (smaller without the redundant constraint), even if they are mathematically equivalent. Any difference in the input to the solver can cause a difference in behavior. Mosek warns about nearly zero elements in the input data - perhaps these are causing numerical challenges to Mosek, which for one of your problems resulted in “failure” (not complete success). I suggest you either remove near zero input data which should be exactly zero, or you change units of input data to improve numerical scaling, so that non-zero input data is within a small number of orders of magnitude of one.

And don’t use the redundant constraint version.

Hi Mark!

First, I totally appreciate your kind reply with details which is understandable even for beginners like me!

Shown at the first post, even without the redundant constraint, CVX shows the near zero warning.

``````MOSEK warning 710: #1 (nearly) zero elements are specified in sparse col '' (1) of matrix 'A'.
MOSEK warning 710: #1 (nearly) zero elements are specified in sparse col '' (4) of matrix 'A'.
MOSEK warning 710: #1 (nearly) zero elements are specified in sparse col '' (6) of matrix 'A'.
``````

I found a topic about the same problem in this fourm.

As mentioned in the answer, I’m not happy with the solution.
There should not be zero in the matrix ‘A’, but I found it’s like

``````A =
0
0.0007
0.0022
0.0033
``````

Does this happen due to the near zero warning?

If so, I would like to solve this problem to get HAPPY solution.
But unfortunately, I cannot remove any near zeros in the matrix ‘Q’(I suspect this is the cirminal ) and also it seems quite tough to change unit of inputs as you suggested.

I need to check more by myself but
can you please share any other tips or techniques to solve this problem with me?

Thank you again!

There is no correspondence between the `A` in Mosek’s warning, and the variable `A` in your CVX program. The `A` in Mosek’s warning is a generic name for an input matrix `A`, which is input data received from CvX after whatever transformations it has made to your problem.

In the version of your program without the redundant constraint, perhaps you are “getting away with” having the near zero input data Mosek warns of. if you don’t like the zero element in the optimal `A`, perhaps there is some deficiency or inadequacy in your model and/or input data. But that is your matter to resolve, not something you can expect forum readers to understand. DO you want a lower bound on `A`, such as `A >= 1e-4`? If so, you could add such a constraint.

My problem is sum rate maximization using BCD and I know it’s tricky to guarantee the convergence.
I’m quite sure that my problem is differentiable(I mean matrix `Y` in the objective function is differentiable) and convex(or quasi-convex?).

Belows are the objective values( `det_rootn(Y)` ) before optimization(after the last optimization step) and after optimization.

``````objv_prev =
1.8952e+03
objv =
1.5819e+03
``````

Why the latter one is worse even though the `cvx_status` is `'Solved'`?
I found this only happen when the output matrix `A` has a zero value in the elements.
Setting lower bound you suggested didn’t work for me.
Does this just mean that my problem is not fit to CVX or BCD?

Lastly, thank you a lot for your kind attention to this matter!

Block Coordinate Descent? Do you have a proof that it will converge to something, and that something will be a local maximum of the original problem, and that the BCD algorithm will ascend on every iteration (monotonically converge)? if not, then everything is a crapshoot. Behavior of iterative algorithms to solve non-convex problems by iteratively generating and solving convex problems by CVX is out of scope for this forum; in the sense that you’re pretty much on your own, and can’t expect to necessarily get any help. BTW, such iterative algorithms can easily generate wilder and wilder input data, at some point possibly exceeding the solver’s ability to handle numerically.

The vast majority of posters on this forum, whose name does not happen to be Stephen Boyd, and who post their experiences with SCA, report dismal failures. Now, that may be a biased sample, because the people who succeed don’t post (for help). Nevertheless< i think it is fairly reflective of reality. There’s a reason that high quality non-convex solvers are more than 10 lines of code long.

Thank you Mark.
I think I just realized the reality(although it’s a bit harsh for undergraduate student ) and learn a lot.

btw, I just dealt with it by editing constraint for `A` using inequality

``````for k = 1:K
A(k) <= real(eta(k) * trace(Q(:,:,k) * conj(Xdl)));
end
``````

Honestly, I don’t know why this works and am not sure this will work for all case. lol.
But I’m quite satisfied with it and I think it’s all thanks to you!

Hope you have a great day!

I really don’t want to bring you again here but I faced another problem.

``````dd = ones(N, 1);
cvx_begin
cvx_solver mosek
variable V(M,M) complex semidefinite;
variable A(K)
variable Y(M,M) complex semidefinite;
maximize ( det_rootn(Y) );
subject to
for k = 1:K
A(k) <= real(eta(k) * trace(V * conj(H(:,:,k)) * conj(Xdl) * transpose(H(:,:,k))));
end
Y == eye(M) + P0*tau0/(noise*(1-tau0))*HH*kron(diag(A), Xul)*HH';
trace(V) <= 1;
V == hermitian_semidefinite(M);
cvx_end
``````

With above program I fixed, CVX shows me this result.

``````Calling Mosek 9.1.9: 37 variables, 13 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

Problem
Name                   :
Objective sense        : min
Type                   : CONIC (conic optimization problem)
Constraints            : 13
Cones                  : 4
Scalar variables       : 21
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            : 13
Cones                  : 4
Scalar variables       : 21
Matrix variables       : 1
Integer variables      : 0

Optimizer  - solved problem         : the primal
Optimizer  - Constraints            : 11
Optimizer  - Cones                  : 4
Optimizer  - Scalar variables       : 20                conic                  : 15
Optimizer  - Semi-definite variables: 1                 scalarized             : 36
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 : 50                after factor           : 50
Factor     - dense dim.             : 0                 flops                  : 2.57e+03
ITE PFEAS    DFEAS    GFEAS    PRSTATUS   POBJ              DOBJ              MU       TIME
0   2.0e+00  2.0e+00  7.0e+00  0.00e+00   6.000000000e+00   0.000000000e+00   1.0e+00  0.00
1   4.2e-01  4.1e-01  7.2e-01  1.31e+00   1.395505262e+00   3.138580723e-01   2.1e-01  0.00
2   8.7e-02  8.6e-02  1.8e-01  2.13e-01   1.920729707e+00   1.593862113e+00   4.3e-02  0.00
3   2.6e-02  2.6e-02  6.4e-02  -2.32e-01  4.475072232e+00   4.521101971e+00   1.3e-02  0.00
4   1.2e-02  1.2e-02  3.4e-02  -1.90e-01  6.880955471e+00   7.135860426e+00   6.2e-03  0.00
5   5.4e-03  5.3e-03  1.4e-02  -7.08e-02  9.409255039e+00   9.698310254e+00   2.7e-03  0.00
6   2.3e-03  2.3e-03  7.8e-03  -2.96e-01  1.397455745e+01   1.468329993e+01   1.2e-03  0.00
7   7.3e-04  7.3e-04  2.3e-03  -1.25e-01  2.056280606e+01   2.123971999e+01   3.6e-04  0.00
8   2.0e-04  2.0e-04  8.8e-04  -2.97e-01  3.414791003e+01   3.566293775e+01   9.9e-05  0.00
9   6.0e-05  6.0e-05  2.5e-04  -4.97e-02  4.898453548e+01   5.038604770e+01   3.0e-05  0.00
10  2.5e-05  2.4e-05  1.3e-04  -2.05e-01  6.654038792e+01   6.865613294e+01   1.2e-05  0.00
11  7.9e-06  7.8e-06  2.1e-05  3.60e-01   8.329881640e+01   8.389730200e+01   3.9e-06  0.00
12  2.7e-07  2.7e-07  1.8e-07  6.82e-01   9.573410047e+01   9.577002826e+01   1.4e-07  0.00
13  7.3e-09  7.2e-09  7.8e-10  9.95e-01   9.616630874e+01   9.616724902e+01   3.6e-09  0.00
14  1.0e-09  9.9e-10  4.0e-11  1.00e+00   9.617613540e+01   9.617626468e+01   4.9e-10  0.00
15  1.1e-10  1.6e-09  1.5e-12  1.00e+00   9.617751836e+01   9.617753291e+01   5.5e-11  0.00
16  1.1e-11  1.1e-08  4.8e-14  1.00e+00   9.617767270e+01   9.617767419e+01   5.6e-12  0.00
17  2.1e-13  1.1e-08  8.9e-17  1.00e+00   9.617768949e+01   9.617768951e+01   8.4e-14  0.00
Optimizer terminated. Time: 0.00

Interior-point solution summary
Problem status  : PRIMAL_AND_DUAL_FEASIBLE
Solution status : OPTIMAL
Primal.  obj: 9.6177689486e+01    nrm: 6e+04    Viol.  con: 9e-05    var: 0e+00    barvar: 0e+00    cones: 0e+00
Dual.    obj: 9.6177689508e+01    nrm: 2e+03    Viol.  con: 0e+00    var: 5e-11    barvar: 3e-12    cones: 0e+00
Optimizer summary
Optimizer                 -                        time: 0.00
Interior-point          - iterations : 17        time: 0.00
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: Solved
Optimal value (cvx_optval): +96.1777
``````

And the elements in the matrix `A` is

``````K>> A
A =
0.0003
0.0008
0.0030
0
``````

but with the optimized variable `V`, I can get

``````for k = 1:K
A(k) = real(eta(k) * trace(V * conj(H(:,:,k)) * conj(Xdl) * transpose(H(:,:,k))));
end
A
A =
0.0003
0.0008
0.0030
0.0035
``````

Why `A(end)` is zero in pure CVX output but not zero with recomputation?
I know it’s available to be set as zero bacause I used inequality,
but it doesn’t make sense why CVX chose that value as an optimum.

Thanks a lot!

Why it doesn’t make sense? We dont know your problem too well.

Hi jack!
Sorry for the misunderstanding but It’s quite tough to explain my question well in English due to my lack of language skill.

Okay, the point is that.
Why didn’t CVX use the value which is obtained by itself and also quite clear to make objective function larger?

With the program I wrote, CVX returns me matrices `A`, `V` and `Y`.
The value of the returned matrix `A` is like

``````A =
0.0003
0.0008
0.0030
0
``````

and the objective value `det_rootn(Y)` is `96.1777`

And with the returned matrix `V`, I can compute matrix `A` by myself because `V` is kind of function of `A` and it’s like

``````A =
0.0003
0.0008
0.0030
0.0035
``````

and the objective value is much better(I don’t have exact value )

I understand the matrix `A` with zero never violate the constarint because I used inequality with it.

``````for k = 1:K
A(k) <= real(eta(k) * trace(V * conj(H(:,:,k)) * conj(Xdl) * transpose(H(:,:,k))));
end
``````

But I thought, although I used inequality, it’s more reasonable to make both left and right hand sides equal because CVX already knows the better `V`, which makes better `A`, which makes better objective value, which never violates the constraint.

I’m not sure that I explained well.

Thank you!

Can you use `==` , instead of `<=`, to run the same code with the same data again, to prove your statement of having a better ojective value?

Umm. I think I just made mis-explanation.

Using this program below,

``````cvx_begin
cvx_solver mosek
variable V(M,M) complex semidefinite;
variable A(K)
variable Y(M,M) complex semidefinite;
maximize ( det_rootn(Y) );
subject to
for k = 1:K
A(k) <= real(eta(k) * trace(V * conj(H(:,:,k)) * conj(Xdl) * transpose(H(:,:,k))));
end
Y == eye(M) + P0*tau0/(noise*(1-tau0))*HH*kron(diag(A), Xul)*HH';
trace(V) <= 1;
V == hermitian_semidefinite(M);
cvx_end
``````

I get this result,

``````K>> A, V, Y, det_rootn(Y)
A =
0
0.0009
0.0032
0
V =
0.4292 + 0.0000i  -0.4860 + 0.0940i
-0.4860 - 0.0940i   0.5708 + 0.0000i
Y =
1.0e+03 *
3.9797 + 0.0000i  -2.4336 - 0.1979i
-2.4336 + 0.1979i   1.5057 + 0.0000i
ans =
174.5597
``````

You can see that `A(1)` and `A(4)` is returned as zero, right?
But if I compute `A` with returned `V`(`A` is the function of `V`),

``````K>>
for k = 1:K
A(k) = real(eta(k) * trace(V * conj(H(:,:,k)) * conj(Xdl) * transpose(H(:,:,k))));
end
Y = eye(M) + P0*tau0/(noise*(1-tau0))*HH*kron(diag(A), Xul)*HH';

A, V, Y, det_rootn(Y)
A =
0.0003
0.0009
0.0032
0.0030
V =
0.4292 + 0.0000i  -0.4860 + 0.0940i
-0.4860 - 0.0940i   0.5708 + 0.0000i
Y =
1.0e+03 *
4.0087 + 0.0000i  -2.1951 - 0.4561i
-2.1951 + 0.4561i   6.9102 + 0.0000i
ans =
4.7618e+03
``````

`A(1)` and `A(4)` has been shown as not zero and also much better objective value `det_rootn(Y)` can be obtained.

As I told you, I understand that the output `A` from CVX is available because it doesn’t violate the inequality constraint.
But I wonder why CVX does not use

``````A =
0.0003
0.0009
0.0032
0.0030
``````

this `A` even though they know it and this never violate the inequality constraint.

I hope I didn’t make any mis-explanation this time…
And thank you for your attention to my prolem!

Can you provide your complete data (not just CVX code) so we can reproduce your problem?

Complete data is quite large so I don’t know how I can share them.

I think you can refer to the first post in which I mentioned the type matrices and variables.