CVX: Ineffectiveness of restraints!

clc
c
clear
beta_0 = 10^-9 ;
ka = 4;
Ka = 3;
numUsers = 20; %number of users
numSubband_all = 5:5; %16;
npsd = -174; %noise power spectral density dBm/Hz
W = 10^6; %subband bandwidth 1MHz
%数量级增大 很关键 !!!!!!!!
noise_power = 10^(-14.4) * 10e13;
Q_b = [1500,1500];
v = 15;
T_opt = zeros(1,length(numSubband_all));
H1 = 100ones(numUsers,1); %无人机高度
H = 100;
for i = 1:length(numSubband_all)
numSubband = numSubband_all(i); %number of subband
R = 250;
theta=0:2
pi/1000:2pi;
a=R
cos(theta);
b=Rsin(theta);
%---------------------蜂窝用户----------------------------
t1=rand(1,numUsers);
t2=rand(1,numUsers);
for i1=1:numUsers
beta(i1)=2
pit1(i1);
r(i1)=2
Rt2(i1)-R;
user_x(i1)=r(i1)cos(beta(i1));
user_y(i1)=r(i1)sin(beta(i1));
end
ruser = [user_x’,user_y’];
R_s = randi([10^6,10^7],numUsers,1);
Pow = unifrnd(0.1, 0.2, numUsers, 1);
d_bar = randi([10^9,10^10]);
%初始点设置
t3=rand(1,1);
t4=rand(1,1);
for i1=1:1
beta1(i1)=2
pi
t3(i1);
r(i1)=2
Rt4(i1)-R;
uav_x(i1)=r(i1)cos(beta1(i1));
uav_y(i1)=r(i1)sin(beta1(i1));
end
Quav = [uav_x,uav_y];
objection_0 = 0;
jj =1;
iteration =1;
max_iterations =10;
while 1
d = pdist2(ruser, Quav, ‘euclidean’);
d = d+ H1.^2;
beta = sqrt(beta_0 * 1e28) ./ d ; % 大尺度
g_rayleigh = sqrt(0.5) * (randn(numUsers, numSubband) + 1i * randn(numUsers, numSubband));
g_rician = sqrt(Ka/(Ka+1)) + sqrt(1/(Ka+1)) * g_rayleigh;
%为了消除虚数
g_rician_dB = 20 * log10(abs(g_rician));
g_rician = 10 .^ (g_rician_dB / 10);
for i3 = 1:numSubband
g(:,i3) = g_rician(:,i3) .
beta ;
end
%transmission data rates of different users with different subbands
R_t = W
log2(1+Pow
ones(1,numSubband).g/noise_power) ;
e_all = (1./(R_s
ones(1,numSubband)) + 1./( R_t)) ;
[Assigned_subband_index,cost] = assignmentoptimal(- e_all.^-1);%should maximize the sum of the weight, while the function is minimization!!!
Scheduled_user_index = find(Assigned_subband_index~=0);
Alpha_of_ScheUser = e_all(sub2ind(size(e_all),find(Assigned_subband_index~=0), Assigned_subband_index(Assigned_subband_index~=0)));
d_opt = ( ( d_bar)./Alpha_of_ScheUser/(sum(Alpha_of_ScheUser.^(-1))));
len1 = length(Scheduled_user_index);
cvx_begin
%cvx_solver mosek
cvx_solver sedumi
variable Q(1,2)
variable mu1 nonnegative
variable gamma1(1,len1) nonnegative
expression R_LB(1,len1)
for k = 1:len1
index = Scheduled_user_index(k);
index_subband = Assigned_subband_index(Scheduled_user_index(k));
%计算信道增益
g_c = g_rician(index,index_subband);
ita = Pow(index)* g_c sqrt(beta_0 1e28) /noise_power;
R_LB(k) = ( W*(-rel_entr(1,(1+ita/ ( (pow_pos(norm((Quav-ruser(index,:)),2),2)+H^2))))/log(2)) + ita * W * (-1)(pow_pos(norm((ruser(index,:)-Q),2),2)-pow_pos(norm((Quav-ruser(index,:)),2),2)) /(((pow_pos(norm((Quav-ruser(index,:)),2),2)+H^2) +ita) (pow_pos(norm((ruser(index,:)-Quav),2),2)+H^2) log(2)) );
end
Q_d = [Q - Q_b, H];
Tround = norm(Q_d) /v;
objection = mu1 + 2
Tround ;
minimize objection
subject to
for k= 1:len1
R_LB(k) >= gamma1(k) ;
end
for k = 1: len1
d_opt(k) / (R_s(Scheduled_user_index(k))) + d_opt(k) * inv_pos( gamma1(k) ) <= mu1;
end
abs( Q(1,1))<= 250 ;
abs( Q(1,2))<= 250 ;
cvx_end
disp(Q)
disp(mu1)
disp(Tround)
jj=jj+1;
if abs(objection - objection_0) <= 1e-4
T(iteration) = objection;
iteration = iteration +1;
break;
else
Quav = Q;
objection_0 = objection;
T(iteration) = objection;
iteration = iteration +1;
end
end
Q
objection
iteration
end
T
figure
plot(1:iteration-1,T)

Calling SeDuMi 1.3.4: 81 variables, 36 equality constraints
For improved efficiency, SeDuMi is solving the dual problem.

SeDuMi 1.3.4 by AdvOL, 2005-2008 and Jos F. Sturm, 1998-2003.
Alg = 2: xz-corrector, Adaptive Step-Differentiation, theta = 0.250, beta = 0.500
eqs m = 36, order n = 65, dim = 82, blocks = 17
nnz(A) = 119 + 0, nnz(ADA) = 196, nnz(L) = 123
it : by gap delta rate t/tP t/tD* feas cg cg prec
0 : 1.90E+06 0.000
1 : -8.65E+04 5.04E+05 0.000 0.2649 0.9000 0.9000 1.90 1 1 1.9E+00
2 : -5.64E+04 1.30E+05 0.000 0.2586 0.9000 0.9000 1.84 1 1 6.7E-01
3 : -8.74E+03 4.14E+04 0.000 0.3175 0.9000 0.9000 1.64 1 1 3.9E-01
4 : -1.69E+03 1.25E+04 0.000 0.3013 0.9000 0.9000 1.35 1 1 3.0E-01
5 : -7.02E+02 4.01E+03 0.000 0.3211 0.9000 0.9000 1.14 1 1 2.8E-01
6 : -2.14E+02 1.28E+03 0.000 0.3185 0.9000 0.9000 1.14 1 1 2.6E-01
7 : -2.20E+02 4.75E+02 0.000 0.3723 0.9000 0.9000 1.17 1 1 2.6E-01
8 : -2.50E+02 1.54E+02 0.000 0.3250 0.9000 0.9000 1.18 1 1 3.7E-01
9 : -2.50E+02 5.26E+01 0.000 0.3408 0.9000 0.9000 1.11 1 1 1.1E-01
10 : -2.39E+02 1.52E+01 0.000 0.2896 0.9000 0.9000 1.08 1 1 3.1E-02
11 : -2.36E+02 4.14E+00 0.000 0.2715 0.9000 0.9000 1.20 1 1 6.6E-03
12 : -2.36E+02 3.01E-01 0.000 0.0727 0.9900 0.9900 1.32 1 1 3.2E-04
13 : -2.36E+02 1.88E-03 0.000 0.0062 0.9990 0.9990 1.07 1 2 1.9E-06
14 : -2.36E+02 4.43E-04 0.000 0.2359 0.9000 0.9000 0.99 4 4 4.4E-07
15 : -2.36E+02 2.06E-05 0.000 0.0465 0.9900 0.9900 0.96 4 5 2.2E-08
16 : -2.36E+02 8.47E-06 0.000 0.4116 0.9046 0.9000 0.54 19 19 1.5E-08
17 : -2.36E+02 2.87E-06 0.396 0.3388 0.9000 0.0000 0.37 25 23 8.4E-09

iter seconds digits cx by
17 0.1 7.3 -2.3607907146e+02 -2.3607908303e+02
|Ax-b| = 6.7e-12, [Ay-c]_+ = 2.6E-06, |x|= 4.4e+00, |y|= 2.0e+06

Detailed timing (sec)
Pre IPM Post
1.300E-02 6.200E-02 3.007E-03
Max-norms: ||b||=1, ||c|| = 3.241228e+06,
Cholesky |add|=6, |skip| = 0, ||L.L|| = 713.195.

Status: Solved
Optimal value (cvx_optval): +236.079

250.0000 250.0000

-1.9856e-06

118.0395

The code can run, But clearly the constraints were ignored ”d_opt(k) / (R_s(Scheduled_user_index(k))) + d_opt(k) * inv_pos( gamma1(k) ) <= mu1;“ Can you help me solve it please?

The solvers ensure constraints are satisfied to within a feasibility tolerance, which might be about 1e-6 or 1e-8. if constraints are violated by no more than that, the solver, and hence, CVX, consider the constraints to be satisfied.

I tried to change the precision of some values like d_opt, the constraints work but the problem doesn’t converge, can you give me advice
?