I have constrained variables are non-negative. But the solution contains the negative solutions. Why?
My code is
cvx_begin
variable x(N);
expression SINR(N);
expression R(N);
for n=1:N
intra_interf=0;
inter_interf=0;
intra_interf=sum(H_intra(k,:,n).*p(:,n)');
inter_interf=p_cellular(n)*H_inter(k,n);
SINR(n)=x(n)/(eta*(intra_interf+inter_interf+N0));
R(n)=log(1+SINR(n))/log(2);
end
minimize sum(theta.*x);
subject to
sum(R)>=QoS_D2D(k);
x>=0;
cvx_end;