Hi, Mark, I’ll show the output of mosek this time,You know,In my model, I want to observe the change in the total energy consumption (J) of the system as the value of K increases, which is my objective function. In my simulation experiment just now, K only increased to 3 (iter=2), then the problem showed an infeasible state. Can you help me see what might be wrong? In the following, I first gave the output message by mosek, then gave the program to call cvx to solve the problem, and finally gave the called program.
Calling Mosek 9.1.9: 128 variables, 61 equality constraints
For improved efficiency, Mosek is solving the dual problem.------------------------------------------------------------
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 : 61
Cones : 32
Scalar variables : 128
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 - tries : 1 time : 0.00
Lin. dep. - tries : 1 time : 0.02
Lin. dep. - number : 0
Presolve terminated. Time: 0.03
Problem
Name :
Objective sense : min
Type : CONIC (conic optimization problem)
Constraints : 61
Cones : 32
Scalar variables : 128
Matrix variables : 0
Integer variables : 0
Optimizer - threads : 2
Optimizer - solved problem : the dual
Optimizer - Constraints : 1
Optimizer - Cones : 32
Optimizer - Scalar variables : 96 conic : 96
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 : 1 after factor : 1
Factor - dense dim. : 0 flops : 1.21e+02
ITE PFEAS DFEAS GFEAS PRSTATUS POBJ DOBJ MU TIME
0 1.3e+00 2.2e+01 7.7e+00 0.00e+00 -8.665567086e+00 -2.825557343e-05 1.0e+00 0.05
1 1.9e-01 3.1e+00 2.7e+00 -8.86e-01 -1.281219119e+01 -1.469627065e-04 1.4e-01 0.16
2 5.4e-02 9.1e-01 1.3e+00 -8.84e-01 -2.350021625e+01 -4.522521056e-04 4.2e-02 0.17
3 1.6e-02 2.6e-01 7.2e-01 -8.99e-01 -6.647293726e+01 -1.489285667e-03 1.2e-02 0.17
4 3.0e-03 5.1e-02 2.8e-01 -9.20e-01 -2.549126365e+02 -6.748211881e-03 2.3e-03 0.17
5 1.4e-03 2.4e-02 1.8e-01 -8.25e-01 -4.390900660e+02 -1.397029864e-02 1.1e-03 0.19
6 5.2e-04 8.7e-03 1.2e-01 -8.92e-01 -1.407704433e+03 -3.629429828e-02 4.0e-04 0.19
7 1.7e-04 2.8e-03 6.4e-02 -9.78e-01 -4.184601863e+03 -1.109075233e-01 1.3e-04 0.19
8 6.1e-05 1.0e-03 3.3e-02 -9.14e-01 -8.339314206e+03 -2.663743644e-01 4.7e-05 0.20
9 2.3e-05 3.9e-04 1.7e-02 -8.42e-01 -1.587874569e+04 -6.371182135e-01 1.8e-05 0.20
10 5.9e-06 9.8e-05 7.6e-03 -8.06e-01 -4.818665635e+04 -2.236085978e+00 4.5e-06 0.22
11 1.6e-06 2.7e-05 3.4e-03 -7.67e-01 -1.297504560e+05 -7.240383509e+00 1.2e-06 0.22
12 5.5e-07 9.2e-06 1.7e-03 -7.02e-01 -2.678993753e+05 -1.902341549e+01 4.2e-07 0.22
13 2.0e-07 3.4e-06 9.8e-04 -7.36e-01 -6.700222137e+05 -4.780642041e+01 1.6e-07 0.22
14 7.2e-08 1.2e-06 4.3e-04 -6.58e-01 -9.908338310e+05 -1.106157038e+02 5.6e-08 0.23
15 2.0e-08 3.4e-07 2.0e-04 -6.21e-01 -2.819515723e+06 -3.353722230e+02 1.6e-08 0.23
16 7.3e-09 1.2e-07 6.9e-05 -3.80e-01 -2.497266448e+06 -6.725893835e+02 5.7e-09 0.25
17 2.5e-09 4.2e-08 3.6e-05 -4.49e-01 -5.716457509e+06 -1.574925838e+03 1.9e-09 0.25
18 3.7e-10 6.2e-09 1.8e-06 8.16e-02 -6.461665847e+05 -2.991847347e+03 2.8e-10 0.25
19 2.3e-10 3.9e-09 1.3e-06 -6.10e-01 -9.221866387e+05 -3.783466115e+03 1.8e-10 0.25
20 2.0e-10 3.3e-09 1.1e-06 1.22e+00 -8.114770991e+05 -3.925218608e+03 1.5e-10 0.27
21 3.0e-11 5.1e-10 5.7e-08 1.27e+00 -1.024980505e+05 -4.382861691e+03 2.4e-11 0.27
22 2.8e-12 4.7e-11 1.6e-09 1.02e+00 -1.335392882e+04 -4.465710922e+03 2.2e-12 0.28
23 6.0e-14 1.0e-12 4.7e-12 1.01e+00 -4.626110954e+03 -4.456392202e+03 4.7e-14 0.28
Optimizer terminated. Time: 0.33
Interior-point solution summary
Problem status : DUAL_INFEASIBLE
Solution status : DUAL_INFEASIBLE_CER
Primal. obj: -5.3077270987e-05 nrm: 5e-03 Viol. con: 6e-30 var: 3e-10 cones: 2e-13
Optimizer summary
Optimizer - time: 0.33
Interior-point - iterations : 23 time: 0.28
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
And my input parameters are as follows,
close all
T=1000;
N=4;
M=32;
B=5000000;
Bn=B/M;
T_real=T/Bn;%×Üʱ¼ä
[SNR_USV_BS,SNR_DF]=Multirelay_OFDMA_channelmodel_byhh(14,N,M,Bn);
J_opt=zeros(6,1);
J_greedy=zeros(6,1);
Rmin=15*T*ones(14,1);
for iter=1:6
K=2+iter-1;
alpha_eq=zeros(K,N+1,M);
for k=1:K
for n=1:N
for m=1:M
alpha_eq(k,n,m)=SNR_DF(k,n,m);
end
end
end
for k=1:K
for m=1:M
alpha_eq(k,N+1,m)=SNR_USV_BS(k,m);
end
end
L_three=zeros(K,N+1,M);
L_three(:,1:N,:)=T/2;
L_three(:,N+1,:)=T;
[J_greedy(iter),p_greedy,rho_greedy,L_off_greedy]=greedy_by_cvx(K,N,M,T_real,Rmin,alpha_eq,L_three);
And the called code is as follows,
function[J,p,rho,L_off_k]=greedy_by_cvx(K,N,M,T_real,R,alpha_eq,L_three)
J=0;%objective function
rho=newmodel_greedy(K,N+1,M,alpha_eq);
cvx_clear
cvx_begin
cvx_solver mosek
variable p(K,N+1,M);
expression L_off_k(K,1) ;
for k=1:K
for n=1:N+1
for m=1:M
J=J+T_real*rho(k,n,m)*p(k,n,m);
end
end
end
minimize(J)
for k=1:K
L_off_k(k)=0;
for n=1:N+1
for m=1:M
L_off_k(k)=L_off_k(k)+L_three(k,n,m)*log(1+rho(k,n,m)*p(k,n,m)*alpha_eq(k,n,m))/log(2);
end
end
end
subject to
for k=1:K
L_off_k(k)>=R(k);
end
p>=0;
cvx_end