Why is it 'infeasible'?

B =  30e+6; % Bandwidth 30MHz xhu | 5MHz in others
T = 20; % Time process 10 seconds xhu
N = 10; % The  number of time slots   20 sysj | 50 in xhu
K = 6 ; % The number of IoRT devices    K  6 sysj | 4 in xhu, 16 in wcnc

radius = 300; % Radius of  The circular area    300m sysj
sigma2 = 1e-9 ; % Noise power -60dBm xhu = 1e-9 W
h_0 = db2pow(-30); % The channel gain at a reference distance of 1m  -30dB xhu = 0.001 W
G_0 = 2*db2pow(-30); % The channel gain at a reference distance of 1m  -30dB xhu = 0.001 W
G=1e-9;
H = 10; % The fixed height of the UAVs 10m xhu
H_m = 20; % The height of MEC device (antenna)   20m
H_s = 200e3; % height of the satellite = 200kms Sysj
V_max = 10; % The maximum speed of UAV   10m/s xhu
Q = 9.65; % The mass of UAV  9.65kg wcnc
Q_MEC = 9.65; % The mass of UAV  9.65kg wcnc
w_1 = 0.5; % The weight for the energy consumption of the UAVs   0.5 | 0.2 in xhu, wcnc
w_2 = 1 - w_1; % The weight for the energy consumption of The IoRT devices 1 xhu | 0.8 in wcnc

% L_k = zeros(K,1); % The task-input size of IoRT device  50 Mb - 300 Mb wcnc | 400Mb in xhu
threshold = 1e-4; % The error tolerance threshold   \epsilon  10^{-4} xhu

W_m = [0 0]; % Location of MEC




cottheta = cotd(30);

 
 
 L_k_min = 50;
 L_k_max = 450;
 
 iteration_graph = [];
 energy_transmission_graph = [];
 energy_flight_graph = [];
 energy_total_graph = [];
 
 Wkholdflag = 0;
 Lkholdflag = 0;
 circulartraj = 0;
 notraj = 0;
 comments = 1;
 
 
 
 % clear;
% run('parameters.m');
myObj = helper;

Delta = T/N; % Length of time slot 
 q = zeros(N, 1,2); % trajectorty given by q[n](x,y)
 h_DU = zeros(K,N); % Channel gain - device to UAV
 h_UM = zeros(N); % Channel gain - UAV to MEC
 h_US = zeros(N); % Channel gain - UAV to Satellite
 
 a = zeros(K,N); % connection scheduling
 delta = Delta / K; % duration of small time slot
 E_DU = zeros(K,N); % energy to transmit - device to UAV
 E_UM = zeros(K,N); % energy to transmit - UAV to MEC

 E_f = zeros(N); % energy to fly


% Trajectory initialization
R = radius; 
% R = radius/10; 



displacement = R;
theta=linspace(0,360,N); theta(end)=[];
i_x1=R/2*cosd(theta)+W_m(1,1)+displacement;
i_y1=R/2*sind(theta)+W_m(1,2)+displacement;
for n = 1:N-1
     q(n,1,1) = i_x1(n);
     q(n,1,2) = i_y1(n);
end  
q(N,1,1) = q(1,1,1);
q(N,1,2) = q(1,1,2);    

    

% W_k = [-2*R+rand(1,K)*4*R ;-2*R+rand(1,K)*4*R]';

if(Wkholdflag ~= 1)
    W_k = displacement+[-0.5*R+rand(1,K)*1*R ;-0.5*R+rand(1,K)*1*R]';
end

if(Lkholdflag ~= 1)
    L_k = L_k_min+rand(1,K)*L_k_max;
    L_k = round(L_k)'.* 1e6;
end

myObj.draw(q,W_k,W_m);
S_max = V_max * Delta;


dist = myObj.dist_DU(q, W_k,K,N);
h_DU = h_0 ./ (dist.^2 + H^2);
h_UM = h_0 ./ ( (dist_UM(myObj, q,W_m,N)).^2 + (H-H_m)^2 );
h_US = h_0 ./ (H_s-H)^2;
 
 
 
 
 
 
 
 
 







cvx_begin quiet
variable c_a(K,N) %binary; 
subq_E = 0;
ds_h = delta*sigma2/h_0;

 for k = 1:K
      for n = 1:N
          Z = ds_h*(2 ^( (L_k(k)/N) / (delta * B/2) ) - 1)* (H^2 + pow_pos(norm(reshape(q(n,:,:),[1 2]) -W_k(k,:),2),2));
        subq_E = subq_E +Z*c_a(k,n);
       end
    end

   minimize subq_E  
   0 <= c_a;
   c_a<= 1;
   sum(c_a,1) <= 1; %C1**

    H_cottheta = H *cottheta;
  for k = 1:K
      for n = 1:N
             c_a(k,n) * norm(reshape(q(n,:,:),[1 2]) -W_k(k,:),2) <= H_cottheta;
      end
  end 
  cvx_end

  a = c_a;
  if (comments == 1)
      display(['Sub1 is ' cvx_status '. The energy consumption: ' num2str(cvx_optval) ' Mbps.'])
    end
1 Like

Hi harshampc,

You mention it’s infeasible without any output. Can you share both your output results on SeDuMi and SDPT3 for the benefit of forum readers and moderators ??

Supra

Do not use the quiet option until everything is running properly.

Copy and paste your code using Preformatted text icon. Do not have ** at he beginning and end of every line of code.

Your code is not reproducible by anyone (including myself) not having the Signal Processing Toolbox. You ought to be able to crunch down the “raw inputs” yourself to make a version not requiring that toolbox.

Some of the input data looks like it could be of very high or low magnitude, although I don’t know what it looks like after all crunching down occurs. If the input data is too extreme, that could cause unreliable behavior in the solver, including feasibility determination. If you use Mosek as solver, it should issue warnings or error messages if the input data magnitudes are too extreme.

Do you really want the binary variable declaration, which is commented out?

Everything except section 1 in https://yalmip.github.io/debugginginfeasible also applies to CVX.