# Status: Infeasible, Optimal value (cvx_optval): +Inf, stop: progress is too slow

Dear all,
I’m a rookie in cvx. All my constraints are convex and suit DCP. But the code just doesn’t work out. I’ve tried some methods like do some scaling but failed.
However, when I delete these two constraints(as shown in the picture), the code worked.

Besides, during the coding, I found that inv_pos function sometimes presented negative results and pow_p also gave wrong results which should not happen according to specification. Do you know why this happens?

I’m desperate to know where the problem is and what I should do to address it. Here is my code. Thank u in advance.

clear all;
close all;
randn(‘state’,0); rand(‘twister’,0);
K = 10;
N = 100;
FRE = 10^4;
D = 0.1;
ENE = 10 ^ 10;
B = 100;
p = randi(1,K,1);
l = repelem(1,K,N);
s = rand(K,N) * 10;
R = dB2dec(-10);
N0= dB2dec(-50);
q = [0,0]; % UAV当前位置假设一直处于0,0
w = randi(10,K,2); % w位随机生成的用户位置
H = 5; % UAV飞行高度，正常值位100或者20米
d = zeros(K,N); % 计算距离
PH= zeros(K,N); % 存储PHI值，
for i=1:N
for j=1:K
d(j,i)=sum((w(j, : ) - q).^2) + H^2;
end
PH(:,i)= p.*R ./ (N0.*d(:,i));
end

cvx_begin
variable b(K,N) nonnegative
variable F(K,N) nonnegative
variable Y(K,N) nonnegative
expression E(K,N)
for n=1:N
for k=1:K
E(k,n) = p(k).*l(k,n).s(k,n).Y(k,n);
end
end
ES = sum(sum(E))
minimize(ES)
subject to:
for n=1:N
0<= ES
0<= b(:,n) <=1;
0<= sum(b(:,n)) <= 1;
0<=F(:,n);
0<= sum(F(:,n)) <= FRE;
pwp = pow_p(F(:,n),-1);
ipf = inv_pos(F(:,n));
t1 = s(:,n) .
ipf;
t2 = s(:,n) .
Y(:,n);
t3 = t1 + t2;
t3 <= D;
pow_p(Y(:,n),-1) + kl_div(B.*b(:,n),B.*b(:,n)+PH(:,n)) <= PH(:,n);
end
ET = s.*F.*F;
ETT=sum(sum(ET));
ETT <= ENE;
cvx_end

## Calling SDPT3 4.0: 39501 variables, 14000 equality constraints For improved efficiency, SDPT3 is solving the dual problem.

num. of constraints = 14000
dim. of sdp var = 20000, num. of sdp blk = 10000
dim. of linear var = 9501
number of dense column in A = 100

SDPT3: Infeasible path-following algorithms

## number of iterations = 29 residual of dual infeasibility certificate X = 2.06e-11 reldist to infeas. <= 3.78e-17 Total CPU time (secs) = 18.94 CPU time per iteration = 0.65 termination code = 2 DIMACS: 8.0e-03 0.0e+00 3.1e-07 0.0e+00 -1.0e+00 3.0e-04

Status: Infeasible
Optimal value (cvx_optval): +Inf

It looks like the primal objective is huge. Try to rescale your problem to have things within a small number of orders of magnitude of 1.

Furthermore, given that your program uses `'kl_div` which is an exponential cone problem, and SDPT3 was run, it must be the case,that you are using CVXQUAD’s exponential.m replacemenrt. If you have access to Mosek, it would be better to use CVX 2,.2 with Mosek 9.1, which will utilize Mosek 9.1’s native exponential cone capability, and should work better. If you do use Mosek 9.1, then switch back in CVX;s version of exponential.m and then start a new session of MATLAB.if you can’;t do that, you could at least try SeDuMi and see whether it does better.

Also, you can try removing the objective function and see what happens regarding feasibility. it could be that bad scaling is causing an inaccurate infeasibility diagnosis.it might be that bad scaling in the objective function is coupling into an inaccurate infeasibility determination.

You can also read https://yalmip.github.io/debugginginfeasible/ , most of which is pertinent to CVX.