clear all
clc
arph_set=[0,0.5,1,1,2];
beta_set=[0,0.5,1,2,3];
P=20;%transmit power
N0=1;%spatial power spectral density N0
z0=4;% user location
A=(0.05:0.1:300);% IRS surface area
gama1=zeros(length(arph_set),length(A));
for i=1:length(arph_set)
arph=arph_set(i);
beta=beta_set(i);
N_=N0+4.^(beta-1).*P.*arph.*A.^(2.*beta)./((beta+1).*z0^2.*pi.^(beta+1));%equation (20) effective noise density with HWI
tau=A./z0;
cita=1./pi.*atan(tau.^2./(sqrt(2.*tau.^2+1)));
% calculate the offset of the utility
dN1=cita.*beta.*4.^(beta-0.5).*P.*arph.*A.^(2.*beta-1)./((beta+1).*z0.^2.*pi.^(beta+1).*N0+4.^(beta-1).*P.*arph.*A.^(2.*beta));
%e calculate the utility
gama1(i,:)=P./(8.*A.*(N_+cita.*P)).*(2*tau./(pi.*z0.*sqrt(2.*tau.^2+1).*(tau.^2+1))-dN1);
end
figure(1)
sizeType={‘^’,’<','*','o','s'};
Color = linspecer(size(gama1,1));
for i=1:size(gama1,1)
semilogx(A',gama1(i,:)','-','LineWidth',1.5,'color',Color(i,:),'marker',sizeType{i});
hold on
end
xlabel('Surface-area A[m^2]')
ylabel('\gamma [nats/s/Hz/m^2]')
legend('w/o HWI','w. HWI,\alpha=\beta=0.5','w. HWI,\alpha=\beta=1','w. HWI,\alpha=1,\beta=2','w. HWI,\alpha=2,\beta=3','Location','northwest');
grid on