# Unbounded problem

cvx_begin
variable w2(Nt2,cluster2)
variables x2(usertotal2,1) y2(usertotal2,1)
expressions U(usertotal1,1) MSE1(cluster1,1) MMSE1(cluster1,1)
expressions W2(Nt2,Nt2,cluster2) F2(Nt2,Nt2,cluster2,user2) G2(Nt2,usertotal2) X2(Nt2,Nt2,cluster2,user2) Y2(Nt2,Nt2,cluster2,user2) Z2(Nt2,Nt2,cluster2,user2) C2(Nt2,Nt2,cluster2,user2) T2(Nt2,Nt2,cluster2,user2) t2(Nt2,usertotal2) O(usertotal2,1) w22(cluster2,1) MSE2(cluster2,1) s2(usertotal2,1) wm2(Nt2,cluster2-1) MMSE2(cluster2,1) SUM(Nt1,Nt1)

``````    for l=1:cluster2
w22(l)=pow_pos(norm(w2(:,l)),2);
W2(:,:,l)=2*real(wStart2(:,l)*(w2(:,l)-wStart2(:,l))')+wStart2(:,l)*wStart2(:,l)';
end
for m=1:cluster1
for n=1:user1
wm1=[w1(:,1:m-1),w1(:,m+1:cluster1)];
U((m-1)*user1+n)=(pow_abs(h1(:,(m-1)*user1+n)'*w1(:,m),2)+sigma1^2*pow_pos(norm(w1(:,m)),2))*(a1(m,n)+eta1*sum(a1(m,n+1:user1))+sum(a1(m,1:n-1)))+pow_pos(norm(h1(:,(m-1)*user1+n)'*wm1),2)+sigma1^2*(sum(w11(1:m-1))+sum(w11(m+1:cluster1)))+trace(diag(f1(:,(m-1)*user1+n)')*A*diag(f1(:,(m-1)*user1+n))*sum(W2,3))+1;
MSE1((m-1)*user1+n)=v1((m-1)*user1+n)*v1((m-1)*user1+n)'*U((m-1)*user1+n)+1-2*sqrt(a1(m,n))*real(v1((m-1)*user1+n)'*w1(:,m)'*h1(:,(m-1)*user1+n));
MMSE1((m-1)*user1+n)=real(beta1((m-1)*user1+n))*MSE1((m-1)*user1+n);
end
end
for l=1:cluster2
for s=1:user2
wm2=[w2(:,1:l-1),w2(:,l+1:cluster2)];
O((l-1)*user2+s)=trace(diag(f2(:,(l-1)*user2+s))*A*diag(f2(:,(l-1)*user2+s))'*W2(:,:,l))*(a2(l,s)+eta2*sum(a2(l,s+1:user2))+sum(a2(l,1:s-1)))+trace(diag(f2(:,(l-1)*user2+s))*A*diag(f2(:,(l-1)*user2+s))'*(sum(W2,3)-W2(:,:,l)))+(l==1)*(pow_pos(norm(h2(:,(l-1)*user2+s)'*w1),2)+sigma1^2*sum(w11))+1;
MSE2((l-1)*user2+s)=v2((l-1)*user2+s)*v2((l-1)*user2+s)'*O((l-1)*user2+s)+1-2*real(sqrt(a2(l,s))*exp(-sigma2^2/2)*w2(:,l)'*f2(:,(l-1)*user2+s)*v2((l-1)*user2+s)');
MMSE2((l-1)*user2+s)=real(beta2((l-1)*user2+s))*MSE2((l-1)*user2+s);
C2(:,:,l,s)=diag(f2(:,(l-1)*user2+s))'*((a2(l,s)/gamma2-(eta2*sum(a2(l,s+1:user2))+sum(a2(l,1:s-1))))*W2(:,:,l)-(sum(W2,3)-W2(:,:,l)))*diag(f2(:,(l-1)*user2+s));
X2(:,:,l,s)=real(C2(:,:,l,s));
Y2(:,:,l,s)=imag(C2(:,:,l,s));
for i=1:Nt2
for j=1:Nt2
if i==j
F2(i,j,l,s)=sigma2^2*(X2(i,j,l,s)-sum(X2(i,:,l,s)));
else
F2(i,j,l,s)=sigma2^2*X2(i,j,l,s);
end
end
end
for j=1:Nt2
G2(j,(l-1)*user2+s)=sigma2*sum(Y2(j,:));
end
t2(:,(l-1)*user2+s)=G2(:,(l-1)*user2+s);
s2((l-1)*user2+s)=sum(sum(C2(:,:,l,s)))-norm(htotal2(:,(l-1)*user2+s)'*w1)^2-1;
end
end
``````

minimize( real(sum(MMSE1))+real(sum(MMSE2)) )

cvx_end

Status: Failed
Optimal value (cvx_optval): NaN

I delete the constraints, but the result is NaN.
However I got the value of objective function which was a real value not NaN. Why did this happen?
real(sum(MMSE1))+real(sum(MMSE2))

ans =

-32.0468

The problem is reported as being unbounded. Try following the advice at https://yalmip.github.io/debuggingunbounded/

thank you very much！

stop: progress is too slow
Status: Failed
Optimal value (cvx_optval): NaN

I delete the constraints, but the result is NaN.
However I got the value of objective function which was a real value not NaN. Why did this happen?
real(sum(MMSE1))+real(sum(MMSE2))

ans =

-32.0468

Please show a coherent combination of all solver and CVX output and result, so we know what goes with what.

You can also try specifying a different solver.

cvx_begin
variable w2(Nt2,cluster2)
variables x2(usertotal2,1) y2(usertotal2,1)
expressions U(usertotal1,1) MSE1(cluster1,1) MMSE1(cluster1,1)
expressions W2(Nt2,Nt2,cluster2) C2(Nt2,Nt2,cluster2,user2) t2(Nt2,usertotal2) O(usertotal2,1) w22(cluster2,1) MSE2(cluster2,1) s2(usertotal2,1) wm2(Nt2,cluster2-1) MMSE2(cluster2,1)

``````    for l=1:cluster2
w22(l)=pow_pos(norm(w2(:,l)),2);
W2(:,:,l)=2*real(wStart2(:,l)*(w2(:,l)-wStart2(:,l))')+wStart2(:,l)*wStart2(:,l)';
end
for m=1:cluster1
for n=1:user1
wm1=[w1(:,1:m-1),w1(:,m+1:cluster1)];
U((m-1)*user1+n)=(pow_abs(h1(:,(m-1)*user1+n)'*w1(:,m),2)+sigma1^2*pow_pos(norm(w1(:,m)),2))*(a1(m,n)+eta1*sum(a1(m,n+1:user1))+sum(a1(m,1:n-1)))+pow_pos(norm(h1(:,(m-1)*user1+n)'*wm1),2)+sigma1^2*(sum(w11(1:m-1))+sum(w11(m+1:cluster1)))+trace(diag(f1(:,(m-1)*user1+n)')*A*diag(f1(:,(m-1)*user1+n))*sum(W2,3))+1;
MSE1((m-1)*user1+n)=v1((m-1)*user1+n)*v1((m-1)*user1+n)'*U((m-1)*user1+n)+1-2*sqrt(a1(m,n))*real(v1((m-1)*user1+n)'*w1(:,m)'*h1(:,(m-1)*user1+n));
MMSE1((m-1)*user1+n)=real(beta1((m-1)*user1+n))*MSE1((m-1)*user1+n);
end
end
for l=1:cluster2
for s=1:user2
wm2=[w2(:,1:l-1),w2(:,l+1:cluster2)];
O((l-1)*user2+s)=trace(diag(f2(:,(l-1)*user2+s))*A*diag(f2(:,(l-1)*user2+s))'*W2(:,:,l))*(a2(l,s)+eta2*sum(a2(l,s+1:user2))+sum(a2(l,1:s-1)))+trace(diag(f2(:,(l-1)*user2+s))*A*diag(f2(:,(l-1)*user2+s))'*(sum(W2,3)-W2(:,:,l)))+(l==1)*(pow_pos(norm(h2(:,(l-1)*user2+s)'*w1),2)+sigma1^2*sum(w11))+1;
MSE2((l-1)*user2+s)=v2((l-1)*user2+s)*v2((l-1)*user2+s)'*O((l-1)*user2+s)+1-2*real(sqrt(a2(l,s))*exp(-sigma2^2/2)*w2(:,l)'*f2(:,(l-1)*user2+s)*v2((l-1)*user2+s)');
MMSE2((l-1)*user2+s)=real(beta2((l-1)*user2+s))*MSE2((l-1)*user2+s);
aAux((l-1)*user2+s)=1+(l==1)*(pow_pos(norm(h2(:,(l-1)*user2+s)'*w1),2)+sigma1^2*sum(w11));
C2(:,:,l,s)=diag(f2(:,(l-1)*user2+s))'*((a2(l,s)/gamma2-(eta2*sum(a2(l,s+1:user2))+sum(a2(l,1:s-1))))*W2(:,:,l)-(sum(W2,3)-W2(:,:,l)))*diag(f2(:,(l-1)*user2+s));
end
end
``````

minimize( real(sum(MMSE1)) )
subject to
for l=1:cluster2
for s=1:user2
norm(Gvec(C2(:,:,l,s)’))<=(1/b2)(sqrt(b2^2+1)*real(trace(C2(:,:,l,s)*A))-aAux((l-1)*user2+s)/sqrt(b2^2+1));
end
end
cvx_end

I juss change the constraints and get the details below.

## Calling SDPT3 4.0: 2100 variables, 44 equality constraints For improved efficiency, SDPT3 is solving the dual problem.

num. of constraints = 44
dim. of sdp var = 4, num. of sdp blk = 2
dim. of socp var = 2086, num. of socp blk = 6
dim. of linear var = 8

SDPT3: Infeasible path-following algorithms

## number of iterations = 31 residual of dual infeasibility certificate X = 1.28e-09 reldist to infeas. <= 1.59e-11 Total CPU time (secs) = 4.44 CPU time per iteration = 0.14 termination code = 2 DIMACS: 8.8e+10 0.0e+00 1.8e-01 0.0e+00 -1.0e+00 1.0e-02

Status: Infeasible
Optimal value (cvx_optval): +Inf

SDPT3 is not so good at infeasible problems. I would try Mosek or SeDuMi to see if they agree.

So should I download the Mosek or SeDuMi package? or they are included in CVX ?

SeDuMi is included with CVX. You can insrruct CVX to use it via `cvx_solver`. Mosek requires separate license.

thank you！
And I wondered that the case showed below was related to the initial setting? or the problem

## number of iterations = 26 primal objective value = -1.16304491e+01 dual objective value = -6.74717895e+00 gap := trace(XZ) = 6.53e-01 relative gap = 3.37e-02 actual relative gap = -2.52e-01 rel. primal infeas (scaled problem) = 1.44e-09 rel. dual " " " = 4.87e-05 rel. primal infeas (unscaled problem) = 0.00e+00 rel. dual " " " = 0.00e+00 norm(X), norm(y), norm(Z) = 4.0e+05, 2.6e+00, 2.4e+00 norm(A), norm(b), norm© = 1.1e+01, 5.0e+00, 1.0e+00 Total CPU time (secs) = 0.36 CPU time per iteration = 0.01 termination code = -5 DIMACS: 3.6e-09 0.0e+00 5.0e-05 0.0e+00 -2.5e-01 3.4e-02

Status: Failed
Optimal value (cvx_optval): NaN

Thh solver ran into numerical difficulty. Perhaps a different solver will do better. It may be that the scaling of your problem is bad, and the solver would work better if you changed the units in your problem to make the coefficients closer to 1 in magnitude (i.e., no very large or small exponents).