Status:Inaccurate/Solved How to solve it?

The program can be run.But Status: Inaccurate/Solved!
I can’t figure out why the result I get has status inaccurate/solved.
I have the following optimization problem:


clc
N=6;
alpha=2;
Nuncached=3;%不在UAV上缓存
Ndatauav=3;

a11=randperm(N,Nuncached);
theta=rand(1,N);%UAV-users bandwidth allocation
ita=rand(1,N);
%initial location
[x_server,y_server,x,y]=userlocation(N);
[c,ita]=randcache(N,Nuncached,a11);%cache

Q_users=zeros(N,2);
for i=1:N
Q_users(i,1)=x(i);
Q_users(i,2)=y(i);
end
Q_server=[x_server,y_server];

R=200;
x_u1=2Rrand-R;
y_u1=2Rrand-R;
step_size=0.5;
%final=zeros(1,M);
%for epoch=1:M
Q_u1=[x_u1,y_u1];

cvx_begin
cvx_solver sedumi

variable Q_u(1,2)
variable e(1,N)
variable w(1,N)
variable T
expression Zlb(1,N) 
expression Ilb(1,N)
a=randdataprocess(N,Ndatauav);

B=10^6;

%input data
I=10+5rand(1,N);
for i=1:N
I(i)=I(i)
(10^3);
end
O=zeros(1,N);
for i=1:N
O(i)=I(i)alpha;
end
%CPUcycles
F=500+300
rand(1,N);
%users compute resource
f_local=0.5+0.5rand(1,N);
for i=1:N
f_local(i)=f_local(i)
(10^9);
end
f=1+5rand(1,N);
for i=1:N
f(i)=f(i)
(10^9);
end
[q,q1]=computebound(N,theta,ita);
Hu=150;
for i=1:N
Ilb(i)= theta(i)Blog2(1+q(i)/(pow_pos(norm((Q_users(i,:)-Q_u1),2),2)+Hu^2))+ theta(i)Bq(i)(-1)(pow_pos(norm((Q_users(i,:)-Q_u),2),2)-pow_pos(norm((Q_u1-Q_users(i,:)),2),2)) /((pow_pos(norm((Q_u1-Q_users(i,:)),2),2)+Hu^2+q(i))(pow_pos(norm((Q_u1-Q_users(i,:)),2),2)+Hu^2)log(2));
%Ilb(i)=theta(i)Blog2(1+q(i)/((x_u1-x(i))^2+(y_u1-y(i))^2+Hu^2))-(theta(i)Bq(i)
((pow_pos(x_u-x(i),2)+pow_pos(y_u-y(i),2))-((x_u1-x(i))^2+(y_u1-y(i))^2))/(((x_u1-x(i))^2+(y_u1-y(i))^2+Hu^2+q(i))
((x_u1-x(i))^2+(y_u1-y(i))^2+Hu^2)*log(2)));
end

for j=1:length(a11)
     i=a11(j); 
     Zlb(i)= ita(i)*B*log2(1+q1(i)/(pow_pos(norm((Q_server-Q_u1),2),2)+Hu^2))+ ita(i)*B*q1(i)*(-1)*(pow_pos(norm((Q_server-Q_u),2),2)-pow_pos(norm((Q_u1-Q_server),2),2)) /((pow_pos(norm((Q_u1-Q_server),2),2)+Hu^2+q1(i))*(pow_pos(norm((Q_u1-Q_server),2),2)+Hu^2)*log(2));
     %Zlb(i)=ita(i)*B*log2(1+q1(i)/((x_u1-x_server)^2+(y_u1-y_server)^2+Hu^2))-(ita(i)*B*q1(i)*(pow_pos((x_u-x_server),2)+pow_pos((y_u-y_server),2)-((x_u1-x_server)^2+(y_u1-y_server)^2)))/(((x_u1-x_server)^2+(y_u1-y_server)^2+Hu^2+q1(i))*((x_u1-x_server)^2+(y_u1-y_server)^2+Hu^2)*log(2));
end
for i=1:N
    p(i)=(a(i)*I(i)*F(i))/f(i)+((1-a(i))*I(i)*F(i))/f_local(i);
end

obj_function=T;
minimize(obj_function);
subject to
    for i =1:N
        (a(i)*O(i)+(1-a(i))*I(i))*inv_pos(e(i))+ (1-c(i))*I(i)*inv_pos(w(i))<=T-p(i);
    end
    for i=1:N
        Ilb(i)>=e(i);
    end
    for i=1:Nuncached
        Zlb(i)>=w(i);
    end  
    T>0;

cvx_end
disp(Q_u)

Show us the CVX and solver output. Try using Mosek as solver if available, which might help a lot given log(CVX expression) in your program.

Your problem is not reproducible because you have not provided all the input data.

Now I provide all the the input data,the code can run.and I use ‘-rel_entr’ to replace ‘log’,but the status is still ‘Failed’.

clc
N=6;
alpha=2;
Nuncached=3;%不在UAV上缓存
Ndatauav=3;

a11=[4,5,6];
theta=rand(1,N);%UAV-users 带宽分配
ita=rand(1,N);
%用户位置 无人机初始位置
%[x_server,y_server,x,y]=userlocation(N);
x_server = 56.3668;
y_server = -78.1902;
x =[163.7582    9.4731  -45.9419  105.1414   52.7677  135.9346];
y =[-195.4635   60.1381   59.7208   30.2744  -88.7184  -29.2660];
%[c,ita]=randcache(N,Nuncached,a11);%缓存策略
c = [0     0     0     1     1     1];
ita =[0    0   0    0.8224    0.3482    0.1655];
Q_users=zeros(N,2);
for i=1:N
    Q_users(i,1)=x(i);
    Q_users(i,2)=y(i);
end
Q_server=[x_server,y_server];

M=5;%迭代次数
R=200;
x_u1=2*R*rand-R;
y_u1=2*R*rand-R;
step_size=0.5;
final=zeros(1,M);
 
Q_u1=[x_u1,y_u1];

cvx_begin   
    cvx_solver sedumi
    cvx_precision low %设置精度
    %换求解器
    variable Q_u(1,2)
    variable e(1,N)
    variable w(1,N)
    variable T nonnegative
    expression Zlb(1,N) %可以使用“=”的临时变量,在完成cvx后其值清零
    expression Ilb(1,N)
    %a=randdataprocess(N,Ndatauav);
    a=[0 1 0 1 0 1];

    B=10^6;
%输入数据
    I=10+5*rand(1,N);%均匀分布
    for i=1:N
        I(i)=I(i)*(10^3);
    end
%经UAV处理后的输出数据
    O=zeros(1,N);
    for i=1:N
        O(i)=I(i)*alpha;
    end
%CPU轮数
    F=500+300*rand(1,N);
%用户计算资源
    f_local=0.5+0.5*rand(1,N);
    for i=1:N
        f_local(i)=f_local(i)*(10^9);
    end
    f=1+5*rand(1,N);
    for i=1:N
        f(i)=f(i)*(10^9);
    end
    %[q,q1]=computebound(N,theta,ita);
 
    B=10^6;
    p=0.5;
    Hu=150;
    beta0=10^-5;
    delta2=-169 ;
    q=zeros(1,N);
    q1=zeros(1,N);
    for i=1:N
        q(i)=(p*beta0)/(theta(i)*10^(-13.9));
        q1(i)=(p*beta0)/(ita(i)*10^(-13.9));  
    end
    Hu=150;
    for i=1:N
        Ilb(i)= theta(i)*B*(-rel_entr(1,(1+q(i)/(pow_pos(norm((Q_users(i,:)-Q_u1),2),2)+Hu^2)))/log(2))+ theta(i)*B*q(i)*(-1)*(pow_pos(norm((Q_users(i,:)-Q_u),2),2)-pow_pos(norm((Q_u1-Q_users(i,:)),2),2)) /((pow_pos(norm((Q_u1-Q_users(i,:)),2),2)+Hu^2+q(i))*(pow_pos(norm((Q_u1-Q_users(i,:)),2),2)+Hu^2)*log(2));
        %Ilb(i)=theta(i)*B*log2(1+q(i)/((x_u1-x(i))^2+(y_u1-y(i))^2+Hu^2))-(theta(i)*B*q(i)*((pow_pos(x_u-x(i),2)+pow_pos(y_u-y(i),2))-((x_u1-x(i))^2+(y_u1-y(i))^2))/(((x_u1-x(i))^2+(y_u1-y(i))^2+Hu^2+q(i))*((x_u1-x(i))^2+(y_u1-y(i))^2+Hu^2)*log(2))); 
    end

    for j=1:length(a11)
         i=a11(j); 
         Zlb(i)= ita(i)*B*(-rel_entr(1,(1+q1(i)/(pow_pos(norm((Q_server-Q_u1),2),2)+Hu^2)))/log(2))+ ita(i)*B*q1(i)*(-1)*(pow_pos(norm((Q_server-Q_u),2),2)-pow_pos(norm((Q_u1-Q_server),2),2)) /((pow_pos(norm((Q_u1-Q_server),2),2)+Hu^2+q1(i))*(pow_pos(norm((Q_u1-Q_server),2),2)+Hu^2)*log(2));
         %Zlb(i)=ita(i)*B*log2(1+q1(i)/((x_u1-x_server)^2+(y_u1-y_server)^2+Hu^2))-(ita(i)*B*q1(i)*(pow_pos((x_u-x_server),2)+pow_pos((y_u-y_server),2)-((x_u1-x_server)^2+(y_u1-y_server)^2)))/(((x_u1-x_server)^2+(y_u1-y_server)^2+Hu^2+q1(i))*((x_u1-x_server)^2+(y_u1-y_server)^2+Hu^2)*log(2));
    end
    for i=1:N
        p(i)=(a(i)*I(i)*F(i))/f(i)+((1-a(i))*I(i)*F(i))/f_local(i);
    end


%分解为N个子问题
    obj_function=T;
    minimize(obj_function);
    subject to
        for i =1:N
            (a(i)*O(i)+(1-a(i))*I(i))*inv_pos(e(i))+ (1-c(i))*I(i)*inv_pos(w(i))<=T-p(i);
        end
        for i=1:N
            Ilb(i)>=e(i);
            e(i)>=0;
        end
        for i=1:Nuncached
            Zlb(i)>=w(i);
            w(i)>=0;
        end  
        T>=0;
       
cvx_end
disp(T)
disp(Q_u)

the ouput is below.


I try using the Mosek.but the results are wrong too.I don’t know how to solve?Please help me! Thank you!

Remove cvx_precision low

If the first for loop or 3rd for loop of constraints are removed, the problem is solved to optimality by Mosek. If just the 2nd for loop of constrains is removed, the problem is reported infeasible by Mosek (whether or not the objective is removed).

If the objective is removed, Mosek and SDPT3 report it as infeasible (solver reports duel infeasible, but CVX provides it the dual, so CVX concludes it is primal infeasible).

Some of the input numbers are further from order of magnitude one than desirable. That may contribute to unreliability of the solution process.

With objective removed, SeDuMi claims to have solved to optimality, i.e., found a feasible solution. But Mosek and SDPT3 deem it infeasible.

Here is the Mosek output when solving the original problem without cvx_precision low and with the objective removed.

Calling Mosek 10.0.20: 134 variables, 63 equality constraints
For improved efficiency, Mosek is solving the dual problem.

MOSEK Version 10.0.25 (Build date: 2022-10-6 10:58:19)
Copyright © MOSEK ApS, Denmark WWW: mosek.com
Platform: Windows/64-X86

Problem
Name :
Objective sense : minimize
Type : CONIC (conic optimization problem)
Constraints : 63
Affine conic cons. : 0
Disjunctive cons. : 0
Cones : 30
Scalar variables : 134
Matrix variables : 0
Integer variables : 0

Optimizer started.
Presolve started.
Linear dependency checker started.
Linear dependency checker terminated.
Eliminator started.
Freed constraints in eliminator : 30
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.06
Optimizer terminated. Time: 0.17

Interior-point solution summary
Problem status : DUAL_INFEASIBLE
Solution status : DUAL_INFEASIBLE_CER
Primal. obj: -2.0000000000e+00 nrm: 9e+07 Viol. con: 0e+00 var: 0e+00 cones: 5e-09
Optimizer summary
Optimizer - time: 0.17
Interior-point - iterations : 0 time: 0.08
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: Infeasible
Optimal value (cvx_optval): +Inf