Why is the CVX status random after each program run?

The status of CVX randomly appears as one of the four states failed, Inaccurate/Solved ,solved,infeasible after each run of my program, and sometimes the following error occurs when running iteratively.

M=4; % BS
N1=30;%IRS
N = 10:10:N1;
Z=1;%zu
K = 3;% number of users in each group
B=1; %1MHz
R_min=0.01;%rate_min
E_min=5;%energy_min
sigma = 10^((-60-10) / 10); % AWGN
tao=0.9*ones(K,1);%TS factor
P_max=5; % W (1W=30dBm)
P_c=0.01;%circuit
miu=0.6;%energy conversion efficiency
eta=0.7;%Energy Harvesting
Rican_BI = 10^(1/10);
% Rican_IU = 10^(-3/10);
C0 = 10^(-30/10);%1m path loss,db
lambda0=0.1;
Afa_0=zeros(K,1);%Taylor expansion point
Bta_0=zeros(K,1);
KK = 1;
%% Simulation loop %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
max_iter = 5;
SimTimes = 2;
ii=length(N);
for jj=1:ii
for ss=1:SimTimes
[bu,iu,bi]=distance(K);

lambda_bi = C0*bi^-2.0;
lambda_bu = C0.*bu.^-2.2;
lambda_iu = C0.*iu.^-3;    
hd = repmat(sqrt(lambda_bu./2)',M,1).*(randn(M,K) + 1i*randn(M,K))*10^4;
hr = repmat(sqrt(lambda_iu./2)',N(jj),1).*(randn(N(jj),K) + 1i.*randn(N(jj),K))*10^4;
G  = sqrt(Rican_BI/(1+Rican_BI))+sqrt(1/(1+Rican_BI)).*sqrt(lambda_bi/2).*(randn(N(jj),M) + 1i.*randn(N(jj),M));  
hd_cope(jj,ss,:,:)=[hd];
hr_cope(jj,ss,:,:)=[hr;zeros(N1-N(jj),K)];
G_cope(jj,ss,:,:)=[G;zeros(N1-N(jj),M)];
v =exp(1j*(rand(N(jj),1)*2*pi)); %v=randn(N(jj),1) + 1i.*randn(N(jj),1); 
h_total= hr.'*diag(v')*G+hd.';
v_1=[v;1];
V_0=v_1*v_1';
G_k=ones(N(jj)+1,M,K);

for k=1:K
G_k(:,:,k)=[diag(hr(:,k)’)*G ;hd(:,k)’];
end
V_0=ones(N(jj)+1,N(jj)+1);
iter = 1;
%%%%%%%%%%% Optimize W
while(iter<max_iter) %

cvx_begin sdp quiet
variable Afa(K)
variable Bta(K)
variable S(K)
variable W(M,M,K) hermitian semidefinite
expression W_all(M,M)
expression Eh_all(K)
expression rho(K)
expression power0(K)
expression sumrate(K)
expression etal(K)
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
W_all(:,:)=W(:,:,1);
for k =2:K
W_all(:,:slight_smile: = W_all(:,:)+W(:,:,k);
end
for k=1:K
for i = 1:K
rho(k) =real(trace(V_0G_k(:,:,k)(W_all-W(:,:,i))G_k(:,:,k)’))+sigma;
etal(k)=real(trace(G_k(:,:,k)'V_0G_k(:,:,k)
(W_all-W(:,:,i))));
end
end
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% Object function
for k=1:K
Eh_all(k)=eta*(1-tao(k))real(trace(V_0G_k(:,:,k)W_allG_k(:,:,k)’));
end
for k =1:K
sumrate(k)=Btao(k)log(1+S(k))/log(2);
end
for k = 1:K
power0(k)=miu
trace(W(:,:,k));
end
F_q = sum(sumrate)- lambda0
(sum(power0) + P_c - sum(Eh_all)); %Energy Efficiency
maximize F_q

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% Constraint
subject to
real(trace(W_all))<=P_max; %19e
for k = 1:K
real(trace(V_0G_k(:,:,k)W_allG_k(:,:,k)’))>=rho(k)(2^(R_min/(Btao(k)))-1);%19c
(1-tao(k))etareal(trace(V_0
G_k(:,:,k)W_allG_k(:,:,k)’))>=E_min; %19d
end
for k = 1:K
real(trace(G_k(:,:,k)'V_0G_k(:,:,k)W(:,:,k)))-exp(Afa(k)+Bta(k))-sigmaexp(Bta(k))>=0;%21a
exp(Bta_0(k))+ exp(Bta_0(k))Bta(k)-exp(Bta_0(k))Bta_0(k)>=S(k); %22d
exp(Afa_0(k))+ exp(Afa_0(k))Afa(k)-exp(Afa_0(k))Afa_0(k)>=etal(k); %22c
end
cvx_end
W_opt = W;
Afa_0 = Afa;
Bta_0 = Bta;
iter = iter + 1;
end
%%%%%%%%%%%optimize tao
end
end
end!
第1轮一阶段第1次
CVX Warning:
** Models involving “log” or other functions in the log, exp, and entropy

** family are solved using an experimental successive approximation method.

** This method is slower and less reliable than the method CVX employs for**
** other models. Please see the section of the user’s guide entitled**
** The successive approximation method**
** for more details about the approach, and for instructions on how to**
** suppress this warning message in the future.**


Successive approximation method to be employed.
** SDPT3 will be called several times to refine the solution.**
** Original size: 88 variables, 25 equality constraints**
** 9 exponentials add 72 variables, 45 equality constraints**

Cones | Errors |
Mov/Act | Centering Exp cone Poly cone | Status
--------±--------------------------------±--------
7/ 7 | 8.000e+00 7.079e+00 0.000e+00 | Solved
6/ 6 | 7.395e-01 3.657e-02 0.000e+00 | Inaccurate/Solved
5/ 5 | 3.645e-02 8.670e-05 0.000e+00 | Solved
0/ 0 | 0.000e+00 0.000e+00 0.000e+00 | Solved

Status: Solved
Optimal value (cvx_optval): +137.384

Successive approximation method to be employed.
SDPT3 will be called several times to refine the solution.
Original size: 88 variables, 25 equality constraints
9 exponentials add 72 variables, 45 equality constraints

Cones | Errors |
Mov/Act | Centering Exp cone Poly cone | Status
--------±--------------------------------±--------
7/ 7 | 8.000e+00 1.200e+01 0.000e+00 | Solved
6/ 6 | 1.278e+00 9.934e-02 0.000e+00 | Solved
5/ 5 | 8.364e-02 4.381e-04 0.000e+00 | Solved
2/ 2 | 2.342e-03 2.098e-07 0.000e+00 | Solved
0/ 0 | 0.000e+00 0.000e+00 0.000e+00 | Solved

Status: Solved
Optimal value (cvx_optval): +148.205

Successive approximation method to be employed.
SDPT3 will be called several times to refine the solution.
Original size: 88 variables, 25 equality constraints
9 exponentials add 72 variables, 45 equality constraints

Cones | Errors |
Mov/Act | Centering Exp cone Poly cone | Status
--------±--------------------------------±--------
7/ 7 | 8.000e+00 1.454e+01 0.000e+00 | Solved
6/ 6 | 2.241e+00 2.990e-01 0.000e+00 | Solved
6/ 6 | 1.836e-01 2.116e-03 0.000e+00 | Solved
3/ 3 | 3.266e-03 6.902e-07 0.000e+00 | Solved
0/ 0 | 0.000e+00 0.000e+00 0.000e+00 | Solved

Status: Solved
Optimal value (cvx_optval): +149.4

Successive approximation method to be employed.
SDPT3 will be called several times to refine the solution.
Original size: 88 variables, 25 equality constraints
9 exponentials add 72 variables, 45 equality constraints

Cones | Errors |
Mov/Act | Centering Exp cone Poly cone | Status
--------±--------------------------------±--------
7/ 7 | 8.000e+00 1.774e+01 0.000e+00 | Solved
6/ 6 | 3.339e+00 6.471e-01 0.000e+00 | Solved
5/ 6 | 3.484e-01 7.640e-03 0.000e+00 | Solved
3/ 3 | 2.561e-03 3.562e-07 0.000e+00 | Solved
0/ 0 | 0.000e+00 0.000e+00 0.000e+00 | Solved

Status: Solved
Optimal value (cvx_optval): +150.683

第1轮一阶段第2次

Successive approximation method to be employed.
SDPT3 will be called several times to refine the solution.
Original size: 88 variables, 25 equality constraints
9 exponentials add 72 variables, 45 equality constraints

Cones | Errors |
Mov/Act | Centering Exp cone Poly cone | Status
--------±--------------------------------±--------
7/ 7 | 8.000e+00 2.488e+01 0.000e+00 | Solved
6/ 6 | 5.806e+00 1.846e+00 0.000e+00 | Solved
6/ 6 | 1.206e+00 9.306e-02 0.000e+00 | Solved
5/ 5 | 3.210e-02 7.934e-05 0.000e+00 | Solved
0/ 0 | 0.000e+00 0.000e+00 0.000e+00 | Solved

Status: Solved
Optimal value (cvx_optval): +787.582

Successive approximation method to be employed.
SDPT3 will be called several times to refine the solution.
Original size: 88 variables, 25 equality constraints
9 exponentials add 72 variables, 45 equality constraints

Cones | Errors |
Mov/Act | Centering Exp cone Poly cone | Status
--------±--------------------------------±--------
7/ 7 | 8.000e+00 4.052e+01 0.000e+00 | Solved
6/ 6 | 8.000e+00 4.286e+00 0.000e+00 | Solved
4/ 4 | 1.288e+00 1.064e-01 0.000e+00 | Inaccurate/Solved
3/ 3 | 3.908e-02 9.483e-05 0.000e+00 | Inaccurate/Solved
0/ 0 | 0.000e+00 0.000e+00 0.000e+00 | Inaccurate/Solved
0/ 0 | 0.000e+00 0.000e+00 0.000e+00 | Inaccurate/Solved
0/ 0 | 0.000e+00 0.000e+00 0.000e+00 | Solved

Status: Solved
Optimal value (cvx_optval): +791.023

Successive approximation method to be employed.
SDPT3 will be called several times to refine the solution.
Original size: 88 variables, 25 equality constraints
9 exponentials add 72 variables, 45 equality constraints

Cones | Errors |
Mov/Act | Centering Exp cone Poly cone | Status
--------±--------------------------------±--------
7/ 7 | 8.000e+00 4.737e+01 0.000e+00 | Solved
6/ 6 | 8.000e+00 5.688e+00 0.000e+00 | Inaccurate/Solved
2/ 2 | 4.435e-01 1.175e-02 0.000e+00 | Inaccurate/Solved
0/ 0 | 0.000e+00 0.000e+00 0.000e+00 | Inaccurate/Solved
2/ 2 | 2.205e-02 2.972e-05 0.000e+00 | Solved
0/ 0 | 0.000e+00 0.000e+00 0.000e+00 | Inaccurate/Solved
0/ 0 | 0.000e+00 0.000e+00 0.000e+00 | Inaccurate/Solved

Status: Inaccurate/Solved
Optimal value (cvx_optval): +792.508

Successive approximation method to be employed.
SDPT3 will be called several times to refine the solution.
Original size: 88 variables, 25 equality constraints
9 exponentials add 72 variables, 45 equality constraints

Cones | Errors |
Mov/Act | Centering Exp cone Poly cone | Status
--------±--------------------------------±--------
7/ 7 | 8.000e+00 5.563e+01 0.000e+00 | Solved
7/ 7 | 8.000e+00s 7.485e+00 0.000e+00 | Solved
4/ 4 | 5.780e-01 2.063e-02 0.000e+00 | Inaccurate/Solved
1/ 1 | 2.063e-02 2.595e-06 0.000e+00 | Inaccurate/Solved
0/ 0 | 0.000e+00 0.000e+00 0.000e+00 | Inaccurate/Solved
0/ 0 | 0.000e+00 0.000e+00 0.000e+00 | Inaccurate/Solved
0/ 0 | 0.000e+00 0.000e+00 0.000e+00 | Inaccurate/Solved

Status: Inaccurate/Solved
Optimal value (cvx_optval): +794.061

第1次迭代历时 30.669213 秒。
第2轮一阶段第1次

Successive approximation method to be employed.
SDPT3 will be called several times to refine the solution.
Original size: 88 variables, 25 equality constraints
9 exponentials add 72 variables, 45 equality constraints

Cones | Errors |
Mov/Act | Centering Exp cone Poly cone | Status
--------±--------------------------------±--------
7/ 7 | 8.000e+00 6.663e+01 0.000e+00 | Solved
7/ 7 | 8.000e+00s 1.027e+01 0.000e+00 | Inaccurate/Solved
3/ 3 | 1.872e+00 2.102e-01 0.000e+00 | Inaccurate/Solved
1/ 1 | 1.285e-01 6.128e-04 0.000e+00 | Inaccurate/Solved
0/ 0 | 0.000e+00 0.000e+00 0.000e+00 | Inaccurate/Solved
0/ 0 | 0.000e+00 0.000e+00 0.000e+00 | Inaccurate/Solved
0/ 0 | 0.000e+00 0.000e+00 0.000e+00 | Inaccurate/Solved

Status: Inaccurate/Solved
Optimal value (cvx_optval): +1208.5

Successive approximation method to be employed.
SDPT3 will be called several times to refine the solution.
Original size: 88 variables, 25 equality constraints
9 exponentials add 72 variables, 45 equality constraints

Cones | Errors |
Mov/Act | Centering Exp cone Poly cone | Status
--------±--------------------------------±--------
7/ 7 | 8.000e+00 8.390e+01 0.000e+00 | Solved
6/ 6 | 8.000e+00 1.406e+01 0.000e+00 | Inaccurate/Solved
2/ 2 | 3.329e+00 6.430e-01 0.000e+00 | Inaccurate/Solved
1/ 1 | 3.330e-01 6.749e-03 0.000e+00 | Inaccurate/Solved
0/ 0 | 0.000e+00 0.000e+00 0.000e+00 | Inaccurate/Solved
0/ 0 | 0.000e+00 0.000e+00 0.000e+00 | Inaccurate/Solved
0/ 0 | 0.000e+00 0.000e+00 0.000e+00 | Inaccurate/Solved

Status: Inaccurate/Solved
Optimal value (cvx_optval): +1210.38

Successive approximation method to be employed.
SDPT3 will be called several times to refine the solution.
Original size: 88 variables, 25 equality constraints
9 exponentials add 72 variables, 45 equality constraints

Cones | Errors |
Mov/Act | Centering Exp cone Poly cone | Status
--------±--------------------------------±--------
7/ 7 | 8.000e+00 9.711e+01 0.000e+00 | Solved
7/ 7 | 8.000e+00s 1.728e+01 0.000e+00 | Inaccurate/Solved
2/ 2 | 4.487e+00 1.137e+00 0.000e+00 | Inaccurate/Solved
1/ 1 | 5.590e-01 1.962e-02 0.000e+00 | Inaccurate/Solved
0/ 0 | 0.000e+00 0.000e+00 0.000e+00 | Inaccurate/Solved
0/ 0 | 0.000e+00 0.000e+00 0.000e+00 | Inaccurate/Solved
0/ 0 | 0.000e+00 0.000e+00 0.000e+00 | Inaccurate/Solved

Status: Inaccurate/Solved
Optimal value (cvx_optval): +1211.71

Successive approximation method to be employed.
SDPT3 will be called several times to refine the solution.
Original size: 88 variables, 25 equality constraints
9 exponentials add 72 variables, 45 equality constraints

Cones | Errors |
Mov/Act | Centering Exp cone Poly cone | Status
--------±--------------------------------±--------
7/ 7 | 8.000e+00 1.114e+02 0.000e+00 | Inaccurate/Solved
7/ 7 | 8.000e+00s 2.068e+01 0.000e+00 | Inaccurate/Solved
1/ 1 | 1.289e-01 9.551e-04 0.000e+00 | Failed
3/ 3 | 8.000e+00 1.800e+01 0.000e+00 | Failed
5/ 5 | 5.569e+00 1.705e+00 0.000e+00 | Failed
3/ 3 | 8.350e-01 4.387e-02 0.000e+00 | Failed
0/ 0 | 0.000e+00 0.000e+00 0.000e+00 | Failed
0/ 0 | 0.000e+00 0.000e+00 0.000e+00 | Failed

Status: Failed
Optimal value (cvx_optval): NaN

第2轮一阶段第2次

Successive approximation method to be employed.
SDPT3 will be called several times to refine the solution.
Original size: 88 variables, 25 equality constraints
9 exponentials add 72 variables, 45 equality constraints

Cones | Errors |
Mov/Act | Centering Exp cone Poly cone | Status
--------±--------------------------------±--------
9/ 9 | 8.000e+00 1.075e+02 0.000e+00 | Solved
0/ 0 | 0.000e+00 0.000e+00 0.000e+00 | Infeasible

Status: Infeasible
Optimal value (cvx_optval): -Inf


错误使用 . (第 173 行)*
Disciplined convex programming error:
** Cannot perform the operation: {invalid} .* {real affine}**

出错 * (第 36 行)
** z = feval( oper, x, y );**

出错 main_2 (第 121 行)
** exp(Bta_0(k))+ exp(Bta_0(k))Bta(k)-exp(Bta_0(k))Bta_0(k)>=S(k); %22d

First, try to make sure the input data has good scaling. Then follow the advice at CVXQUAD: How to use CVXQUAD's Pade Approximant instead of CVX's unreliable Successive Approximation for GP mode, log, exp, entr, rel_entr, kl_div, log_det, det_rootn, exponential cone. CVXQUAD's Quantum (Matrix) Entropy & Matrix Log related functions