In the First 4 iteration Cvx status is “solved” but after 4 iteration status is Failed. i already used Mosek …
function [W,tau,mu] = calW(barHbsue, Pbs, G, Phi, A, d, e, M, K, epsilon, W_t, B, D, E, tau_u, mu_u)
% Calculate intermediate matrices
S = Phi’APhiG;
T = PhiG;
% Adjust the input scale of CVX to ensure its performance
barHbsue = barHbsue * 1e4;
d=d1e8;
S=S1e3;
T=T1e3;
e=e*1e6;
% Initialize variables
mu = ones(K, 1);
% Start CVX optimization
cvx_clear;
cvx_begin
variable W(M, M + K) complex
variable tau nonnegative
variable mu(K, 1) nonnegative
maximize(tau)
subject to
% Constraint loop for each user j
for j = 1:K
denom = 0;
for k = 1:1:K
if k ~= j
denom = denom + real(barHbsue(:, j)' * (W * W_t' - W_t(:, k) * W_t(:, k)') * barHbsue(:, j));
end
end
denom=denom + d(j);
mu(j) >= denom ;
end
% Quadratic constraints for each user j
for j = 1:K
tau_u * square_pos(mu(j)) / (2 * mu_u(j)) + mu_u(j) * square_pos(tau) / (2 * tau_u) <= square_pos(norm(barHbsue(:, j)' * W_t(:, j)))
end
% General constraints
tau >= epsilon;
square_pos(norm(W, 'fro')) <= Pbs;
square_pos(norm(S * W, 'fro')) + square_pos(norm(T * W, 'fro')) <= e;
(1+1/epsilon)*real(barHbsue(:,1)'*(W_t(:,1)*W_t(:,1)')*barHbsue(:,1))-real(barHbsue(:,1)'*(W_t*W_t')*barHbsue(:,1)+d(1))>=0;
(1+1/epsilon)*real(barHbsue(:,2)'*(W_t(:,2)*W_t(:,2)')*barHbsue(:,2))-real((barHbsue(:,2)'*(W_t*W_t')*barHbsue(:,2))+d(2))>=0
cvx_end
Error details:
number of iterations = 70
Total CPU time (secs) = 0.42
CPU time per iteration = 0.01
termination code = 3
DIMACS: 7.3e-08 0.0e+00 2.5e-08 0.0e+00 -2.3e-01 6.3e-02
Status: Failed
Optimal value (cvx_optval): NaN