Hi,
I have a problem using CVX.
I would really appreciate if somebody could help
This is reproducible example.
This keep saying that inner matrix dimensions must agree, even though they does agree.
The below shows reproducible example.
clear all
N_CP=15;
M=2;
N_RU=6;
N=3;
U=2;
F=3;
D=20;
f_c=3.6* 10^9;
lambda_rf=(3* 10^8)/f_c;
B_fso=1* 10^9;
B_rf=40* 10^6;
f_s=B_rf;
N0_dBm=-174;
NF_dB=5;
sigma2_rf_dBm=N0_dBm+10*log10(B_rf)+NF_dB;
sigma2_rf_dB=sigma2_rf_dBm-30;
sigma2_rf=10^(sigma2_rf_dB/10);
c_fso=[5.0804,3.7454];
F_rf=randn(M*N_RU,N_CP)+j*randn(M*N_RU,N_CP)/sqrt(2);
for m=1:M
F_rf_m(:,:,m)=F_rf((m-1)*N_RU+1:(m-1)*N_RU+N_RU,:,1);
end
H_ml=(randn(M*N_RU,N+F)+j*randn(M*N_RU,N+F))/sqrt(2);
for m=1:M
H_m(:,:,m)=H_ml((m-1)*N_RU+1:(m-1)*N_RU+N_RU,:,1);
end
initalP_m_dBm=23;
initalP_m_dB=initalP_m_dBm-30;
initalP_m=10^(initalP_m_dB/10);
p_rate=0.5;
for m=1:M e)
W_m(:,:,m)=H_m(:,:,m)*inv(H_m(:,:,m)'*H_m(:,:,m));
W_m(:,:,m)=(sqrt(p_rate * initalP_m)/norm(W_m(:,:,m),'fro'))*W_m(:,:,m);
Q_m(:,:,m)=(sqrt(((1-p_rate) * initalP_m)/N_RU)) * eye(N_RU);
Z_m(:,:,m)=inv((W_m(:,:,m)*W_m(:,:,m)')+(Q_m(:,:,m)*Q_m(:,:,m)));
W(N_RU*(m-1)+1:N_RU*(m-1)+N_RU,:)=W_m(:,:,m);
Q(N_RU*(m-1)+1:N_RU*(m-1)+N_RU,:)=Q_m(:,:,m);
Z(N_RU*(m-1)+1:N_RU*(m-1)+N_RU,:)=Z_m(:,:,m);
end
cvx_begin
variable W_m(N_RU,N+F,M) complex;
variable Q_m_lower(N_RU-1,N_RU-1,M) lower_triangular complex;
variable Q_m_diagonal(N_RU,N_RU,M) diagonal
variable V_m(N_CP,N_CP,M) hermitian
Q_m=cvx(zeros(N_RU,N_RU,M));
for m=1:M
for t=1:N_RU
Q_m(t,t,m)=Q_m_diagonal(t,t,m);
end
end
for m=1:M
for x=2:N_RU
for y=1:x-1
Q_m(x,y,m)= Q_m_lower(x-1,y,m);
end
end
end
powerofmthRU=cvx(zeros(1,M));
R=cvx(zeros(N_RU,N_RU,M));
W=cvx(zeros(N_RU*M,N+F));
Q=cvx(zeros(N_RU*M,N_RU));
for m=1:M
W(N_RU*(m-1)+1:N_RU*(m-1)+N_RU,:)=W_m(:,:,m);
powerofmthRU(m)=sum(sum_square_abs(W_m(:,:,m)))+sum(sum_square_abs(Q_m(:,:,m)));
for t=1:N_CP
powerofsiganltomthRU(m)=sum(V_m(t,t,m));
end
Q(N_RU*(m-1)+1:N_RU*(m-1)+N_RU,:)=Q_m(:,:,m);
R(:,:,m)=chol(Z_m(:,:,m));
end
minimize sum(powerofmthRU)
subject to
for m=1:M
-sum(sum_square_abs(R(:,:,m)*W_m(:,:,m)))-sum(sum_square_abs(R(:,:,m)*Q_m(:,:,m)))+log_det(Z_m(:,:,m))+N_RU...
>= -log_det(eye(N_RU)+((F_rf_m(:,:,m) * V_m(:,:,m)*F_rf_m(:,:,m)')/sigma2_rf))-2 * log_det(real(Q_m(:,:,m)));
for j=1:M
if(m~=j)
F_rf_m(:,:,j)*V_m(:,:,m)* F_rf_m(:,:,j)' == zeros(N_RU);
end
end
end
cvx_end
Before cvx begin, they are all constant and initial value.
The really strange thing is if I erase either one of the two constraint written above,
it works fine. Only when the two constraints are written, there is error.
Thank you