After bringing the solution obtained by cvx back to the original formula, a solution that is not in the feasible area is obtained (cvx_optval has a certain degree of difference from the recalculated value)

The file: File(execute the main_testing.m)

I use some simple function I created. So I uploaded the whole folder for executing.

clear; close all; clc;
rng(13)
%% initialize parameters
basic = struct(‘K’,2,‘M’,2,‘U’,4,‘N’,10); % K: #bs / M: #uav / U: #user / N: period

pos.H = 30;
pos.q_bs = zeros(basic.K,2);
pos.q_bs = [0,0;200,200];
pos.q_uav = [pos.q_bs(:,:,1) pos.H*ones(basic.M,1)];
pos.q_uav = repmat(pos.q_uav,[1,1,basic.N]);
pos.q_us = 200 * round(rand(basic.U,2),1);

scale = 6;
power.P_max = 0.1*10^(scale);
power.p_m = power.P_max * ones(basic.M,basic.N);
power.p_k = 0.2 *10^(scale);
power.noise = -140 + pow2db(10^(scale));

bw.bs = 40 * ones(basic.K,basic.N);
bw.uav = 20 * ones(1,basic.N);

pl.xi = 0; % shadowing effect coefficient (dB)
pl.epsilon = 3.50; % path-loss exponent
pl.rho = -60; % the reference channel gain at the distance d0 = 1 m (dB)
pl.d0 = 1; % the reference distance (m)
pl.fc = 5e9; % operation frequency (Hz)

cache.F = 10; % #file
cache.ava = 3;
cache.size = 3; % uav cache size
cache.r = init_cache(basic,cache,‘user’);
cache.c = init_cache(basic,cache,‘uav’);

usera.alpha = init_association(basic,‘uav’);
usera.beta = init_association(basic,‘bs’);
%% CJCT
R = r_net_u(power,basic,pos,pl,usera,bw);

h = h_um(basic,pos,pl);
uavpower = power.p_m;
s_um = zeros(basic.U,basic.M,basic.N);
for u = 1 : basic.U
for m = 1 : basic.M
for n = 1:basic.N
interference = power.p_m(:,n)’ * h(u,:,n)’ - power.p_m(m,n) * h(u,m,n);
s_um(u,m,n) = h(u,m,n) * log2(exp(1)) / ( interference + db2pow(power.noise) );
end
end
end

r_bs = sum( rate_bs(power,basic,pos,pl,usera,bw) , 2);
r_bs = reshape(r_bs,basic.U,basic.N);

cvx_begin
cvx_solver mosek
% cvx_precision low

variable eta
variable uavpower(basic.M,basic.N)

expression r_hat_ub(basic.U,basic.M,basic.N)
expression r_lb(basic.U,basic.M,basic.N)
expression r_hat_ub(basic.U,basic.M,basic.N)
expression r_net(basic.U,1)
expression r_uav(basic.U,basic.N)
expression first_term(basic.U,basic.M,basic.N)

second_term = zeros(basic.U,basic.M,basic.N);
for u = 1 : basic.U
    for m = 1 : basic.M
        for n = 1:basic.N
            first_term(u,m,n) = ( s_um(u,:,n) * ( uavpower(:,n) - power.p_m(:,n) ) ) - ( s_um(u,m,n) * ( uavpower(m,n) - power.p_m(m,n) ) );
            second_term(u,m,n) = log2( h(u,:,n) * power.p_m(:,n)  - h(u,m,n) * power.p_m(m,n) + db2pow(power.noise) );
        end
    end
end

r_hat_ub = first_term + second_term;

for u=1:basic.U
    for m=1:basic.M
        for n=1:basic.N
            r_lb(u,m,n) = ( log( h(u,:,n) * uavpower(:,n) + db2pow(power.noise) ) / log(2) ) - r_hat_ub(u,m,n);
        end
    end
end

for u=1:basic.U
    for n=1:basic.N
        r_uav(u,n) = usera.alpha(u,:,n) * bw.uav(n)  * r_lb(u,:,n).';
    end
end

r_net = sum( (r_uav + r_bs), 2);

maximize(eta)

subject to
    eta <= r_net ;
    0 <= uavpower <= power.P_max;

cvx_end
power.p_m = uavpower;
power.p_m = round(power.p_m,4);
r_net_u_sp2 = r_net_u(power,basic,pos,pl,usera,bw);
eta = min(r_net_u_sp2);
disp([‘Improvment: ‘,num2str(eta-min(R)),’(Mbps)’]); % for test

I want to solve the following problem:
image


I think I coding everything right, even I tried to scale the variables properbly. However, the answer wasn’t right sometimes.

For example, my origin min. rate is 1026.2 Mbps (there are four users).
and after using cvx to allocate the uav power, it tells me that new min power is 1221 Mbps.
So for cvx, it did improve the min rate.
But when I bring back the new uav power to my formulate which can compute the rate for each user, it tell me that the min rate is 989.6 Mbps. This value is lower than the original. It didn’t make sense because cvx did give me the improment of min rate. What did it go on?

Please show the CVX and solver output,. and the calculations you performed after CVX completed, as well as how these calculations show that something is not correct.

If SCA and various approximations are used in your overall algorithm, the performance and accuracy of SCA and these approximations is out of scope of this forum; and it is your responsibility to figure out as a subject matter expert and someone trying to implement a method in a paper. If the solution of a CVX problem does not appear correct relative to the problem CVX is provided, perhaps CVX forum readers can provide some help.

This is the output of cvx

Calling Mosek 9.1.9: 161 variables, 64 equality constraints

MOSEK Version 9.1.9 (Build date: 2019-11-21 11:34:40)
Copyright (c) MOSEK ApS, Denmark. WWW: mosek.com
Platform: Windows/64-X86

Problem
Name :
Objective sense : min
Type : CONIC (conic optimization problem)
Constraints : 64
Cones : 20
Scalar variables : 161
Matrix variables : 0
Integer variables : 0

Optimizer started.
Presolve started.
Linear dependency checker started.
Linear dependency checker terminated.
Eliminator started.
Freed constraints in eliminator : 0
Eliminator terminated.
Eliminator started.
Freed constraints in eliminator : 0
Eliminator terminated.
Eliminator - tries : 2 time : 0.00
Lin. dep. - tries : 1 time : 0.00
Lin. dep. - number : 0
Presolve terminated. Time: 0.00
Problem
Name :
Objective sense : min
Type : CONIC (conic optimization problem)
Constraints : 64
Cones : 20
Scalar variables : 161
Matrix variables : 0
Integer variables : 0

Optimizer - threads : 12
Optimizer - solved problem : the primal
Optimizer - Constraints : 24
Optimizer - Cones : 21
Optimizer - Scalar variables : 82 conic : 62
Optimizer - Semi-definite variables: 0 scalarized : 0
Factor - setup time : 0.00 dense det. time : 0.00
Factor - ML order time : 0.00 GP order time : 0.00
Factor - nonzeros before factor : 80 after factor : 80
Factor - dense dim. : 0 flops : 8.00e+02
ITE PFEAS DFEAS GFEAS PRSTATUS POBJ DOBJ MU TIME
0 2.8e+09 1.3e+00 1.7e+01 0.00e+00 0.000000000e+00 -1.610204003e+01 1.0e+00 0.00
1 3.9e+08 1.8e-01 6.4e+00 -1.00e+00 1.297477496e+00 -8.674499973e+00 1.4e-01 0.00
2 2.4e+08 1.1e-01 5.0e+00 -1.00e+00 2.676428865e+01 2.132511029e+01 8.6e-02 0.00
3 1.3e+08 5.9e-02 3.6e+00 -9.99e-01 3.071930466e+02 3.120988501e+02 4.5e-02 0.00
4 7.2e+06 3.3e-03 8.6e-01 -9.98e-01 6.438075076e+03 6.802359808e+03 2.6e-03 0.00
5 6.0e+05 2.8e-04 2.3e-01 -9.70e-01 6.491881806e+04 6.866600918e+04 2.2e-04 0.00
6 1.9e+05 8.7e-05 7.7e-02 -5.19e-01 8.128235471e+04 8.581806006e+04 6.7e-05 0.00
7 5.8e+04 2.7e-05 1.3e-02 5.37e-01 2.140294613e+04 2.270925846e+04 2.1e-05 0.00
8 3.3e+04 1.5e-05 5.8e-03 8.32e-01 6.697388331e+03 7.518337381e+03 1.2e-05 0.00
9 6.8e+03 3.2e-06 5.2e-04 9.75e-01 -1.506026754e+03 -1.354554555e+03 2.5e-06 0.00
10 2.8e+03 1.3e-06 1.4e-04 9.99e-01 -9.040317564e+02 -8.372392001e+02 1.0e-06 0.00
11 4.9e+02 2.3e-07 1.1e-05 9.98e-01 -1.689260408e+03 -1.677088920e+03 1.8e-07 0.00
12 1.5e+02 6.9e-08 2.0e-06 8.79e-01 -1.715485866e+03 -1.710938972e+03 5.3e-08 0.00
13 7.8e+01 3.6e-08 9.8e-07 6.02e-01 -1.671273184e+03 -1.667095984e+03 2.8e-08 0.00
14 2.3e+01 1.1e-08 2.0e-07 6.26e-01 -1.605329897e+03 -1.603334923e+03 8.3e-09 0.00
15 1.0e+01 4.7e-09 9.8e-08 2.83e-01 -1.555750769e+03 -1.553246063e+03 3.6e-09 0.00
16 2.8e+00 1.3e-09 1.9e-08 5.00e-01 -1.476900485e+03 -1.475732685e+03 1.0e-09 0.00
17 1.1e+00 5.0e-10 7.3e-09 3.18e-01 -1.427441418e+03 -1.426222579e+03 3.9e-10 0.00
18 4.1e-01 1.9e-10 2.3e-09 4.19e-01 -1.375090112e+03 -1.374297252e+03 1.5e-10 0.00
19 2.6e-01 1.2e-10 1.7e-09 1.62e-01 -1.363834846e+03 -1.362694863e+03 9.4e-11 0.00
20 7.8e-02 3.6e-11 3.4e-10 4.32e-01 -1.302032317e+03 -1.301513696e+03 2.8e-11 0.00
21 3.0e-02 1.4e-11 1.1e-10 3.78e-01 -1.270109965e+03 -1.269712711e+03 1.1e-11 0.02
22 7.9e-03 3.7e-12 2.1e-11 6.06e-01 -1.242557155e+03 -1.242374695e+03 2.9e-12 0.02
23 3.2e-03 1.5e-12 6.7e-12 5.97e-01 -1.231588304e+03 -1.231473731e+03 1.2e-12 0.02
24 6.8e-04 3.2e-13 6.8e-13 9.16e-01 -1.223671911e+03 -1.223645811e+03 2.5e-13 0.02
25 1.1e-04 5.0e-14 4.5e-14 9.48e-01 -1.221541940e+03 -1.221537230e+03 3.8e-14 0.02
26 1.8e-05 8.2e-15 3.1e-15 9.74e-01 -1.221179581e+03 -1.221178769e+03 6.3e-15 0.02
27 2.1e-06 9.8e-16 1.3e-16 1.01e+00 -1.221111973e+03 -1.221111870e+03 7.9e-16 0.02
28 3.6e-07 1.7e-16 9.0e-18 1.00e+00 -1.221104043e+03 -1.221104025e+03 1.4e-16 0.02
29 1.0e-07 4.9e-17 1.6e-18 1.00e+00 -1.221102936e+03 -1.221102930e+03 3.9e-17 0.02
30 2.5e-08 1.2e-17 2.9e-19 1.00e+00 -1.221102576e+03 -1.221102575e+03 9.5e-18 0.02
31 4.9e-09 2.3e-18 3.4e-20 1.00e+00 -1.221102487e+03 -1.221102487e+03 1.8e-18 0.02
32 7.1e-10 3.3e-19 3.3e-21 1.00e+00 -1.221102470e+03 -1.221102470e+03 4.4e-19 0.02
Optimizer terminated. Time: 0.02

Interior-point solution summary
Problem status : PRIMAL_AND_DUAL_FEASIBLE
Solution status : OPTIMAL
Primal. obj: -1.2211024704e+03 nrm: 1e+05 Viol. con: 2e-04 var: 0e+00 cones: 0e+00
Dual. obj: -1.2211024704e+03 nrm: 1e+07 Viol. con: 0e+00 var: 8e-14 cones: 0e+00
Optimizer summary
Optimizer - time: 0.02
Interior-point - iterations : 32 time: 0.02
Basis identification - time: 0.00
Primal - iterations : 0 time: 0.00
Dual - iterations : 0 time: 0.00
Clean primal - iterations : 0 time: 0.00
Clean dual - iterations : 0 time: 0.00
Simplex - time: 0.00
Primal simplex - iterations : 0 time: 0.00
Dual simplex - iterations : 0 time: 0.00
Mixed integer - relaxations: 0 time: 0.00


Status: Solved
Optimal value (cvx_optval): +1221.1

And below figure is origin rate for four user:
image
it show it improved around 200 mbps
and after I put the new uav power to the formula, it shows like below
image
the min rate is 989 mbps, so the improvement is -36 Mbps
image

I don’t understand what the results you show mean, or how you obtained them. you need to show us mathematical formulas and calculations, because the forum readers can’t be expected to understand the subject matter.

As for the solution, you did not show the beginning of the solver (Mosek) output, including whether it issued any warnings. The norm of the solution is rather large, and suggests bad scaling, which potentially might contribute to any “discrepancies” you have observed.

I edit the reply to show the entire output. And I use first order Taylor expansion to linearize the non convex expression (SINR). It will give me the lower bound of origin SNR as show in my post.

In this problem, I want to adjust the uav power to max the minimum user rate of all users. However, when I put the new uav power obtained by cvx, it give me poor result sometimes for unkown reason. The weird thing is the cvx_opt give me the good result and reasonable rate(i.e. it improves the min rate)

If CVX and the solver it calls solve the problem provided to CVX, that is all you can expect from CVX. The relation between the problem you really want to solve, and the approximation to that problem which is provided to CVX, is not CVX"s responsibility. If you use a lousy approximation, that is your business, or perhaps something you can take up with the paper’s author(s). If linearizations of non-convex expressions were always highly accurate, the field of non-convex optimization could be replace with the algorithm: linearize all non-convex expressions and use convex optimization. In general that does not always work well.

In your formula (9), the pij[n] of pj[n]-pij[n] is fixed, and this value in the SCA algorithm should be the value of the last iteration?