请教一下我在交替优化波束形成向量和ris反射角的时候,想使保密速率最大化,但得到的结果不收敛这是为啥?优化波束形成用的是数学表达式这里就不放了;优化反射角用的是半定松弛+高斯随机化,但我单独固定一个变量只优化另一个变量的时候结果却是收敛的,这个问题困扰我一个月了
function theta = oma1_opt_theta(h_B1,h_BE,h_R1,h_RE,G,w1_opt,P,M)
h1 = P*h_B1'*w1_opt*(h_B1'*w1_opt)';
he1 = P*h_BE'*w1_opt*(h_BE'*w1_opt)';
G1 = P*[diag(h_R1')*G*w1_opt*w1_opt'*G'*diag(h_R1) diag(h_R1')*G*w1_opt*w1_opt'*h_B1;
h_B1'*w1_opt*w1_opt'*G'*diag(h_R1) 0];
Ge1 = P*[diag(h_RE')*G*w1_opt*w1_opt'*G'*diag(h_RE) diag(h_RE')*G*w1_opt*w1_opt'*h_BE;
h_BE'*w1_opt*w1_opt'*G'*diag(h_RE) 0];
cvx_begin sdp quiet
variable X1(M+1,M+1) hermitian
variable mu1(1,1)
maximize(real(trace(G1*X1) + mu1*(h1+1)))
subject to
real(trace(Ge1*X1)) + mu1*(he1 + 1) == 1;
for i=1:M+1
Em = zeros(M+1,M+1);
Em(i,i) = 1;
real(trace(Em*X1)) == mu1;
end
X1 == hermitian_semidefinite(M+1);
mu1 >= 0;
cvx_end
S_opt = X1/mu1;
% 高斯随机化
% [U1,S1,V1] = svd(S_opt);
[U1,S1] = eig(S_opt);
max_F = -1;
max_q = -1;
for i=1:1000
r = sqrt(1/2)*(randn(M+1,1) + 1j*randn(M+1,1));
theta_second_opt = U1*sqrt(S1)*r;
if theta_second_opt.'*G1*conj(theta_second_opt) > max_F
max_q = theta_second_opt;
max_F = theta_second_opt.'*G1*conj(theta_second_opt);
end
end
theta = exp(1j*angle(max_q/max_q(end)));
theta = theta(1:M);
end