Sqlp stop: dual problem is suspected of being infeasible in next iteration

hello everyone, I am confused becausea problem occured in the second iteration ,I have checked the details in the frist iteration,the output is strange,because it was closed to the result which I want,but it stopded in the
second and third iteration .
what I want to solve as follows:
obj
γl+1 is equal to gama1_inv

this is my code:
function[Pr,Rr]=SolveP1(Qr)
clear all

global beta0 H N1 N2 V L d0 tolerance P_ave p1 p2 M SNR R S;
L=2000;
N=100;
H=100;
N1=1.0000e-17;
N2=1.0000e-17;
P_ave=5;
beta0= 210^(-5);
R=6.7167e+08;
B=2
10^7;
tolerance=0.0001;
tol=tolerance;
M=100;
m = 1 : 1: M;
Q(1,m) = ((L)(m-1)/(M-1));
Q(2,m)=0;
Qr=Q;
Pl=2
ones(2,M);
Pl={Pl};

for l=1:1:100
itera=l
h_au=beta0./(Qr(1,:).^2 + Qr(2,:).^2 +(Hones(1,M)).^2);
h_ub=beta0./((Qr(1,:)-L).^2 +Qr(2,:).^2 +(H
ones(1,M).^2));
save Pl{l}

gama=(Pl{l}(1,:).*Pl{l}(2,:).h_au.h_ub ) ./(Pl{l}(1,:).h_auN2 +Pl{l}(2,:).h_ubN1 +N1N2ones(1,M));
% gamal=(P(1,:).P(2,:).h_au.h_ub ) ./(P.h_auN2 +P(2,:).h_ubN1 +N1N2ones(1,M));
R_itera=B
log2(1+gama);

cvx_begin
expression gama1_inv
variable P(2,M)
for m=1:1:100
gama1_inv(m)=N1.inv_pos(P(1,m). h_au(m)) +N2.inv_pos(P(2,m).h_ub(m)) +(N1N2).prod_inv([P(1,m) P(2,m)])./(h_au(m).h_ub(m));
end
S=(((gama.^2)log2(exp(1)))./(2(gama+1))).
(gama1_inv -1./(gama));
maximize sum(R_itera-S)
subject to
sum(P(1,:))<=N
20;
sum(P(2,:))<=N
20;
P(1,:)>=0;
P(2,:)>=0;
cvx_end
Pr=P;

 Pl = cat(1, Pl, {Pr});
Rl=sum(R_itera-S);
R=[R,Rl];

if (l >= 2) &&(R(l) - R(l-1) < tol)
    break;
end

end
P=P;
save P
f = msgbox(‘over!’, ‘Done’, ‘help’);
end

the display in command window as follows:
test8

itera =

 1

Calling SDPT3 4.0: 1802 variables, 800 equality constraints
For improved efficiency, SDPT3 is solving the dual problem.

num. of constraints = 800
dim. of sdp var = 1000, num. of sdp blk = 500
dim. of linear var = 302


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|3.8e+02|1.7e+01|1.5e+07| 6.777480e+04 0.000000e+00| 0:0:00| spchol 1 1
1|0.134|0.093|3.3e+02|1.6e+01|1.4e+07| 1.526390e+05 -6.982444e-04| 0:0:01| spchol 1 1
2|0.418|0.483|1.9e+02|8.1e+00|7.7e+06| 2.252075e+05 -3.429558e-03| 0:0:01| spchol 1 1
3|0.854|0.975|2.8e+01|2.0e-01|3.7e+05| 1.436218e+05 -4.483242e-03| 0:0:01| spchol 1 1
4|0.910|0.943|2.5e+00|1.2e-02|1.1e+05| 8.795651e+04 -1.432373e-02| 0:0:01| spchol 1 1
5|0.826|0.845|4.4e-01|1.8e-03|2.1e+04| 1.704400e+04 -1.695165e-02| 0:0:02| spchol 1 1
6|0.641|1.000|1.6e-01|8.6e-06|1.4e+04| 9.861758e+03 -5.849525e-02| 0:0:02| spchol 1 1
7|0.776|1.000|3.5e-02|4.3e-06|3.9e+03| 2.096983e+03 -7.278649e-02| 0:0:02| spchol 1 1
8|0.459|1.000|1.9e-02|5.5e-06|4.0e+03| 2.506855e+03 -1.719763e-01| 0:0:02| spchol 1 1
9|0.927|0.895|1.4e-03|2.9e-06|3.3e+02| 1.603967e+02 -1.734084e-01| 0:0:02| spchol 1 1
10|0.657|0.840|4.8e-04|1.2e-06|1.6e+02| 4.184246e+01 -2.731675e-01| 0:0:02| spchol 1 1
11|0.799|0.852|9.7e-05|5.9e-07|8.3e+01| 3.363602e+01 -4.331387e-01| 0:0:02| spchol 1 1
12|0.651|0.888|3.4e-05|2.4e-07|4.2e+01| 7.242636e+00 -7.206659e-01| 0:0:02| spchol 1 1
13|0.818|0.868|6.1e-06|1.3e-07|2.2e+01| 7.705751e+00 -9.852387e-01| 0:0:02| spchol 1 1
14|0.675|0.918|2.0e-06|5.3e-08|1.1e+01| 1.725919e+00 -9.594856e-01| 0:0:02| spchol 1 1
15|0.793|0.912|4.1e-07|2.9e-08|6.1e+00| 1.929337e+00 -7.166826e-01| 0:0:02| spchol 1 1
16|0.704|0.927|1.2e-07|1.3e-08|2.8e+00| 3.472131e-01 -4.023429e-01| 0:0:02| spchol 1 1
17|0.796|0.924|2.5e-08|6.9e-09|1.5e+00| 4.574750e-01 -2.415568e-01| 0:0:02| spchol 1 1
18|0.700|0.933|7.5e-09|3.1e-09|6.7e-01| 4.449347e-02 -1.144365e-01| 0:0:02| spchol 1 1
19|0.885|0.904|8.6e-10|1.7e-09|3.3e-01| 7.942762e-02 -8.517073e-02| 0:0:02| spchol 1 1
20|0.521|0.714|4.1e-10|6.9e-10|2.1e-01|-3.373895e-02 -9.318937e-02| 0:0:02| spchol 1 1
21|0.783|0.526|9.0e-11|3.7e-10|1.4e-01|-1.127938e-01 -1.179548e-01| 0:0:03| spchol 1 1
22|0.618|0.469|3.4e-11|2.1e-10|1.1e-01|-2.113448e-01 -1.655831e-01| 0:0:03| spchol 1 1
23|0.499|0.418|1.7e-11|1.3e-10|1.0e-01|-3.310198e-01 -2.343050e-01| 0:0:03| spchol 1 1
24|0.430|0.383|9.8e-12|9.9e-11|9.9e-02|-4.949158e-01 -3.304545e-01| 0:0:03| spchol 1 1
25|0.375|0.370|6.1e-12|7.8e-11|1.0e-01|-7.059216e-01 -4.655456e-01| 0:0:03| spchol 1 1
26|0.298|0.374|4.3e-12|8.2e-11|1.2e-01|-9.702446e-01 -6.609429e-01| 0:0:03| spchol 1 1
27|0.250|0.310|3.2e-12|9.8e-11|1.6e-01|-1.311795e+00 -8.836440e-01| 0:0:03| spchol 1 1
28|0.298|0.331|2.3e-12|6.9e-11|2.0e-01|-1.795657e+00 -1.190024e+00| 0:0:03| spchol 1 1
29|0.362|0.332|1.4e-12|2.8e-11|2.4e-01|-2.391686e+00 -1.573347e+00| 0:0:03| spchol 1 1
30|0.356|0.366|9.3e-13|1.3e-11|3.0e-01|-2.965739e+00 -2.086286e+00| 0:0:03| spchol 1 1
31|0.241|0.395|7.0e-13|6.8e-12|4.1e-01|-3.472872e+00 -2.742704e+00| 0:0:03| spchol 1 1
32|0.172|0.350|5.8e-13|2.9e-12|5.7e-01|-3.896087e+00 -3.347834e+00| 0:0:03| spchol 1 1
33|0.406|0.435|3.5e-13|1.7e-12|5.6e-01|-4.703325e+00 -4.048021e+00| 0:0:03| spchol 1 1
34|0.585|0.526|1.4e-13|8.6e-13|5.0e-01|-5.202913e+00 -4.771168e+00| 0:0:03| spchol 1 1
35|0.850|0.730|2.1e-14|2.5e-13|2.8e-01|-5.449508e+00 -5.379634e+00| 0:0:03| spchol 1 1
36|1.000|0.909|6.2e-16|2.6e-14|6.1e-02|-5.582726e+00 -5.602916e+00| 0:0:03| spchol 1 1
37|1.000|0.999|8.5e-16|1.2e-15|1.4e-02|-5.607662e+00 -5.620228e+00| 0:0:03| spchol 1 1
38|0.938|0.949|4.0e-16|4.3e-16|1.9e-03|-5.615044e+00 -5.616740e+00| 0:0:03| spchol 1 1
39|1.000|1.000|1.3e-16|2.3e-16|7.9e-04|-5.615753e+00 -5.616471e+00| 0:0:04| spchol 1 1
40|1.000|1.000|3.2e-16|2.4e-16|9.8e-05|-5.616150e+00 -5.616240e+00| 0:0:04| spchol 1 1
41|1.000|1.000|1.1e-15|3.6e-16|3.1e-05|-5.616187e+00 -5.616215e+00| 0:0:04| spchol 1 1
42|1.000|1.000|3.5e-16|1.1e-16|5.6e-06|-5.616203e+00 -5.616208e+00| 0:0:04| spchol 1 1
43|1.000|1.000|3.9e-16|4.0e-16|1.7e-06|-5.616205e+00 -5.616207e+00| 0:0:04| spchol 1 1
44|1.000|1.000|7.4e-16|2.5e-16|3.2e-07|-5.616206e+00 -5.616207e+00| 0:0:04| spchol 1 1
45|1.000|1.000|3.3e-16|1.8e-16|8.7e-08|-5.616206e+00 -5.616206e+00| 0:0:04|
stop: max(relative gap, infeasibilities) < 1.49e-08

number of iterations = 45
primal objective value = -5.61620635e+00
dual objective value = -5.61620643e+00
gap := trace(XZ) = 8.69e-08
relative gap = 7.10e-09
actual relative gap = 6.46e-09
rel. primal infeas (scaled problem) = 3.32e-16
rel. dual " " " = 1.80e-16
rel. primal infeas (unscaled problem) = 0.00e+00
rel. dual " " " = 0.00e+00
norm(X), norm(y), norm(Z) = 1.8e+09, 4.3e+10, 4.3e+10
norm(A), norm(b), norm© = 4.5e+01, 1.0e+00, 2.8e+03
Total CPU time (secs) = 3.85
CPU time per iteration = 0.09
termination code = 0
DIMACS: 3.3e-16 0.0e+00 2.5e-16 0.0e+00 6.5e-09 7.1e-09


Status: Solved
Optimal value (cvx_optval): +4.10777e+10

itera =

 2

Calling SDPT3 4.0: 1802 variables, 800 equality constraints
For improved efficiency, SDPT3 is solving the dual problem.

num. of constraints = 800
dim. of sdp var = 1000, num. of sdp blk = 500
dim. of linear var = 302


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|3.8e+02|1.7e+01|1.5e+07| 6.777505e+04 0.000000e+00| 0:0:00| spchol 1 1
1|0.134|0.093|3.3e+02|1.6e+01|1.4e+07| 1.526396e+05 -8.377277e-03| 0:0:00| spchol 1 1
2|0.418|0.483|1.9e+02|8.1e+00|7.7e+06| 2.252083e+05 -4.114644e-02| 0:0:00| spchol 1 1
3|0.854|0.975|2.8e+01|2.0e-01|3.7e+05| 1.436224e+05 -5.378805e-02| 0:0:00| spchol 1 1
4|0.910|0.943|2.5e+00|1.2e-02|1.1e+05| 8.795691e+04 -1.718488e-01| 0:0:00| spchol 1 1
5|0.826|0.845|4.4e-01|1.8e-03|2.1e+04| 1.704401e+04 -2.033681e-01| 0:0:00| spchol 1 1
6|0.641|1.000|1.6e-01|8.6e-06|1.4e+04| 9.861937e+03 -7.015425e-01| 0:0:01| spchol 1 1
7|0.776|1.000|3.5e-02|4.3e-06|3.9e+03| 2.097115e+03 -8.720231e-01| 0:0:01| spchol 1 1
8|0.459|1.000|1.9e-02|5.5e-06|4.0e+03| 2.506888e+03 -2.052926e+00| 0:0:01| spchol 1 1
9|0.927|0.895|1.4e-03|2.9e-06|3.3e+02| 1.605849e+02 -2.049604e+00| 0:0:01| spchol 1 1
10|0.657|0.841|4.8e-04|1.2e-06|1.6e+02| 4.242482e+01 -2.940381e+00| 0:0:01| spchol 1 1
11|0.799|0.854|9.6e-05|6.0e-07|8.6e+01| 3.431763e+01 -3.767999e+00| 0:0:01| spchol 1 1
12|0.657|0.891|3.3e-05|2.4e-07|4.4e+01| 8.124735e+00 -3.533332e+00| 0:0:01| spchol 1 1
13|0.824|0.875|5.8e-06|1.3e-07|2.3e+01| 8.075750e+00 -2.807505e+00| 0:0:01| spchol 1 1
14|0.688|0.928|1.8e-06|5.3e-08|1.2e+01| 2.082004e+00 -1.655198e+00| 0:0:01| spchol 1 1
15|0.798|0.928|3.7e-07|2.8e-08|6.1e+00| 1.979070e+00 -9.551173e-01| 0:0:01| spchol 1 1
16|0.717|0.938|1.0e-07|1.3e-08|2.7e+00| 3.631850e-01 -4.702707e-01| 0:0:01| spchol 1 1
17|0.867|0.927|1.4e-08|6.6e-09|1.3e+00| 3.608247e-01 -3.149539e-01| 0:0:01| spchol 1 1
18|0.710|0.929|4.0e-09|2.9e-09|5.7e-01|-9.727886e-02 -2.522262e-01| 0:0:01| spchol 1 1
19|1.000|0.740|3.0e-18|1.7e-09|2.4e-01|-3.205157e-01 -3.016237e-01| 0:0:01| spchol 1 1
20|0.463|0.498|3.6e-18|9.0e-10|1.8e-01|-5.869210e-01 -4.538362e-01| 0:0:01| spchol 1 1
21|0.232|0.370|6.3e-18|5.7e-10|1.9e-01|-8.644142e-01 -6.531542e-01| 0:0:01| spchol 1 1
22|0.080|0.338|9.3e-18|3.8e-10|2.7e-01|-1.205835e+00 -9.632562e-01| 0:0:01| spchol 1 1
23|0.064|0.299|9.4e-18|2.7e-10|3.9e-01|-1.562284e+00 -1.330955e+00| 0:0:02| spchol 1 1
24|0.157|0.256|1.1e-17|2.0e-10|4.2e-01|-2.669054e+00 -1.759400e+00| 0:0:02| spchol 1 1
25|0.106|0.320|1.3e-17|1.4e-10|6.6e-01|-3.448103e+00 -2.575495e+00| 0:0:02| spchol 1 1
26|0.253|0.254|3.5e-17|1.2e-10|7.7e-01|-5.166639e+00 -3.316751e+00| 0:0:02| spchol 1 1
27|0.232|0.174|4.7e-17|1.0e-10|1.1e+00|-6.907352e+00 -4.033385e+00| 0:0:02| spchol 1 1
28|0.335|0.221|7.1e-17|8.3e-11|1.7e+00|-9.243299e+00 -5.160626e+00| 0:0:02| spchol 1 1
29|0.480|0.308|2.2e-16|7.9e-11|2.3e+00|-1.268101e+01 -7.052775e+00| 0:0:02| spchol 1 1
30|0.530|0.322|2.8e-16|7.5e-11|2.9e+00|-1.704537e+01 -9.545712e+00| 0:0:02| spchol 1 1
31|0.517|0.364|8.0e-16|8.9e-11|3.2e+00|-2.224288e+01 -1.313889e+01| 0:0:02|
sqlp stop: dual problem is suspected of being infeasible

number of iterations = 31
residual of dual infeasibility
certificate X = 1.13e-06
reldist to infeas. <= 9.38e-16
Total CPU time (secs) = 1.93
CPU time per iteration = 0.06
termination code = 2
DIMACS: 8.0e-16 0.0e+00 1.3e-10 0.0e+00 -2.5e-01 8.8e-02


Status: Infeasible
Optimal value (cvx_optval): -Inf

itera =

 3

Error + (line 83)
Disciplined convex programming error:
Illegal operation: {convex} - {invalid}

Error - (line 21)
z = plus( x, y, true, cheat );

Error test8 (line 41)
S=(((gama.^2)log2(exp(1)))./(2(gama+1))).*(gama1_inv -1./(gama));

what is wrong with my code or solver?thanks for your time and patience,thank you ,have a good day!

You have a numerically stable algorithm and problem data. The 2nd iteration was infeasible, therefore, the CVX variables were populated with NaN. An NaN was then input data to the next iteration, and CVX disallows that as “invalid”.

Crude implementations of SCA are precarious at best. You may be better off using a non-convex solver which is more sophisticated than crude SCA.

thank you Mark,but I am not familiar with non-convex solver ,could you give me some sugesstions?

FMINCON is an example.

Using YALMIP, you can call a variety of local or global non-convex solvers (you need to supply the solver though).

Hi, the same problem occurs to me. When the algorithm iterate several times, the CVX will show
Status: Infeasible , Optimal value (cvx_optval): -Inf
Have you solved it?

As you can read in my posts on this forum, SCA can be unreliable, and may not converge to anything. That can include problems becoming infeasible. Read my advice earlier in this thread.