Hi,
I am trying to use matlab to implement the following algorithm. CVXQUAD has installed and the log formats have been replaced.
However, the following problems appear after the code runs:
(1) The results still indicate that the successive approximation method to be employed…
(2) The status of the output is failed and the optimal value is NAN.
I would really appreciate if anybody has a solution for this.
The algorithm is
The matlab code is
clc
N=2;
p=[0.25;0.25];
p_hor=1e+02;
p_loc=1;
sigma_2=9.99e-10;
order_b=[2;1];% pi_b in the algorithm
order_e=[2;1];% pi_e in the algorithm
H_ub=[2.36e-09;2.51e-09];
H_ue=[2.18e-09;2.47e-09];
iteration=1;
for iteration=1:10
for n=1:N
inter_b(n,1)=sigma_2;
for i=1:N
if order_b(n,1)<order_b(i,1)
inter_b(n,1)=inter_b(n,1)+p(i)*H_ub(i,1);
end
end
s_bu(n,1)=1/inter_b(n,1);
bre_R_b(n,1)=-rel_entr(1,p(n)*H_ub(n,1)+inter_b(n,1))-prod_inv([s_bu(n,1) inter_b(n,1)])-rel_entr(1,s_bu(n,1))+1;
end
for n=1:N
inter_e(n,1)=sigma_2;
for i=1:N
if order_e(n,1)<order_e(i,1)
inter_e(n,1)=inter_e(n,1)+p(i)*H_ue(i,1);
end
end
s_eu(n,1)=1/(inter_e(n,1)+p(n)H_ue(n,1));
bre_R_e(n,1)=rel_entr(1,inter_e(n,1))+prod_inv([s_eu(n,1) (inter_e(n,1)+p(n)*H_ue(n,1))])+rel_entr(1,s_eu(n,1))-1;
end
bre_R_tot=sum(bre_R_b-bre_R_e)/(-rel_entr(1,2));
mu(iteration,1)=bre_R_tot/(sum§+N(p_loc+p_hor));
cvx_begin
variables p(N)
expressions bre_R_b(N) bre_R_e(N) inter_b(N) inter_e(N)
for n=1:N
inter_b(n,1)=sigma_2;
for i=1:N
if order_b(n,1)<order_b(i,1)
inter_b(n,1)=inter_b(n,1)+p(i)*H_ub(i,1);
end
end
bre_R_b(n,1)=-rel_entr(1,p(n)H_ub(n,1)+inter_b(n,1))-prod_inv([s_bu(n,1) inter_b(n,1)])-rel_entr(1,s_bu(n,1))+1;
end
for n=1:N
inter_e(n,1)=sigma_2;
for i=1:N
if order_e(n,1)<order_e(i,1)
inter_e(n,1)=inter_e(n,1)+p_tran(i)H_ue(i,1);
end
end
bre_R_e(n,1)=rel_entr(1,inter_e(n,1))+prod_inv([s_eu(n,1) (inter_e(n,1)+p(n)*H_ue(n,1))])+rel_entr(1,s_eu(n,1))-1;
end
maximize(sum(bre_R_b-bre_R_e)/(-rel_entr(1,2))-mu(iteration,1)(sum§+N(p_loc+p_hor)));
subject to
for n=1:N
bre_R_b(n,1)>=bre_R_e(n,1);
end
for n=1:N
bre_R_b(n,1)>=0;
end
for n=1:N
0<=p(n,1)<=0.25;
end
cvx_end
iteration=iteration+1;
end
The output result is the following statement repeated ten times
Successive approximation method to be employed.
For improved efficiency, SDPT3 is solving the dual problem.
SDPT3 will be called several times to refine the solution.
Original size: 44 variables, 16 equality constraints
2 exponentials add 16 variables, 10 equality constraints
Cones | Errors |
Mov/Act | Centering Exp cone Poly cone | Status
--------±--------------------------------±--------
0/ 0 | 0.000e+00 0.000e+00 0.000e+00 | Failed
0/ 0 | 0.000e+00 0.000e+00 0.000e+00 | Failed
0/ 0 | 0.000e+00 0.000e+00 0.000e+00 | Failed
Status: Failed
Optimal value (cvx_optval): NaN
Many thanks!