# Optimization results for all variables are nan?

Hello, I’m new to cvx and I want to solve the following SDR problem, CVX does not report an error, but in the end all optimization results(W1, W2, W3, gamm) are NAN:

function [rate_tmp,W_tmp] = ISAC_sub1(h_matr,n_val,a_matr,R_min,p_max,rho,alpha_vec,beta_vec,N,W_bfrc)
W_bfr1 = W_bfrc(:,:,1);
W_bfr2 = W_bfrc(:,:,2);
W_bfr3 = W_bfrc(:,:,3);
N=N;
cvx_begin sdp quiet
variable W1(4,4) hermitian semidefinite
variable W2(4,4) hermitian semidefinite
variable W3(4,4) hermitian semidefinite
variable gamm(3)
maximize(sum(gamm)+a_matr(:,1)’*(W1+W2+W3)a_matr(:,1)+a_matr(:,2)’(W1+W2+W3)*a_matr(:,2));
subject to
log(n_val+real(trace(h_matr(:,1)*h_matr(:,1)’*W1))+real(trace(h_matr(:,1)*h_matr(:,1)’*W2))+real(trace(h_matr(:,1)*h_matr(:,1)’*W3)))/log(2)
-alpha_vec(1)-(real(trace(h_matr(:,1)h_matr(:,1)’(W2-W_bfr2)))+real(trace(h_matr(:,1)h_matr(:,1)’(W3-W_bfr3))))/beta_vec(1)-gamm(1) >= 0

``````            log(n_val+real(trace(h_matr(:,2)*h_matr(:,2)'*W1))+real(trace(h_matr(:,2)*h_matr(:,2)'*W2))+real(trace(h_matr(:,2)*h_matr(:,2)'*W3)))/log(2)
-alpha_vec(2)-(real(trace(h_matr(:,2)*h_matr(:,2)'*(W2-W_bfr2)))+real(trace(h_matr(:,2)*h_matr(:,2)'*(W3-W_bfr3))))/beta_vec(2)-gamm(1) >= 0

log(n_val+real(trace(h_matr(:,3)*h_matr(:,3)'*W1))+real(trace(h_matr(:,3)*h_matr(:,3)'*W2))+real(trace(h_matr(:,3)*h_matr(:,3)'*W3)))/log(2)
-alpha_vec(3)-(real(trace(h_matr(:,3)*h_matr(:,3)'*(W2-W_bfr2)))+real(trace(h_matr(:,3)*h_matr(:,3)'*(W3-W_bfr3))))/beta_vec(3)-gamm(1) >= 0

log(n_val+real(trace(h_matr(:,2)*h_matr(:,2)'*W2))+real(trace(h_matr(:,2)*h_matr(:,2)'*W3)))/log(2)
-alpha_vec(4)-(real(trace(h_matr(:,2)*h_matr(:,2)'*(W3-W_bfr3))))/beta_vec(4)-gamm(2) >= 0

log(n_val+real(trace(h_matr(:,3)*h_matr(:,3)'*W2))+real(trace(h_matr(:,3)*h_matr(:,3)'*W3)))/log(2)
-alpha_vec(5)-(real(trace(h_matr(:,3)*h_matr(:,3)'*(W3-W_bfr3))))/beta_vec(5)-gamm(2) >= 0

log(n_val+real(trace(h_matr(:,3)*h_matr(:,3)'*W3)))/log(2)
-alpha_vec(6)-gamm(3) >= 0
gamm(1)-R_min>=0
gamm(2)-R_min>=0
gamm(3)-R_min>=0
real(trace(W1)+trace(W2)+trace(W3)) <= p_max
cvx_end
W_tmp = zeros(N,N,3);
W_tmp(:,:,1) = W1;W_tmp(:,:,2) = W2;W_tmp(:,:,3) = W3;
rate_tmp = cvx_optval;
``````

end

where n_val is a scalar, h_matr is a 43 matrix and a_matr is a 42 matrix, W_bfr is a constant matrix of the same form as W1-W3.

I have checked the formatting of the optimization question and found no errors. This problem is a bit complicated, and its prototype is:

I would be very grateful if I can get your some guidance.

Remove `quiet` and re-run. Then you will see solver and CVX output. I presume either the solver failed, or the result is infeasible, or unbounded.

if CVX reports infeasible, all except for section 1 of https://yalmip.github.io/debugginginfeasible also apply to CVX.