Why does the optimal value become NaN sometimes?

Why does the optimal value become NaN sometimes? i had write the code as the paper shown


%E6%93%B7%E5%8F%962

My code

hat_p_lowr=0.0317;
%OP4
%declare
K=4;%K channel
N=4;%N  antenna
L=5;%distance between RX & TX
xi=10^-4%tolerence between 
nois_var_hk_2pow=0.1*(L^(-2.5));%W,0.1*(L^(-2.5)),if this unit is dbm
nois_var_ak_2pow=[1.0000e-10 1.0000e-10 1.0000e-10 1.0000e-10 ];
nois_var_dk_2pow=[1.0000e-08 1.0000e-08 1.0000e-08 1.0000e-08 ];
bar_r=[10 10 10 10];
P_T=10;
h_1=sqrt(nois_var_hk_2pow/2)*(randn(N,1)+1i*randn(N,1));
h_2=sqrt(nois_var_hk_2pow/2)*(randn(N,1)+1i*randn(N,1));
h_3=sqrt(nois_var_hk_2pow/2)*(randn(N,1)+1i*randn(N,1));
h_4=sqrt(nois_var_hk_2pow/2)*(randn(N,1)+1i*randn(N,1));
h_kk=cat(2,h_1 ,h_2 ,h_3, h_4)
 for n=1:4
    h_k{n}=h_kk(1:4 , n);
    n=n+1;
 end


cvx_begin

    variable FNNK_lowr(N,N,K) semidefinite; %c7
    variable rho_k_lowr(1,1,K) semidefinite;
%==========================
%combined lots of FNNK
Fkk_lowr=cat(2,FNNK_lowr);
    
    lowr=0
   for o_lowr=1:4
       Fk_lowr{o_lowr}=Fkk_lowr(1:4,o_lowr+3*lowr:4*o_lowr)
       lowr=lowr+1;
   end
   tr_ace_lowr=0
   for t=1:K
       tr_ace_lowr=tr_ace_lowr+trace(Fk_lowr{t})  
   end
%====================================    
%object function
    minimize( tr_ace_lowr )
%==================================== 
%Constraint 
subject to 
%c3
rho_k_lowr<=1;

%===================================================
%c5
       c5_left_hand_lowr = 0;
        for k = 1:K
            sum_5_lowr = 0;
            for j = 1:K
                if j ~= k  
                 sum_5_lowr = sum_5_lowr +  h_k{k}' * Fk_lowr{j} * h_k{k};
                end
            end      
            c5_left_hand_lowr = c5_left_hand_lowr - sum_5_lowr+ (h_k{k}' * Fk_lowr{k} * h_k{k}*inv_pos(bar_r(1)))
            c5_right_hand_lowr= nois_var_ak_2pow(1)+ ( nois_var_dk_2pow(1)*inv_pos(rho_k_lowr(k)) )
            real( c5_left_hand_lowr ) >=   c5_right_hand_lowr
        end
%===================================================   
%c10
    c10_left_hand_lowr = 0;
        for k = 1:K           
            sum_10_lowr = 0;
            for j = 1:K
                 sum_10_lowr= sum_10_lowr +  h_k{k}' * Fk_lowr{j} * h_k{k};
            end
            c10_left_hand_lowr = c10_left_hand_lowr + sum_10_lowr+nois_var_ak_2pow(1)
            c10_right_hand_lowr=hat_p_lowr*inv_pos(1-rho_k_lowr(k))  
           real(c10_left_hand_lowr)>=  c10_right_hand_lowr
        end     
cvx_end

Depending on the random numbers used for h_1, h_2, h_3, h_4, the problem may be either feasible or infeasible. If it is infeasible, the optimal value is NaN.

You should look at the status reported by CVX/. If the problem is infeasible, the final output from CVX is

Status: Infeasible
Optimal value (cvx_optval): +Inf

Maybe you should now concentrate on realistic inputs rather than random inputs, and see whether they result in feasible problems which are solved to optimality.

yes,you are right,the status is infeasible when the cvx_optval is +Inf
but the channel is a random,so i can’t just let the channel be a realistic (constant ) value.

By the way,no matter the status is Infeasible or feasible,the channel ,h1~h4, are all complex number,and i don’t think they are not something very different.

Also ,i found that if i change bar_r from 10 to 1010^-7,the status will become feasible everytime.But the bar_r should be 10 instead of 1010^-7.Because the bar_r is the SINR value ,and be written as 10 dB in the paper. The unit of all parameters are Watt,so i think i don’t need to change something about that 10dB