Infeasible and result NaN problem

Hi there,

I am now doing a trajectory optimization problem. The original problem is as follows:

Here in my problem M=2, q_j^r is the updated trajectories from last iteration. I want to optimize the trajectory q_j. My codes are as follows:

``````    A_r = zeros(K,N,M);
``````
``````    B_r = zeros(K,N,M);
temp_trj = zeros(K,N,M);
for k = 1:K
for n = 1:N
for m = 1:M
A_r(k,n,m) = P(1,n,m)*rho_0/((d(k,n,m))^2)^2*log2(exp(1))/(sum(P(1,n,:)*rho_0./(d(k,n,:)).^2, 3) + sigma_2);
B_r(k,n,m) = log2(sum(P(1,n,:)*rho_0./(d(k,n,:)).^2, 3) + sigma_2);
% temp_trj(k,n,m) = P(1,n,m)*rho_0/(H^2 + d(k,n,m)^2);
end
end
end

for k = 1:K
for n = 1:N
temp_trj(k,n,1) = P(1,n,2)*rho_0/d(k,n,2)^2;
temp_trj(k,n,2) = P(1,n,1)*rho_0/d(k,n,1)^2;
end
end
``````

S_max = V_max*T/N;

``````    cvx_begin
``````
``````        variables Q(2,N,M)
variable eta_r
maximize eta_r
subject to
for k = 1:K
%(1/N)*sum(sum(a(k,:,:).*(repmat(sum(-A_r(k,:,:).*(pow_pos(norms(Q - repmat(User_pos(:,k), 1, N, M), 2), 2) - pow_pos(norms(q - repmat(User_pos(:,k), 1, N, M), 2), 2)), 3),1,1,M) - log(temp_trj(k,:,:) + sigma_2)/log(2) + B_r(k,:,:)), 3), 2) >= eta_r;
(1/N)*sum(sum(a(k,:,:).*(repmat(sum(-A_r(k,:,:).*(pow_pos(norms(Q - repmat(User_pos(:,k), 1, N, M), 2), 2) - pow_pos(norms(q - repmat(User_pos(:,k), 1, N, M), 2), 2)), 3),1,1,M) - (-rel_entr(1, temp_trj(k,:,:) + sigma_2))/(-rel_entr(1, 2)) + B_r(k,:,:)), 3), 2) >= eta_r;
for n = 1:N
for m = 1:M
pow_pos(norm(Q(:,n,m) - User_pos(:,k),2),2) <= pow_pos(norm(q(:,n,m) - User_pos(:,k),2),2) + 2*(q(:,n,m) - User_pos(:,k))'*(Q(:,n,m) - q(:,n,m));
end
end

end

for m = 1:M
Q(:,1,m) == Q(:,N,m);
for n = 1:N-1
pow_pos(norm(Q(:,n+1,m) - Q(:,n,m), 2), 2) <= S_max^2;
end
end

for n = 1:N
d_min^2 <= -pow_pos(norm(q(:,n,1) - q(:,n,2),2),2) + 2*(q(:,n,1) - q(:,n,2))'*(Q(:,n,1) - Q(:,n,2));
d_min^2 <= -pow_pos(norm(q(:,n,2) - q(:,n,1),2),2) + 2*(q(:,n,2) - q(:,n,1))'*(Q(:,n,2) - Q(:,n,1));
end

cvx_end
result = cvx_optval;
output = Q;
``````

Although I have tried many times, using different cvx_solvers, change log into -rel_entr in cvx (though I don’t think it helps since it does not contain any cvx variables inside), I always got an infeasible solution and the optimized result is NaN. the cvx_optval is -inf. I have checked my codes many times and did not find any problem. Anyone could help me a little bit? Thank you so much!

All but section 1 of https://yalmip.github.io/debugginginfeasible also applies to CVX.