I try to solve this problem:
while
only relevant to the Pe of the previous iteration .
This is my code
function [Pe,deta_a]= cvx_Pe(h_ae2,h_ae1,h_ak1,z_all,Pe,A,Pth,E,deta_a)
F_az=zeros(1,A);
f_a1=zeros(1,A);
F_ae=zeros(E,A);
f_ae=zeros(E,A);
for a=1:A
F_az(1,a)=abs(h_ae2(:,:,a,1)’*(h_ak1(:,:,a,1)+z_all(:,:,a,1))).^2;
f_a1(1,a)=norm(h_ak1(:,:,a,1)+z_all(:,:,a,1));
end
for a=1:A
for e= 1:E
F_ae(e,a)=abs(h_ae2(:,:,a,1)’*h_ae1(:,:,a,e)).^2;
f_ae(e,a)=norm(h_ae1(:,:,a,e));
end
end
temp_detas=F_az;
temp_detax=f_a1;
for a=1:A
temp_detas(1,a)=temp_detas(1,a)+Pe(:,1)’*f_ae(:,a);
temp_detax(1,a)=temp_detax(1,a)+Pe(:,1)’*f_ae(:,a);
end
subject to
cvx_begin quiet
cvx_precision low
variable Pe(E,1) complex;
minimize (sum(2*deta_a*sqrt(F_az+Pe'*F_ae)-deta_a*(f_a1+Pe'*f_ae)))
subject to
sum(Pe)<=Pth;
cvx_end
deta_a=temp_detas./temp_detax;
end