I need your help!
%parameters
B = 10^6; %bandwidth
c = 10^3; %CPU cycles
T = 0.1; %latency
zeta = 10^(-19); %effective capacitance coefficient
zeta1 = zeta*c^3/T^2;
N = 4; %发射端天线
E = 3; %Eve 天线
M = 5; % IRS反射元素
K = 3; %用户数
sigma = 10^(-12); %噪声
epsilon = 10^(-3); %所有算法的精度
epsilon_e = 1; % bounded error
epsilon_g = 1;
L = 300; %input bits
D_IB = 10;
alpha1 = 2;
P_IB = 10^(( - 10alpha1log10(D_IB))/10);
H_IB = (randn(N,M)+1jrandn(N,M))/sqrt(2). P_IB; %
% channel matrix Eve-IRS
D_IE = 20;
alpha2 = 2.5;
P_IE = 10^(( - 10alpha2log10(D_IE))/10);
H_IE = (randn(E,M)+1jrandn(E,M))/sqrt(2). P_IE;
% channel matrix Use-IRS 分布在一个圆内
D_UI = sqrt(5000);
alpha3 = 2.2;
P_UI = 10^(( - 10alpha3log10(D_UI))/10);
H_UI = (randn(M,K)+1j*randn(M,K))/sqrt(2).*P_UI;
%channel matrix Use-Eve
D_UE = sqrt(5000);
alpha4 = 5;
P_UE = 10^((- 10alpha4log10(D_UE))/10);
H_UE = (randn(E,K)+1j*randn(E,K))/sqrt(2).*P_UE;
% channel matrix Use-BS
D_UB = 70;
alpha5 = 4;
P_UB = 10^((- 10alpha5log10(D_UB))/10);
H_UB = (randn(N,K)+1j*randn(N,K))/sqrt(2).*P_UB;
r_max = 100;
error = 1; r=0;
for n=1:M
e(n)=exp(sqrt(-1)2pin/M);%等间隔离散相移,初始化相移
end
e = e’;
%信道排序
for k=1:K
h(:,k) = (H_UB(:,k) + H_IBdiag(H_UI(:,k))*e);
% e_old = zeros(M,1);
str(k) = h(:,k)’*h(:,k);
end
h_copy = h;
for j = 1:K
[s1,index] = max(str);
h(:,j) = h_copy(:,index);
str(index) = -inf;
end
%相位矩阵 没有IRS
W=ones(N,K); %多用户解码矩阵
obj = 7;
for k = 1:K
h(:,k) = (H_UB(:,k) + H_IB*diag(H_UI(:,k))*e)10^(6);
g(:,k) = (H_UE(:,k) + H_IEdiag(H_UI(:,k))*e);
end
%% optimize l and p
r1 = 0; error1=1; r_max = 100;
p_old = 20ones(1,K);
beta1_old = 0.0210^(-9)ones(1,K);
a_old = 2ones(1,K);
sum_energy_old = 50;
while(error1 > epsilon && r1 < r_max)
for k = 1:K
for j = k+1:K
v(j) = p_old(j)(h(:,j)'h(:,j));
end
mu(k) = 1/(sum(v)+1);
v = [];
m(k) = 1/(1+a_old(k));
end
cvx_begin sdp
cvx_solver sedumi
variables l(1,K) p(1,K) a(1,K) beta1(1,K) mu_e(1,K) mu_g(1,K)
expressions c1(K,K) c2(K,K)
obj = sum(zeta1.pow_abs(l,3)+p.T);
minimize obj
subject to
for k = 1:K
for j = k:K
c1(k,j) = p(j)(h(:,j)'h(:,j));
end
for j = k+1:K
c2(k,j) = p(j)(h(:,j)'h(:,j));
end
log(sum(c1(k,:)) + 1) + log(mu(k)) + 2 - mu(k)(sum(c2(k,:)) + 1) - m(k)(a(k)+1) + log(m(k)) >= (L - l(k))/(BT10^(-3));
beta1_old(k)p_old(k)+beta1_old(k)(p(k)-p_old(k))+p_old(k)*(beta1(k)-beta1_old(k)) <= a(k)sigma;
[ beta1(k) - Mmu_g(k) - mu_e(k) g(:,k)’ zeros(1,E) zeros(1,E);…
g(:,k) eye(E) epsilon_e.*eye(E) epsilon_g.*eye(E);…
zeros(E,1) epsilon_g.*eye(E) mu_g(k).*eye(E) zeros(E,E);…
zeros(E,1) epsilon_e.*eye(E) zeros(E,E) mu_e(k).*eye(E)] >= 0;
p(k) >= 0;
l(k) <= L;
l(k) >= 0;
mu_g(k) >= 0;
mu_e(k) >= 0;
a(k) >= 0;
end
cvx_end
error1 = abs(obj-sum_energy_old)/abs(obj);
p_old = p;
beta1_old = beta1;
a_old = a;
sum_energy_old = obj;
r1 = r1+1;
end
%
This is my code. When I run the code the result is unbounded
Successive approximation method to be employed.
For improved efficiency, SeDuMi is solving the dual problem.
SeDuMi will be called several times to refine the solution.
Original size: 357 variables, 30 equality constraints
3 exponentials add 24 variables, 15 equality constraints
Cones | Errors |
Mov/Act | Centering Exp cone Poly cone | Status
--------±--------------------------------±--------
2/ 2 | 8.000e+00 1.253e+01 0.000e+00 | Unbounded
1/ 1 | 8.000e+00 2.306e+00 0.000e+00 | Unbounded
0/ 0 | 0.000e+00 0.000e+00 0.000e+00 | Unbounded
Status: Infeasible
Optimal value (cvx_optval): +Inf
I think more of the problem was the LMI constrains。when I remove the LMI constraints, the code can run well. How should I handle it