My code is as follows, and the result can be produced in the end, but the constraint condition does not work, how can I solve it。
clear all
clc
sigma2=10^(-14);%噪声功率-140dBm
alpha1=0.3;
alpha2=0.7;
beta0=10^(-6);%单位距离信道功率增益-60dB
pmax=0.2;%最大发射功率20dBm_——改为0.2
B= 10^(6);%10^(6);%带宽
S=10^(6);%数据包大小
Pos_gateway=[1500,1000];
sss=2;
pionts_in2r=[383.353104429636,515.077391288163;373.515457407451,334.609223783052];
center=[378.434280918544,424.843307535607];
cvx_begin
%调整精确度
cvx_solver sedumi
cvx_precision best
variable x
variable y
expression lambda(sss,1)
expression ceter_next
expression A_temp(sss,1)
expression D_temp(sss,1)
expression AD_temp(sss,1)
expression mu
expression F_temp
expression Z_temp
expression FZ_temp
expression eta_temp(sss,1)
ceter_next=[x,y];
ceter_temp=center;
for i=1:sss
lambda(sss)=sqrt(S*pmax)/(B*log(1+(pmax*beta0)/(sigma2*sum_square_abs(ceter_temp-pionts_in2r(sss,:))))/log(2));
A_temp(sss)=(pmax*beta0*log(exp(1))/log(2))/(sum_square_abs(ceter_temp-pionts_in2r(sss,:))*(sigma2*sum_square_abs(ceter_temp-pionts_in2r(sss,:))+pmax*beta0));
AD_temp(sss)=sum_square_abs(lambda(sss))*(-A_temp(sss)*(sum_square_abs(ceter_next-pionts_in2r(sss,:))-sum_square_abs(ceter_temp-pionts_in2r(sss,:))))...
+sum_square_abs(lambda(sss))*D_temp(sss);
end
mu=sqrt(S*pmax)/(B*log(1+(pmax*beta0)/(sigma2*sum_square_abs(ceter_temp-Pos_gateway)))/log(2));
F_temp=(pmax*beta0*log(exp(1))/log(2))/(sum_square_abs(ceter_temp-Pos_gateway)*((sigma2*sum_square_abs(ceter_temp-Pos_gateway))+pmax*beta0));
Z_temp=log(1+(pmax*beta0)/(sigma2*sum_square_abs(ceter_temp-Pos_gateway)))/log(2);
FZ_temp=sum_square_abs(mu)*(-F_temp*(sum_square_abs(ceter_next-Pos_gateway)-sum_square_abs(ceter_temp-Pos_gateway)))...
+sum_square_abs(mu)*Z_temp;
eta_temp=-2*alpha1*sqrt(pmax*S)*sum(lambda(sss))-2*sqrt(pmax*S)*alpha2*mu+B*alpha1*sum(AD_temp)+B*alpha2*FZ_temp;
maximize (eta_temp)
subject to
for i=1:sss
sum_square_abs(ceter_next-pionts_in2r(sss,:))<=10000;
end
cvx_end
UAV_next_top=ceter_next;