# {convex} .* {complex affine}

It is confusing what are supposed to be optimization variables as opposed to input data. Please make that clear; and then prove that optimization problem is convex. The problem you entered into CVX is not convex.

In the future, please copy and paste code using Preformatted, text icon ,rather than posting an image.

clc;clear;
sigmaB=10e-6;
sigmaE=10e-6;
sigma_BR = 1/2; %基站到RIS处信道的增益（基础值）
sigma_RU = 1/2; %RIS到用户信道的增益（基础值）
sigma_BU = 1/2; %基站到用户信道的增益（基础值）
rho = 10^(-100/10); %自干扰抑制因子
rho1=4; %路径损耗系数
rho2=2.5; %与RIS相关的路径损耗系数
element=50;
hAB = channel_Rayleigh2(rho1,sqrt(110110+1010),sigma_BU,1,8); %A天线数M=8，产生LOS径的信道系数，大尺度衰落
hAE = channel_Rayleigh2(rho1,sqrt(110110+1010),sigma_BU,1,8);
hAI = channel_Rayleigh2(rho2,sqrt(55+100100),sigma_BR,element,8); %A到RIS的信道系数A,天线数M=8,元件数40个，大尺度衰落
hIB = channel_Rayleigh2(rho2,sqrt(585+1010),sigma_RU,1,element); %RIS到用户的信道系数,元件数40个，大尺度衰落
hIE = channel_Rayleigh2(rho2,sqrt(15
15+1010),sigma_RU,1,element); %RIS到E的信道系数,元件数40个，大尺度衰落
hEI = channel_Rayleigh2(rho2,sqrt(15
15+1010),sigma_RU,element,1); %E到RIS的信道系数,元件数40个，大尺度衰落
hEE = channel_Rayleigh1(sigma_BR,1,1);%小尺度衰落
Pj=1;
w=hAB’/norm(hAB’); %波束成形矩阵w
WB=w
(w’);
hB1=hABww’hAB’/sigmaB;
hE1=hAE
ww’hAE’/sigmaE;
GB=(1/sigmaB).
[diag(hIB’)hAIw
w’hAI’(diag(hIB’))’ diag(hIB’)hAIww’hAB’; hABww’hAI’(diag(hIB’))’ 0];
GE=(1/sigmaE).[diag(hIE’)hAIww’hAI’(diag(hIE’))’ diag(hIE’)hAIww’hAE’; hAEww’hAI’(diag(hIE’))’ 0];

X=problem(GB,GE,hB1,hE1,element)

function [X]=problem(GB,GE,hB1,hE1,element)
cvx_begin
variable S(element+1,element+1) complex; %定义变量
variable X
variable mu1
mu1=pow_p(real(trace(GBS))+hB1+1,-1);
y=eye(element+1);
maximize real(trace(GE
(mu1S))+mu(hE1+1))
subject to %添加约束条件
real(trace(GB*(mu1S))+mu(hB1+1))==1;
real(trace(Y*(mu1*S))) <= mu;
cvx_end
end

function [h] = channel_Rayleigh1(sigma,N,L)
%函数功能：产生只含小尺度衰落的瑞利信道
hs = 1/sqrt(2)randn(N,L) + 1i1/sqrt(2)randn(N,L); %小尺度衰落
h = sigma
hs;
end
function [h] = channel_Rayleigh2(rho,d,sigma,N,L)
%函数功能：产生含大尺度衰落的瑞利信道
d0 = 1; %参考距离为1m
PL0 = -20; %-20dB
PL_dB = - 10rholog10(d/d0); %大尺度衰落
PL_1 = 10^(PL0/10); %转化成绝对单位
PL_2 = 10^(PL_dB/10);
PL = PL_1PL_2; %大尺度衰落,绝对单位
hs = 1/sqrt(2)randn(N,L) + 1i1/sqrt(2)randn(N,L); %小尺度衰落
h = sigma
PL
hs;
end