Hello, everyone.
When the number of transmit antennas “N =4”, the program runs normally, but when N >=5, e.g., “N = 5” or “N = 6” , sometimes matlab will display the warning:
[
Warning: This linear matrix inequality appears to be unsymmetric. This is
very likely an error that will produce unexpected results. Please check
the LMI; and, if necessary, re-enter the model.
-> In cvxprob.newcnstr at 230
In cvx.ge at 21
In paper_bern_cvx at 53
Warning: This linear matrix inequality appears to be unsymmetric. This is
very likely an error that will produce unexpected results. Please check
the LMI; and, if necessary, re-enter the model.
-> In cvxprob.newcnstr at 230
In cvx.ge at 21
In paper_bern_cvx at 63
]
I don’t know why?
Thanks!
the code is here:
clear;
num_CSI = 5;
N = 6; % number of transmit antennas
M = 3;
K = 3;
gamma_b = 10;
gamma_b = 10 ^ (gamma_b / 10);
gamma_e = -2;
gamma_e = 10 ^ (gamma_e / 10);
rho_b = 0.1;
rho_e = 0.01;
alpha_b = -log(rho_b);
alpha_e = -log(rho_e);
sigma2 = 0.1;
epsilon2 = 0.002;
j = 1;
while (j <= num_CSI)
H(:,:,j) = (randn(N,M) + sqrt(-1) * randn(N,M)) / sqrt(2); %
G(:,:,j) = (randn(N,K) + sqrt(-1) * randn(N,K)) / sqrt(2); %
j = j + 1;
end
cvx_solver sedumi;
for j = 1:num_CSI
cvx_begin sdp quiet
variable W(N,N,M) hermitian;
variable P_z;
variables mu_b(M) nu_b(M);
variables mu_e(M,K) nu_e(M,K);
expression sum_W;
expression U(N,N);
expression D_b(N,N);
expression d_b(N);
expression c_b;
expression D_e(N,N);
expression d_e(N);
expression c_e;
sum_W = 0;
for m = 1:M
sum_W = sum_W + W(:,:,m);
end
V = null(H(:,:,j)');
U = (P_z / (N - M)) * V * V';
minimize(trace(sum_W) + P_z); % object function
subject to
for m = 1:M
% the constraints at the legitimate users
D_b = epsilon2 * ((1 + 1 / gamma_b) * W(:,:,m) - sum_W - U);
d_b = sqrt(epsilon2) * ((1 + 1 / gamma_b) * W(:,:,m) - sum_W) * H(:,m,j);
c_b = sigma2 - real(H(:,m,j)' * ((1 + 1 / gamma_b) * W(:,:,m) - sum_W) * H(:,m,j));
real(trace(D_b)) - sqrt(2 * alpha_b) * mu_b(m) - alpha_b * nu_b(m) - c_b >= 0;
norm(vec([D_b , sqrt(2) * d_b])) <= mu_b(m);
nu_b(m) * eye(N) + D_b >= 0;
nu_b(m) >= 0;
W(:,:,m) >= 0;
% the constraints at the eavesdroppers
for k = 1:K
D_e = epsilon2 * ((1 + 1 / gamma_e) * W(:,:,m) - sum_W - U);
d_e = sqrt(epsilon2) * ((1 + 1 / gamma_e) * W(:,:,m) - sum_W - U) * G(:,k,j);
c_e = sigma2 - real(G(:,k,j)' * ((1 + 1 / gamma_e) * W(:,:,m) - sum_W - U) * G(:,k,j));
real(trace(D_e)) + sqrt(2 * alpha_e) * mu_e(m,k) + alpha_e * nu_e(m,k) - c_e <= 0;
norm(vec([D_e , sqrt(2) * d_e])) <= mu_e(m,k);
nu_e(m,k) * eye(N) - D_e >= 0;
nu_e(m,k) >= 0;
end
end
P_z >= 0;
cvx_end
if strfind(cvx_status,'Solved')
% get the power value
b = cvx_optval
end
end
Blockquote