# 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:

γ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

## 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

## 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.