An objective has already been supplied for this problem

I need to solve the following problem: only etaa is variable


I have proved this SINR(k) is a concave function. so min SINR(k) also is concave function. Since the log function is concave and not decreasing, t it is still a concave function after compounding. So I write the cvx code.
cvx_begin
variable cauy(M,K)
for k=1:K
maximize (log(sum((etaa(:,k).^0.5).*alpha(:,k))))
subject to
for m=1:M
(etaa(m,:)).*alpha(m, :) == 1;
end
end
cvx_end

But it does not work. Can you help me?

I modify my code,but it doesnot work.
as follows:
cvx_begin
variable cauy(M,K)
value = cvx(zeros(1,K));

for k=1:K
value(k) = log(sum((cauy(:,k).^0.5).*Gammaa(:,k)));
end
min_value = min(value(:));
maximize (min_value)
subject to
for m=1:M
(cauy(m,:)).*Gammaa(m,:) == 1;
end
cvx_end
Anyone who can help me? Is my code wrong?
:sob::sob: I will appreciate it.

Your problem executes and produces an answer with the made up data I used ( Gammaa = ones(3,2) ). . I have no idea what the relation is between your code and the problem depicted in the graphic.

Sorry Stone. It’s my bad. After I modified my code, I did not modify my question, sorry. Because I am running my second code with my experiment data,the result is NAN, and I want to ask is that my second code is correct? Really really thank you

How do I know whether your code is correct? I have idea no idea what optimization problem you are trying to solve.

When I ran it your code on made up data it produced an answer. It was also successful with several matrices created with positive multiples of rand. Perhaps on your experiment data CVX’s successive approximation failed, as can happen, even if your code is “correct” http://cvxr.com/cvx/doc/advanced.html#the-successive-approximation-method .

You can try specifying a different solver and see whether that succeeds. Alternatively, you can use CVX 3.0beta and install and specify ecos or scs (with high enough max iterations) as the solver, either of which will avoid CVX’s successive approximation method, and may succeed even when CVX’s successive approximation method fails.

Dear Stone,thank you for your patience. In my previous code, the constraints were wrong. Then I found out that I could not use the log function, since the overall SINR is positive and I can max-min sqrt (SINR), but under cvx 2.1,based on my experimental data, I use SDPT3 the result is nan, using Mosek and SeDuMi, the result is inf, then I test the random number,it can be solved, this is because my experimental data can not be used CVX to solve?

Please show us the outputs from running the various solvers and for the “random number”.

Perhaps the Gammaa in your experiment data makes the problem unbounded, whereas random data does not. If so, you need to reconsider the formulation of your model.

Dear Stone,my code as fallows:

clc
clear all
format long
M = 60; K = 20; tau = 20; B = 20;
load(‘BETAA.mat’)
load(‘Gammaa.mat’)

power_f=0.2; %downlink power: 200 mW
noise_p = 10^((-203.975+10log10(B10^6)+9)/10); %noise power
Pd = power_f/noise_p;%nomalized receive SNR
Pp=Pd/2;%pilot power: 100 mW

%% --------------------------------------------------------------CVX
cvx_begin
variable etaa(M,K)
SINRR = cvx(zeros(1,K));
for k=1:K
SINRR(k) = sum((etaa(:,k).^0.5) .* Gammaa(:,k)) / (( 1/Pd + sum(BETAA(:,k))) ^0.5);
end
min_SINR = min(SINRR);

maximize (min_SINR)
subject to
for m=1:M
    sum((etaa(m,:)).*Gammaa(m,:)) == 1;
end

cvx_end
%% ---------------------------------------------------------------------
Both BETAA and Gammaa are positive numbers.
When I use CVX 2.1 based on my experiment data : SDPT3, it shows sqlp stop: primal or dual is diverging, 7.0e+17
Mosek: Status: Infeasible Optimal value (cvx_optval): -Inf
SeDuMi No sensible solution found.
When I using Gammaa = 10^(-7).*rand(M,K) instead of my experiment data( some Gammaa value equal 10^(-19)) ,it can be solved.
But when I run it in CVX3.0,they both show(based on my experiment data) Status: Infeasible Optimal value (cvx_optval): -Inf

You changed your program again. Now there is no use of log. Therefore, CVX’s successive approximation method will not be used, and my comments about that can be ignored.

Use of etaa(:,k).^0.5 is constraining all elements of etaa to be non-negative. Perhaps not all elements of your experiment data Gammaa are really positive, or they have very extreme magnitudes (very large or close to 0), thereby causing numerical difficulties. What are the range of exponents on the elements of Gammaa?

Please show the actual output from running CVX, including all solver output, not just your summary.

Dear Stone,thanks to your reply.
I put gamma data in the form of pictures,

just as you say, they have very extreme magnitudes (very close to 0),
The following is my result, under cvx2.1

————————————————————————————————————————————————

Calling SDPT3 4.0: 3621 variables, 1280 equality constraints

num. of constraints = 1280
dim. of sdp var = 2400, num. of sdp blk = 1200
dim. of linear var = 20
dim. of free var = 1 *** convert ublk to lblk
number of nearly dependent constraints = 60
To remove these constraints, re-run sqlp.m with OPTIONS.rmdepconstr = 1.


SDPT3: Infeasible path-following algorithms


version predcorr gam expon scale_data
HKM 1 0.000 1 0
it pstep dstep pinfeas dinfeas gap prim-obj dual-obj cputime

0|0.000|0.000|8.6e+00|2.0e+02|2.4e+05| 3.642686e-11 0.000000e+00| 0:0:01| spchol 1 1
1|0.000|0.000|8.6e+00|2.0e+02|3.7e+18| 3.642686e-11 -1.174478e+28| 0:0:01| spchol 1 2
2|0.000|0.000|8.6e+00|1.3e+04|8.3e+26| 4.035794e+00 -9.525936e+31| 0:0:01|
sqlp stop: primal or dual is diverging, 7.0e+17

number of iterations = 2
Total CPU time (secs) = 1.33
CPU time per iteration = 0.67
termination code = 3
DIMACS: 1.6e+02 0.0e+00 1.5e+04 0.0e+00 1.0e+00 8.7e-06


Status: Failed
Optimal value (cvx_optval): NaN

Calling Mosek 8.0.0.60: 3621 variables, 1280 equality constraints

MOSEK Version 8.0.0.60 (Build date: 2017-3-1 13:09:33)
Copyright © MOSEK ApS, Denmark. WWW: mosek.com
Platform: Windows/64-X86

MOSEK warning 710: #1 (nearly) zero elements are specified in sparse col ‘’ (0) of matrix ‘A’.
MOSEK warning 710: #1 (nearly) zero elements are specified in sparse col ‘’ (3) of matrix ‘A’.
MOSEK warning 710: #1 (nearly) zero elements are specified in sparse col ‘’ (6) of matrix ‘A’.
MOSEK warning 710: #1 (nearly) zero elements are specified in sparse col ‘’ (9) of matrix ‘A’.
MOSEK warning 710: #1 (nearly) zero elements are specified in sparse col ‘’ (12) of matrix ‘A’.
MOSEK warning 710: #1 (nearly) zero elements are specified in sparse col ‘’ (15) of matrix ‘A’.
MOSEK warning 710: #1 (nearly) zero elements are specified in sparse col ‘’ (21) of matrix ‘A’.
MOSEK warning 710: #1 (nearly) zero elements are specified in sparse col ‘’ (24) of matrix ‘A’.
MOSEK warning 710: #1 (nearly) zero elements are specified in sparse col ‘’ (27) of matrix ‘A’.
MOSEK warning 710: #1 (nearly) zero elements are specified in sparse col ‘’ (30) of matrix ‘A’.
Warning number 710 is disabled.
Problem
Name :
Objective sense : min
Type : CONIC (conic optimization problem)
Constraints : 1280
Cones : 1200
Scalar variables : 3621
Matrix variables : 0
Integer variables : 0

Optimizer started.
Conic interior-point optimizer started.
Presolve started.
Linear dependency checker started.
Linear dependency checker terminated.
Eliminator - tries : 0 time : 0.00
Lin. dep. - tries : 1 time : 0.02
Lin. dep. - number : 0
Presolve terminated. Time: 0.03
Interior-point optimizer terminated. Time: 0.11.

MOSEK PRIMAL INFEASIBILITY REPORT.

Problem status: The problem is primal infeasible

Optimizer terminated. Time: 0.17

Interior-point solution summary
Problem status : PRIMAL_INFEASIBLE
Solution status : PRIMAL_INFEASIBLE_CER
Dual. obj: 1.0000000000e+000 nrm: 1e+000 Viol. con: 0e+000 var: 5e-011 cones: 0e+000
Optimizer summary
Optimizer - time: 0.17
Interior-point - iterations : 0 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

Calling SeDuMi 1.34: 3621 variables, 1280 equality constraints

SeDuMi 1.34 (beta) by AdvOL, 2005-2008 and Jos F. Sturm, 1998-2003.
Alg = 2: xz-corrector, Adaptive Step-Differentiation, theta = 0.250, beta = 0.500
Split 1 free variables
eqs m = 1280, order n = 2423, dim = 3623, blocks = 1201
nnz(A) = 6060 + 0, nnz(ADA) = 8860, nnz(L) = 5070
it : by gap delta rate t/tP t/tD* feas cg cg prec
0 : 8.36E-03 0.000
1 : -2.23E+05 2.79E-03 0.000 0.3340 0.9000 0.9000 -1.00 1 1 5.0E+00
2 : -3.36E+05 1.14E-03 0.000 0.4071 0.9000 0.9000 -1.00 19 19 5.0E+00
3 : -1.49E+05 2.23E-04 0.000 0.1958 0.0000 0.9000 -1.00 21 21 5.0E+00
4 : -1.72E+05 9.45E-05 0.000 0.4246 0.9121 0.9000 -1.00 20 20 5.0E+00
Run into numerical problems.

iter seconds digits cx by
4 1.9 -0.0 3.9627965484e+01 -1.7206323965e+05
|Ax-b| = 6.4e+01, [Ay-c]_+ = 1.8E+00, |x|= 1.5e+03, |y|= 1.5e+11
No sensible solution found.

Detailed timing (sec)
Pre IPM Post
5.540E-01 1.280E+00 7.900E-02
Max-norms: ||b||=1, ||c|| = 1,
Cholesky |add|=1, |skip| = 11, ||L.L|| = 1.

Status: Failed
Optimal value (cvx_optval): NaN

really really thank you

But in CVX3.0 ,the result as follows:

Calling SDPT3 4.0: 3621 variables, 1280 equality constraints

num. of constraints = 1280
dim. of socp var = 3600, num. of socp blk = 1200
dim. of linear var = 20
dim. of free var = 1
*** convert ublk to linear blk


SDPT3: homogeneous self-dual path-following algorithms


version predcorr gam expon
NT 1 0.000 1
it pstep dstep pinfeas dinfeas gap mean(obj) cputime kap tau theta

0|0.000|0.000|5.7e+00|1.8e+01|1.2e+03| 4.553413e-02| 0:0:00|1.2e+03|1.0e+00|1.0e+00| spchol^15 10
1|0.977|0.977|5.7e+00|1.8e+01|3.5e+04| 1.595502e+04| 0:0:00|1.2e+03|3.7e-02|3.7e-02| spchol 6 6
2|0.798|0.798|5.7e+00|1.8e+01|1.6e+05| 6.996584e+04| 0:0:00|1.2e+03|8.4e-03|8.4e-03| spchol 2 2
3|0.461|0.461|5.7e+00|1.8e+01|2.6e+05| 9.061090e+04| 0:0:00|1.0e+03|5.7e-03|5.7e-03| spchol 2 2
4|0.585|0.585|5.7e+00|1.8e+01|5.0e+05| 8.054366e+04| 0:0:00|6.9e+02|4.2e-03|4.2e-03| spchol 2 2
5|0.716|0.716|5.7e+00|1.8e+01|7.7e+05| 8.314848e+04| 0:0:00|4.4e+02|2.7e-03|2.7e-03| spchol 2 2
6|0.616|0.616|5.7e+00|1.8e+01|1.4e+06| 1.313861e+05| 0:0:00|3.7e+02|1.5e-03|1.5e-03| spchol 2 1
7|0.718|0.718|5.7e+00|1.8e+01|2.6e+06| 1.865432e+05| 0:0:00|2.8e+02|7.7e-04|7.7e-04| spchol 2 2
8|0.993|0.993|5.7e+00|1.8e+01|3.2e+07| 2.050432e+06| 0:0:00|2.6e+02|6.7e-05|6.7e-05| spchol 1 1
9|0.974|0.974|5.7e+00|1.8e+01|2.9e+08| 1.641578e+07| 0:0:01|2.4e+02|7.6e-06|7.6e-06| spchol 1 1
10|0.988|0.988|5.6e+00|1.7e+01|2.3e+10| 1.298308e+09| 0:0:01|2.4e+02|9.4e-08|9.4e-08|
Stop: primal problem is suspected of being infeasible

number of iterations = 10
residual of primal infeasibility
certificate (y,Z) = 1.35e-08
reldist to infeas. <= 6.13e-13
Total CPU time (secs) = 0.53
CPU time per iteration = 0.05
termination code = 1
DIMACS: 5.6e+00 0.0e+00 1.7e+01 0.0e+00 -9.9e-01 9.0e+00


Status: Infeasible
Optimal value (cvx_optval): -Inf

Calling Mosek 8.0.0.60: 3621 variables, 1280 equality constraints

MOSEK Version 8.0.0.60 (Build date: 2017-3-1 13:09:33)
Copyright © MOSEK ApS, Denmark. WWW: mosek.com
Platform: Windows/64-X86

MOSEK warning 710: #1 (nearly) zero elements are specified in sparse col ‘’ (46) of matrix ‘A’.
MOSEK warning 710: #1 (nearly) zero elements are specified in sparse col ‘’ (47) of matrix ‘A’.
MOSEK warning 710: #1 (nearly) zero elements are specified in sparse col ‘’ (120) of matrix ‘A’.
MOSEK warning 710: #1 (nearly) zero elements are specified in sparse col ‘’ (121) of matrix ‘A’.
MOSEK warning 710: #1 (nearly) zero elements are specified in sparse col ‘’ (122) of matrix ‘A’.
MOSEK warning 710: #1 (nearly) zero elements are specified in sparse col ‘’ (123) of matrix ‘A’.
MOSEK warning 710: #1 (nearly) zero elements are specified in sparse col ‘’ (124) of matrix ‘A’.
MOSEK warning 710: #1 (nearly) zero elements are specified in sparse col ‘’ (125) of matrix ‘A’.
MOSEK warning 710: #1 (nearly) zero elements are specified in sparse col ‘’ (127) of matrix ‘A’.
MOSEK warning 710: #1 (nearly) zero elements are specified in sparse col ‘’ (128) of matrix ‘A’.
Warning number 710 is disabled.
Problem
Name :
Objective sense : min
Type : CONIC (conic optimization problem)
Constraints : 1280
Cones : 1200
Scalar variables : 3621
Matrix variables : 0
Integer variables : 0

Optimizer started.
Conic interior-point optimizer started.
Presolve started.
Linear dependency checker started.
Linear dependency checker terminated.
Eliminator - tries : 0 time : 0.00
Lin. dep. - tries : 1 time : 0.00
Lin. dep. - number : 0
Presolve terminated. Time: 0.01
Interior-point optimizer terminated. Time: 0.05.

MOSEK PRIMAL INFEASIBILITY REPORT.

Problem status: The problem is primal infeasible

Optimizer terminated. Time: 0.11

Interior-point solution summary
Problem status : PRIMAL_INFEASIBLE
Solution status : PRIMAL_INFEASIBLE_CER
Dual. obj: 1.0000000000e+000 nrm: 1e+000 Viol. con: 0e+000 var: 2e-012 cones: 0e+000
Optimizer summary
Optimizer - time: 0.11
Interior-point - iterations : 0 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: Infeasible
Optimal value (cvx_optval): -Inf

Calling SeDuMi 1.34: 3621 variables, 1280 equality constraints

SeDuMi 1.34 (beta) by AdvOL, 2005-2008 and Jos F. Sturm, 1998-2003.
Alg = 2: xz-corrector, Adaptive Step-Differentiation, theta = 0.250, beta = 0.500
Split 1 free variables
eqs m = 1280, order n = 2423, dim = 3623, blocks = 1201
nnz(A) = 6060 + 0, nnz(ADA) = 8860, nnz(L) = 5070
it : by gap delta rate t/tP t/tD* feas cg cg prec
0 : 8.36E-03 0.000
1 : 4.29E+05 2.95E-03 0.000 0.3535 0.9000 0.9000 -1.00 1 1 5.0E+00
2 : 4.79E+05 8.83E-04 0.000 0.2989 0.9000 0.9000 -1.00 9 9 5.0E+00
3 : 4.06E+05 1.41E-04 0.000 0.1596 0.7018 0.9000 -1.00 20 20 5.0E+00
4 : 3.83E+05 3.68E-05 0.000 0.2613 0.9411 0.9000 -1.00 19 19 5.0E+00
Run into numerical problems.

Primal infeasible, dual improving direction found.
iter seconds |Ax| [Ay]_+ |x| |y|
4 1.9 6.6e-01 4.4e-06 7.1e+01 4.1e+05

Detailed timing (sec)
Pre IPM Post
1.500E-01 5.690E-01 2.200E-02
Max-norms: ||b||=1, ||c|| = 1,
Cholesky |add|=1, |skip| = 7, ||L.L|| = 1.

Status: Infeasible
Optimal value (cvx_optval): -Inf

Are all elements of Gammaa in the range of roughly 1 e-11 to 1e-17? MOSEK is warning you about the nearly zero elements, which I suspect are causing difficulties, and its failure to find a feasible solution. SDPT3 mentions nearly dependent constraints.

Can you try to re-scale data to be closer in magnitude to 1? You may also want to look at the scaling of the denominator in SINRR. It would be good to have SINRR come out within a small number of orders of magnitude of 1.

Dear Stone. Thank you for your advices, I will try it. Thank you!

SO did you solve the issue at the end?