An error occurred using mosek


Set rou_0 =10^(-60/10); However, under this setting, the above error will occur, if the increase of rou_0 can be solved, may I ask why?

clc;
clear;
close all;

H = 100;%
N_0 = 10^(-110/10)*1e-3;
rou_0 =10^(-60/10);%
sub_band = 51.2*1e6; %
max_power = 10^(20/10)*1e-3;%
min_power = 0;%

user_location = [x];
for i = 1:user_number
    user_location(i,1) = 2000*rand();
    user_location(i,2) = 2000*rand(); 
end

p_last_init = max_power * ones(UAV_number,1);
p_last = p_last_init;

for iter = 1:10
    interference = zeros(UAV_number,user_number);
    for k = 1:user_number
        m = find(lambda(:,k)==1);
        for j = 1:UAV_number
            if (j ~= m)
                h = rou_0 / norm(user_location(k,:)-UAV_location(j,:))^2;
                interference(j,k) = p_last(j)*h;
            else
                interference(j,k) = 0;
            end
        end
    end
cvx_begin
variable p(UAV_number) nonnegative
variable eta_max

cvx_solver('mosek')
expression r1(UAV_number,user_number)
expression Rub(user_number)
expression r2(UAV_number,user_number)
expression Rmk(user_number)

for k = 1:user_number
    m = find(lambda(:,k)==1);
    for j = 1:UAV_number
        if(j~=m)
            inter = 0;
            for l = 1:UAV_number
                if (l~=m)
                    h = rou_0 / norm(user_location(k,:)-UAV_location(l,:))^2;
                    inter = inter + p_last(j)*h;
                end
            end
            hkj = rou_0/norm(UAV_location(j,:)-user_location(k,:))^2;
            r1(j,k) = (hkj*log2(exp(1))/(inter+N_0))*(p(j)-p_last(j));
        else
            r1(j,k) = 0;
        end
    end
end

for k = 1:user_number
    Rub(k) = sum(r1(:,k)) + log2(sum(interference(:,k))+N_0);
end

for k = 1:user_number
    for j = 1:UAV_number
        hkj = rou_0/norm(UAV_location(j,:)-user_location(k,:))^2;
        r2(j,k) = p(j) * hkj;
    end
end


for k = 1:user_number
    m = find(lambda(:,k)==1);
    temp_num = sum(lambda(m,:));
    Rmk(k) = (sub_band/temp_num)*(log(sum(r2(:,k))+N_0)/log(2) - Rub(k))*1e3;
end

maximize(sum(Rmk))

subject to

    for j = 1:UAV_number
        p(j) <= max_power;
        p(j) >= 0;
    end

 cvx_end

p_last = p;

end

Your problem is not reproducible, Possibly among other things, you haven’t provided x. Maybe the x is a typo or formatting issue (which perhaps I inadvertently introduced), but you have not provided us with the value of `user_number or lots of other input data. And of course we don’t know your starting seed or random number generator options.

Random numbers are used to create user_location. Are you using the same values of user_location when you compare different values of rou_0 ?

You don’t show the complete CVX and solver output for both the unbounded cases and the other setting of rou_0 for which you say the problem was solved, nor do you provide us such a value of rou_0.

Are there difficulties for the solve due to numerical issues? I have no idea.

Are your bound constraints on p sufficient to keep the objective bounded? I haven’t worked through what those linkages are, and have no ideas whether you’re missing constraints.

And you appear to be running CVX inside a (SCA?) loop, although I’m not clear on exactly what is being looped, because the end statements don’t seem to match up - perhaps that’s is due to function ending end statements which don’t come out right when your code is appended as in your post? Perhaps the SCA itself is not stable, and for some values of inputs, eventually leads to an unbounded problem

You shouldn’t view my list of things as comprehensive.

Also, read Debugging unbounded models - YALMIP , which also applies to CVX.

Thank you for your reply! The following are executable programs that can be run when rou_0 = -30dB, but cannot be run under any user_location setting when rou_0 = -60dB. The picture is a reference for optimization problems.
clc;
clear;
close all;
center_frequency = 351e9;
H = 100;
N_0 = 10^(-110/10)1e-3;
rou_0 =10^(-60/10);
sub_band = 51.2
1e6;
max_power = 10^(20/10)1e-3;
min_power = 0;
UAV_number = 5;
user_number = 40;
user_location = [];
for i = 1:user_number
user_location(i,1) = 2000
rand();
user_location(i,2) = 2000
rand();
end
[idx,center_location] = kmeans(user_location,UAV_number);
UAV_location= center_location;
UAV_location(:,3) = H;
user_location(:,3) =0;
for n = 1:user_number
lambda(idx(n),n) = 1;
end

%% power_control
p_last = max_power * ones(UAV_number,1);
for iter = 1:10
interference = zeros(UAV_number,user_number);
for k = 1:user_number
m = find(lambda(:,k)==1);
for j = 1:UAV_number
if (j ~= m)
h = rou_0 / norm(user_location(k,:)-UAV_location(j,:))^2;
interference(j,k) = p_last(j)*h;
else
interference(j,k) = 0;
end
end
end

cvx_begin
variable p(UAV_number) nonnegative
variable eta_max

cvx_solver('mosek')
expression r1(UAV_number,user_number)
expression Rub(user_number)
expression r2(UAV_number,user_number)%计算pj*hkj
expression Rmk(user_number)

for k = 1:user_number
    m = find(lambda(:,k)==1);
    for j = 1:UAV_number
        if(j~=m)
            inter = 0;
            for l = 1:UAV_number
                if (l~=m)
                    h = rou_0 / norm(user_location(k,:)-UAV_location(l,:))^2;
                    inter = inter + p_last(j)*h;
                end
            end
            hkj = rou_0/norm(UAV_location(j,:)-user_location(k,:))^2;
            r1(j,k) = (hkj*log2(exp(1))/(inter+N_0))*(p(j)-p_last(j));
        else
            r1(j,k) = 0;
        end
    end
end

for k = 1:user_number
    Rub(k) = sum(r1(:,k)) + log2(sum(interference(:,k))+N_0);
end

for k = 1:user_number
    for j = 1:UAV_number
        hkj = rou_0/norm(UAV_location(j,:)-user_location(k,:))^2;
        r2(j,k) = p(j) * hkj;
    end
end

for k = 1:user_number
    m = find(lambda(:,k)==1);
    temp_num = sum(lambda(m,:));
    Rmk(k) = (sub_band/temp_num)*(log(sum(r2(:,k))+N_0)/log(2) - Rub(k))*1e-7;
end
maximize(sum(Rmk))
subject to
    for j = 1:UAV_number
        p(j) <= max_power;
        p(j) >= 0;
    end
 cvx_end
p_last = p;

end

You haven’t shown is the output. You haven’t shown us on what iteration the solution becomes unbounded (if that is indeed the nature of the “failure”).

I don’t know whether this SCA is appropriately bounded to prevent unbounded subproblems, but nevertheless, SCA can be very precarious, unreliable, and non-robust. NaN——Status: Infeasible Optimal value (cvx-optval): - Inf - #2 by Mark_L_Stone

Moreover, I have no idea whether you have correctly implemented the algorithm in the paper. Your code is rather complicated and I don’t know whether it is 'correct", but I wouldn’t be surprised f it is not. Even if it correctly implements the algorithm in the paper, it might not work for all starting values, input data, choice of solver, or whatever.

Thank you very much for your help. I will continue to modify the code with reference to your suggestions.