# Infeasible appears after one iteration

Hi everyone，I really need your help. I have an iterative program that consists of a objective function and several constraints. In the iterative program, there are some initial points that have to be updated in each iteration. In each of the iterations，they are derived and used in next iteration as given points. my code is solved as follows. After the first iteration, lines 11 to 16 will be commented out.

N = 3;
w = 0.5;
No = 10^(-3);
p_max = 3;
D = [210^(2),310^(2),410^(2)];
c = [8,10,10];
apha = 10^(-19);
f_max = 3
10^(2);
B = 10^(2);
h = [0.6,1.8,1];
% beita_i = [0.4,0.4,0.1];
% p_i = [1,1.5,2.5];
% phai_i = No./h./p_i + 0.1;
% R_i = log2(1+1./phai_i) - 0.1;
% miut_i = [B./D.*beita_i.*R_i];
% Et_i = p_i./miut_i;

[optval,R_i,beita_i,phai_i,p_i,miut_i,Et_i] = interation(N,w,D,B,No,h,c,apha,f_max,p_max,R_i,beita_i,phai_i,p_i,miut_i,Et_i);

function [cvx_optval,R,beita,phai,p,miut,Et] = interation(N,w,D,B,No,h,c,apha,f_max,p_max,R_i,beita_i,phai_i,p_i,miut_i,Et_i)
cvx_begin
variable lamda(N)
variable p(N)
variable beita(N)
variable f(N)
variable tao
variable A(N)
variable E(N)
variable miut(N)
variable miuc(N)
variable Et(N)
variable Ec(N)
variable R(N)
variable phai(N)

``````minimize(tao)
subject to
for i = 1:N
1*inv_pos(lamda(i)) + 1*inv_pos(miut(i)-lamda(i)) + 1*inv_pos(miuc(i)-lamda(i)) <= A(i);
2/B*D(i)*miut(i) + R(i)^2 + beita(i)^2 - (R_i(i)+beita_i(i))^2 - 2*(R_i(i)+beita_i(i))*(R(i)+beita(i)-R_i(i)-beita_i(i)) <= 0;
R(i) - log2(1+1/phai_i(i)) - (phai(i)-phai_i(i))/(log(2)*(phai_i(i)+phai_i(i)^2)) <= 0;
2*No/h(i) + p(i)^2 + phai(i)^2 - (p_i(i)+phai_i(i))^2 - 2*(phai_i(i)+p_i(i))*(p(i)-p_i(i)+phai(i)-phai_i(i)) <= 0;
miuc(i) - f(i)/(c(i)*D(i))  <= 0;
2*p(i) + miut(i)^2 + Et(i)^2 - (miut_i(i)+Et_i(i))^2 - 2*(miut_i(i)+Et_i(i))*(miut(i)-miut_i(i)+Et(i)-Et_i(i)) <= 0;
apha*c(i)*D(i)*f(i)*f(i) <= Ec(i);
end
w.*A + (1-w).*E <= tao;
Et + Ec <= E
lamda - miut <= 0;
lamda - miuc <= 0;
sum(beita) <= 1;
sum(f) <= f_max;
0 <= p < p_max;
0 <= lamda;
0 <= beita;
0 <= f;
cvx_end
``````

end

## The first iteration is successful with the following information： Calling SDPT3 4.0: 140 variables, 67 equality constraints For improved efficiency, SDPT3 is solving the dual problem.

num. of constraints = 67
dim. of sdp var = 60, num. of sdp blk = 30
dim. of linear var = 50

SDPT3: Infeasible path-following algorithms

## number of iterations = 20 primal objective value = -6.55321431e+01 dual objective value = -6.55321432e+01 gap := trace(XZ) = 1.60e-07 relative gap = 1.21e-09 actual relative gap = 1.04e-09 rel. primal infeas (scaled problem) = 4.39e-13 rel. dual " " " = 4.04e-14 rel. primal infeas (unscaled problem) = 0.00e+00 rel. dual " " " = 0.00e+00 norm(X), norm(y), norm(Z) = 1.7e+03, 1.6e+05, 1.6e+05 norm(A), norm(b), norm© = 1.9e+02, 2.0e+00, 9.4e+02 Total CPU time (secs) = 0.14 CPU time per iteration = 0.01 termination code = 0 DIMACS: 4.4e-13 0.0e+00 4.3e-14 0.0e+00 1.0e-09 1.2e-09

Status: Solved
Optimal value (cvx_optval): +65.5321

## And the second iteration shows infeasible： Calling SDPT3 4.0: 140 variables, 67 equality constraints For improved efficiency, SDPT3 is solving the dual problem.

num. of constraints = 67
dim. of sdp var = 60, num. of sdp blk = 30
dim. of linear var = 50

SDPT3: Infeasible path-following algorithms

## number of iterations = 25 residual of dual infeasibility certificate X = 1.28e-16 reldist to infeas. <= 1.32e-18 Total CPU time (secs) = 0.14 CPU time per iteration = 0.01 termination code = 2 DIMACS: 3.2e+01 0.0e+00 7.3e-03 0.0e+00 -1.0e+00 4.8e-03

Status: Infeasible
Optimal value (cvx_optval): +Inf