Hi, sorry to bother.
I’ve solving a a CVX SDP problem, and the status is solved, but the solution doesn’t satisfy constraint.
Is there any advice that I can tried to solve this problem ? I really appreciate it !
The details of my code is listed below, thanks for the help !
%%
clc;clear all;
%Initialization
%RSU location, transmit and receive antenna,P=30dBm
M=1;
Nt=32;
Nr=32;
d=1/2; %antenna spacing distance
%Vehicle location , single antenna
K=1;
%Sample (for estimation)
fc=6010^9;
delta_f=50010^3;
T=1/delta_f;
L=96;
Ts=T/L;
% Communication Performance
gamma_comm=1;
% CRLB Performance
%gamma=0.00003;
gamma1=0.1;
gamma2=0.1;
% gamma1=0.0210^(-5);
% gamma2=0.0210^(-3);
% Outage Probability
eps1=0.1;
eps2=0.1;
%Parameter Initialization
c=3*10^8; %speed of light
rho=10+101i; %fading coefficient
sigma=sqrt(10^(-67/10)*10^(-3));
%Radar and Signal Model Initialization
for pl=1
%% Input Estimated Paremeter
filename = ['Place',num2str(pl),'_estimation_',num2str(M),'RSU_',num2str(K),'CAR.mat'];
load(['C:\Users\CCRG613\Desktop\CCRG\Working\RSU_ISAC\Work_Hard\2RSU_2CAR\Robust_beamforming\Estimation_Parameter\',filename],'AoA_estimated','dis_estimated','speed');
ang_estimated=AoA_estimated;
%Reflection coeffcient & Delay
beta=zeros(M,K,M); %reflection coefficent
mu=zeros(M,K,M); %doppler frequency
beta_tilde=zeros(M,K,M);
temp_mu=zeros(M,K,M);
delay=zeros(M,K,M); %delay
for m=1:M
for k=1:K
for mm=1:M
beta(m,k,mm)=rho/(dis_estimated(m,k)+dis_estimated(mm,k));
mu(m,k,mm)=speed(k)*cosd(ang_estimated(m,k))/c+speed(k)*cosd(ang_estimated(mm,k))/c;
delay(mm,k,m)=(dis_estimated(mm,k)+dis_estimated(m,k))/c;
for qq=0:L-1
temp_mu(m,k,mm)=1/L*exp(1i*2*pi*fc*T*mu(m,k,mm)*(qq/L))+temp_mu(m,k,mm);
end
beta_tilde(mm,k,m)=beta(m,k,mm)*exp(-1i*2*pi*fc*delay(mm,k,m))*temp_mu(m,k,mm);
end
end
end
%% Robust Beamforming (Sum Rate)
h_CSI_hat=zeros(Nt,M,K);
zeta=2.55; %Path loss exponent
alpha_0=10^(-68/10);
for m=1:M
for k=1:K
h_CSI_hat(:,m,k)=sqrt(Nt/L)*sqrt(alpha_0)*(dis_estimated(m,k))^(-zeta/2)*((1/sqrt(Nt))*exp(-1i*(0:Nt-1)'*2*pi*d*cosd(ang_estimated(m,k))));
end
end
C=zeros(Nt,M,K);
e=zeros(Nt,M,K);
a_par=zeros(Nt,M,K);
for m=1:M
for k=1:K
for nt=1:Nt
a_par(nt,m,k)=(1/sqrt(Nt))*1i*(nt-1)*2*pi*d*sind(ang_estimated(m,k))*exp(-1i*(nt-1)*2*pi*d*cosd(ang_estimated(m,k)));
end
C(:,m,k)=sqrt(Nt/L)*sqrt(alpha_0)*(dis_estimated(m,k))^(-zeta/2)*a_par(:,m,k);
e(:,m,k)=sqrt(Nt/L)*sqrt(alpha_0)*(-zeta/2)*dis_estimated(m,k)^(-zeta/2-1)*(1/sqrt(Nt))*exp(-1i*(0:Nt-1)'*2*pi*d*cosd(ang_estimated(m,k)));
end
end
Sigma1=zeros(Nt,Nt,M,K);
for m=1:M
for k=1:K
Sigma1(:,:,m,k)=C(:,m,k)*C(:,m,k)'*gamma1+e(:,m,k)*e(:,m,k)'*gamma2;
end
end
%% Solve SDP
% Start Solving Problem
cvx_solver mosek %mosek%sedumi;%sdpt3;
%cvx_precision high
cvx_begin SDP
variable W_opt(Nt,Nt,M,K) hermitian %semidefinite
variable x1(K,1)
variable y1(K,1)
Q1=cvx(zeros(Nt,Nt,K));
u11=cvx(zeros(Nt,K));
s1=cvx(zeros(K,1));
Q1_temp1=cvx(zeros(Nt,Nt,M,K));
Q1_temp2=cvx(zeros(Nt,Nt,M,K));
vec_Q1=cvx(zeros(Nt^2,K));
norm_Q1_u1=cvx(zeros(Nt^2+Nt,K));
P_opt=cvx(zeros(1,1));
for k=1:K
for m=1:M
for i =1: K
if i~=k
Q1_temp1(:,:,m,k)=W_opt(:,:,m,i)+Q1_temp1(:,:,m,k);
end
end
Q1_temp2(:,:,m,k)=(1/(2^(gamma_comm)-1))*W_opt(:,:,m,k)-Q1_temp1(:,:,m,k);
Q1(:,:,k)=sqrtm(Sigma1(:,:,m,k))*Q1_temp2(:,:,m,k)*sqrtm(Sigma1(:,:,m,k))+Q1(:,:,k);
u11(:,k)=sqrtm(Sigma1(:,:,m,k))*Q1_temp2(:,:,m,k)*h_CSI_hat(:,m,k)+u11(:,k);
s1(k)=h_CSI_hat(:,m,k)'*Q1_temp2(:,:,m,k)*h_CSI_hat(:,m,k)+s1(k);
end
Q1(:,:,k)=0.5*(Q1(:,:,k)+Q1(:,:,k)');
s1(k)=s1(k)-sigma^2;
vec_Q1(:,k)=reshape(Q1(:,:,k)',1,[]);
norm_Q1_u1(1:Nt^2,k)=vec_Q1(:,k);
norm_Q1_u1(Nt^2+1:Nt^2+Nt,k)=sqrt(2)*u11(:,k);
end
for m=1:M
for k=1:K
P_opt=trace(W_opt(:,:,m,k))+P_opt;
end
end
minimize P_opt
subject to
for k=1:K
% Constraint
real(trace(Q1(:,:,k))-sqrt(-2*log(eps1))*x1(k)+log(eps1)*y1(k)+s1(k)) >=0 ;
(norm(norm_Q1_u1(:,k))-x1(k))<= 0;
(y1(k)*eye(Nt)+Q1(:,:,k)) >= 0 ;
y1(k) >=0 ;
end
for m=1:M
for k=1:K
W_opt(:,:,m,k) >=0;
end
end
cvx_end
% Test Rate
Rate_ind=zeros(K,L);
temp_sumrate_mom=zeros(K,L);
temp_sumrate_son=zeros(K,L);
for k=1:K
for l=1:L
for m=1:M
temp_sumrate_son(k,l)=h_CSI_hat(:,m,k)'*W_opt(:,:,m,k)*h_CSI_hat(:,m,k)+temp_sumrate_son(k,l);
for i=1:K
if i~=k
temp_sumrate_mom(k,l)=h_CSI_hat(:,m,k)'*W_opt(:,:,m,i)*h_CSI_hat(:,m,k)+temp_sumrate_mom(k,l);
end
end
end
temp_sumrate_mom(k,l)=temp_sumrate_mom(k,l)+sigma^2;
Rate_ind(k,l)=abs(log2(1+temp_sumrate_son(k,l)/temp_sumrate_mom(k,l)));
end
end
disp('Rate (Ind)')
disp(Rate_ind(:,1))
disp('Threshold')
disp(gamma_comm)
% Test Power
% W_opt=W_opt*sigma^2;
RSU_power=zeros(M,1);
for m=1:M
for k=1:K
RSU_power(m)=trace(W_opt(:,:,m,k))+RSU_power(m);
end
end
disp('Power (Opt)')
disp(RSU_power)
end