Warning: Matrix is close to singular or badly scaled. Results may be inaccurate

Sometimes, i run the following codes, this situation happens.

i have no idea to handle this problem,

Here, x and y are the (K,Nt) matrix, each component belongs to (0,1),

code is in the following,

power_allocation = 0 ;

cvx_begin quiet
  variables W(Nt,Nt,K,N_carrier) w(Nt,K,N_carrier)
  variables lambda(K,N_carrier) t(K,N_carrier)

 W_sum = sum(W,3) ;
 for i =1:K
   power_allocation = power_allocation + w(:,i,n)'*w(:,i,n) ;

maximize (sum(t(:,n)))
 subject to 
    for k=1:K
[eye(Nt); h_bar(:,k,n)']*(-(abs(x_feasible_point(k,n) )^2 )*W_sum(:,:,1,n) )*([eye(Nt)     ; h_bar(:,k,n)']') + [(lambda(k,n)*eye(Nt)),(x_feasible_point(k,n)')*w(:,k,n);x_feasible_point(k,n)*(w(:,k,n)'),(-lambda(k,n)*(error_radius(k,n)^2)-1-y_bar_old(k,n)*(t(k,n)-1)+entr(y_bar_old(k,n))-(abs(x_feasible_point(k,n))^2)*noise_power(k,n)+ 2*real((h_bar(:,k,n)'*w(:,k,n) )*(x_feasible_point(k,n)') ) )] == hermitian_semidefinite(Nt+1) ;

  [1,w(:,k,n)';w(:,k,n),W(:,:,k,n)] == hermitian_semidefinite(Nt+1) ;  
  lambda(k,n) >=0 ;  

power_max/N_carrier - power_allocation >= 0 ;


Can anyone give me a favor?

Thank you for your attention.

What happens if you try another solver?

I will say this: many wireless-related problems tend to have horrible scaling. Try to scale your variables so that all coefficients are in the range, say, 10^-5 to 10^5.

sorry, sir I,m confused that what;s the meaning of scaling all coefficients in the range? Does it likely set “variable lambda(K,N_carrier) banded(10^-5,10^5)”. Thank you.

What I mean is: look at your constants h_bar, x_feasible_point,noise_power, etc. If there is a very wide difference between the minimum and maximum values, you’re likely to have a problem. Numerical solvers can’t handle large dynamic range in coefficients.

I see, I will check it . Thank u very much.