Dear All,
I have been stuck in a problem as follows:
I am going to maximize the following objective function in general form: x^2/y which is convex, so I used its lower bound to maximize, I mean I used first order Taylor series to approximate the objective function in the form of: 2x_val/y(x-x_val) - x_val^2/y/y*(y-y_val). (here x_val or y_val means that the value of last iteration t-1 must be used in this optimization t.
So, with this in mind I wrote the matlab code as follows:
% clc;
clear;
numOfUEs = 5;
numOfSBSs = 4;
numOfRBs = 10;
K1 = numOfRBs/2;
K2 = K1;
alpha = 2;
P_ULmax = 1e2;
% addpath āC:\cvx\functions\vec_ā
% savepath
%% Defining Variables
cvx_begin
cvx_solver mosek
variable y(numOfSBSs+1,numOfUEs,K1) nonnegative;
%% Defining Channel Matrices
SBS_location = [0.1 0.1;0.1 0.3; 0.3 0.1; 0.3 0.3];
UE_location = [0.0557597145674108,0.197592856063670;0.0829642546609909,0.185015446946940;0.0638408106727841,0.0851067236893036;0.216014006493015,0.136464498512740;0.153685530284463,0.1595177896501347];
MBS_location = [.2,.2];
% h(i,j,n) channel between Tx i and Rx j in RB n
h = ones(numOfSBSs+1,numOfUEs,K2);
%% Association Phase
% y(b,m,n)=1 it means that UE m connected to BS b in UL in RB n
p_ul = P_ULmax*ones(numOfSBSs+1,numOfUEs,K2);
% cvx_precision best
for iterations = 1:10
if iterations ==1
y_val = 1/K2/(numOfSBSs+1)*ones(size(y));
else
cvx_begin
cvx_solver mosek
variable y(numOfSBSs+1,numOfUEs,K1);
end
expression sinr_ul(numOfSBSs+1,numOfUEs,K2);
for n=1:K2 % number of Resource Blocks in UL
for b=1:numOfSBSs+1
for m=1:numOfUEs
expression Interference;expression linearTerm(numOfSBSs+1,numOfUEs);
Interference = cvx(1);
Interference_val = (1);
for b_p=1:numOfSBSs+1
for m_p=1:numOfUEs
if b~=b_p && m~=m_p
% Interference = Interference + y(b_p,m_p,n)*p_ul(b_p,m_p,n)*abs(h(b,m_p,n)).^2;
linearTerm(b_p,m_p) = p_ul(b_p,m_p,n)abs(h(b,m_p,n)).^2( y(b_p,m_p,n) - (y_val(b_p,m_p,n)));
Interference_val = Interference_val + y_val(b_p,m_p,n)*p_ul(b_p,m_p,n)abs(h(b,m_p,n)).^2;
else
linearTerm(b_p,m_p) = cvx(0);
end
end
end
sinr_ul(b,m,n) = (y_val(b,m,n)^2p_ul(b,m,n)abs(h(b,m,n)).^2/(Interference_val)) + ā¦
2y_val(b,m,n)p_ul(b,m,n)abs(h(b,m,n)).^2/(Interference_val)(y(b,m,n)-(y_val(b,m,n))) -ā¦
y_val(b,m,n)^2p_ul(b,m,n)abs(h(b,m,n)).^2/Interference_val/Interference_valsum(linearTerm(:));
end
end
end
Objective = sum(sinr_ul(:));
maximize(Objective)
subject to
0 <= y <= 1;
cvx_end
y_val = y;
end
The analysis on the formulas in optimization says that the y matrix should be in this form:
1 1 1 1 1;0 0 0 0 0;0 0 0 0 0; 0 0 0 0 0;0 0 0 0 0;
in each value of n in y(:,:,n).
BUT, after solving this optimization I get the following answer:
1 1 1 1 1;1 1 1 1 1;1 1 1 1 1;1 1 1 1 1;1 1 1 1 1;
Actually I have checked it in matlab also, which the objective function value is greater when we put mentioned analytically derived yās.
which also doesnāt maximize the objective function!!!
PLEASE if you find anything wrong in my code, let me know. I am debugging for almost one week and havenāt find anything.