问题遇到的现象和发生背景
cvx的SDP问题,我在约束条件中想写凸函数小于等于一个实数
问题相关代码,请勿粘贴截图
rk=1e-5;
M1=h_BI'*theta0'*(h_I1'*h_I1)*theta0*h_BI;
M2=h_BI'*theta0'*(h_I2'*h_I2)*theta0*h_BI;
W1t=eye(Nt,Nt);
W2t=eye(Nt,Nt);
Zxt=eye(Nt,Nt);
cvx_begin sdp
variables W1x(Nt,Nt) W2x(Nt,Nt)
variable Zx(Nt,Nt) complex semidefinite
variable p13 nonnegative
variable p23 nonnegative
variable p14 nonnegative
variable p24 nonnegative
obj=-log(real(trace(Zx*M1))+sigmak^2+real(trace(M1*W1x))+real(trace(M1*W2x)))-log(real(trace(Zx*M2))+sigmak^2+real(trace(M2*W1x)))+real(trace(M2*W2x))-real(trace((-(1/log(2))*(M1/real((trace(Zxt*M1))+sigmak^2+real(trace(M1*W2t)))+M2/(real(trace(Zxt*M2))+sigmak^2+real(trace(M2*W1t)))))'*Zx))-real(trace((-(1/log(2))*M2/(real(trace(Zxt*M2))+sigmak^2+real(trace(M2*W1t))))'*W1x))-real(trace((-(1/log(2))*M1/real((trace(Zxt*M1))+sigmak^2+real(trace(M1*W2t))))'*W2x))-re;
minimize obj
subject to
trace(W1x)+trace(Zx)<=P;
trace(W2x)+trace(Zx)<=P;
-log(real(trace(Zx*M1))+sigmak^2+real(trace(M1*W1x))+real(trace(M1*W2x)))-log(real(trace(Zx*M2))+sigmak^2+real(trace(M2*W1x))+real(trace(M2*W2x)))-real(trace((-(1/log(2))*(M1/(real(trace(Zxt*M1))+sigmak^2+real(trace(M1*W2t)))+M2/real((trace(Zxt*M2))+sigmak^2+real(trace(M2*W1t))))))'*(Zx-Zxt))-real(trace((-(1/log(2))*M2/real((trace(Zxt*M2))+sigmak^2+real(trace(M2*W1t)))))'*(W1x-W1t))-real(trace((-(1/log(2))*M1/real((trace(Zxt*M1))+sigmak^2+real(trace(M1*W2t)))))'*(W2x-W2t))<=-rk;
[sigmak^2*(2^(re)-1)-p13,zeros(1,M_irs);zeros(M_irs,1),p13*epsilong_e^(-2)*eye(M_irs)]+(S3*theta0*h_BI)*((2^(re)-1)*Zx-W1x)*((S3*theta0*h_BI)')>=0;
[sigmak^2*(2^(re)-1)-p23,zeros(1,M_irs);zeros(M_irs,1),p23*epsilong_e^(-2)*eye(M_irs)]+(S3*theta0*h_BI)*((2^(re)-1)*Zx-W2x)*((S3*theta0*h_BI)')>=0;
[sigmak^2*(2^(re)-1)-p14,zeros(1,M_irs);zeros(M_irs,1),p14*epsilong_e^(-2)*eye(M_irs)]+(S4*theta0*h_BI)*((2^(re)-1)*Zx-W1x)*((S4*theta0*h_BI)')>=0;
[sigmak^2*(2^(re)-1)-p24,zeros(1,M_irs);zeros(M_irs,1),p24*epsilong_e^(-2)*eye(M_irs)]+(S4*theta0*h_BI)*((2^(re)-1)*Zx-W2x)*((S4*theta0*h_BI)')>=0;
Zx>=0;
W1x>=0;
W2x>=0;
cvx_end
运行结果及报错内容
出错 main (第 105 行)
-log(real(trace(Zx*M1))+sigmak^2+real(trace(M1*W1x))+real(trace(M1*W2x)))-log(real(trace(Zx*M2))+sigmak^2+real(trace(M2*W1x))+real(trace(M2*W2x)))-real(trace((-(1/log(2))*(M1/(real(trace(Zxt*M1))+sigmak^2+real(trace(M1*W2t)))+M2/real((trace(Zxt*M2))+sigmak^2+real(trace(M2*W1t))))))'*(Zx-Zxt))-real(trace((-(1/log(2))*M2/real((trace(Zxt*M2))+sigmak^2+real(trace(M2*W1t)))))'*(W1x-W1t))-real(trace((-(1/log(2))*M1/real((trace(Zxt*M1))+sigmak^2+real(trace(M1*W2t)))))'*(W2x-W2t))<=-rk;
出错内容:
SDP constraint {matrix} <= {scalar} valid only if the scalar is zero.
我的解答思路和尝试过的方法
我把实数移到不等式左边,让整体小于等于0,但是报错为:Both sides of an SDP constraint must be affine.
我想要达到的结果
不报错