This is my code and i am getting Nan output>…!!!

cvx_begin

cvx_solver sedumi

variable W(2*n,2*n) symmetric

variables f_obj(n,1) u(npv,1)

for i=1:n

f_obj(i,1)==trace(YYreal(:,:,i)*W);
end
minimize (1*(sum(u)+trace(YYreal(:,:,n)*W)))

subject to

for i=1:npq

trace(YYreal(:,:,i)*W)-(Pg(i,1)-Pl(i,1))==10^-7;

trace(YYimag(:,:,i)*W)-(Qg(i,1)-Ql(i,1))==10^-7;

end

for i=1:npv

trace(YYreal(:,:,i+npq)*W)-(u(i,1)-Pl(i+npq,1))==10^-7;

end

trace(YYreal(:,:,n)*W)+Pl(n,1)>=0

sum(u)>=0

W==semidefinite(2*n);

W>=0;

cvx_end