Hi, everyone. I got 3 different results from 3 solvers:MOSEK,SeDuMi,SDPT3 ,in a code with “rel_entr”, my code is the following:
N=150;
F=30;
I=6;
b0=10^(-60/10);
Pb=10^(43/10-3);
Pu=10^(23/10-3);
s0=[0,0,0];
s_i=10rand(I,3);
W_backhaul=20;
W_downlink=10;
N0=10^(-174/10);
m=10;
K=100;
r_if=ones(I,F);
vmax=30;
delta=1;
H=80;
q_n=10rand(N,3);
q0=ones(1,3);
b_ifn=ones(I,F,N);
a_ifn=ones(I,F,N);
c_f=zeros(F,1);
cvx_solver mosek
cvx_begin
variables W_backhaul_in(I,N) P_in(I,N) W_downlink_in(I,N) T_n(N) Rdown(I,N);
cnb=log(2)/log(1+b0*Pb./(W_backhaul*N0*sum((s0-q_n).^2,2)));
canshu3=[zeros(N-1,1) eye(N-1);zeros(1,N)]-eye(N);
canshu3(N,N)=0;
canshu=zeros(I,N);
canshu2=zeros(I,N);
canshu4=zeros(I,N);
zkk=0;zkk2=0;
for i=1:I
for n=1:N
for f=1:F
zkk=zkk+b_ifn(i,f,n)*(1-c_f(f,1))*a_ifn(i,f,n);
zkk2=zkk2+b_ifn(i,f,n)*a_ifn(i,f,n);
end
canshu(i,n)=zkk*log(2)/log(1+b0*Pb./(W_backhaul*N0*sum((s0-q_n(n,:)).^2,2)));zkk=0;
canshu2(i,n)=zkk2;zkk2=0;
canshu4(i,n)= 1/sum_square(s_i(i,:)-q_n(n,:));
end
end
minimize(sum(T_n))
subject to
sum(W_backhaul_in,1)' <= W_backhaul;
sum(W_downlink_in,1)' <= W_downlink;
sum(P_in,1)' <= Pu;
T_n >= max( canshu.*inv_pos(W_backhaul_in) + canshu2.* inv_pos( Rdown ) *log(2) ,[],1)';
Rdown <= (-1)*rel_entr(W_downlink_in, W_downlink_in+(b0/N0)*canshu4.*P_in) ;
T_n >= norms(canshu3*q_n,2,2)/vmax;
W_downlink_in >= 0;
P_in >= 0;
cvx_end
Here is Mosek result:
CVX Warning:
Models involving “rel_entr” or other functions in the log, exp, and entropy
family are solved using an experimental successive approximation method.
This method is slower and less reliable than the method CVX employs for
other models. Please see the section of the user’s guide entitled
The successive approximation method
for more details about the approach, and for instructions on how to
suppress this warning message in the future.
警告: 未来的版本中将会删除 NARGCHK。请改用 NARGINCHK 或 NARGOUTCHK。
In exponential (line 17)
In cvx/rel_entr (line 80)
In Untitled (line 55)
=====================================
Using Pade approximation for exponential
cone with parameters m=3, k=3
=====================================
Calling Mosek 9.1.9: 26850 variables, 12000 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 © MOSEK ApS, Denmark. WWW: mosek.com
Platform: Windows/64-X86
MOSEK warning 710: #2 (nearly) zero elements are specified in sparse col ‘’ (446) of matrix ‘A’.
MOSEK warning 710: #2 (nearly) zero elements are specified in sparse col ‘’ (4331) of matrix ‘A’.
Problem
Name :
Objective sense : min
Type : CONIC (conic optimization problem)
Constraints : 12000
Cones : 7200
Scalar variables : 26850
Matrix variables : 0
Integer variables : 0
Optimizer started.
Presolve started.
Linear dependency checker started.
Linear dependency checker terminated.
Eliminator started.
Freed constraints in eliminator : 2850
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.11
Problem
Name :
Objective sense : min
Type : CONIC (conic optimization problem)
Constraints : 12000
Cones : 7200
Scalar variables : 26850
Matrix variables : 0
Integer variables : 0
Optimizer - threads : 2
Optimizer - solved problem : the primal
Optimizer - Constraints : 8999
Optimizer - Cones : 7200
Optimizer - Scalar variables : 23849 conic : 21600
Optimizer - Semi-definite variables: 0 scalarized : 0
Factor - setup time : 0.03 dense det. time : 0.00
Factor - ML order time : 0.00 GP order time : 0.00
Factor - nonzeros before factor : 4.06e+04 after factor : 5.82e+04
Factor - dense dim. : 0 flops : 7.70e+05
ITE PFEAS DFEAS GFEAS PRSTATUS POBJ DOBJ MU TIME
0 3.0e+00 1.7e+09 3.0e+03 0.00e+00 3.032780354e+03 3.278035363e+01 1.0e+00 0.23
1 8.2e-01 4.7e+08 1.6e+03 -1.00e+00 2.757776121e+03 -2.395596411e+02 2.7e-01 0.52
2 2.7e-01 1.6e+08 3.5e+02 -1.00e+00 -1.428594517e+03 -2.575055670e+03 9.1e-02 0.56
3 4.1e-02 2.3e+07 1.3e+02 -1.00e+00 -2.588783138e+04 -2.697152885e+04 1.4e-02 0.64
4 1.1e-02 6.5e+06 7.1e+01 -1.00e+00 -9.965173788e+04 -1.005439617e+05 3.8e-03 0.70
5 2.3e-03 1.3e+06 8.0e+01 -1.00e+00 -5.034191265e+05 -5.050081576e+05 7.6e-04 0.72
6 5.9e-04 3.4e+05 4.1e+01 -1.00e+00 -1.945706779e+06 -1.943547583e+06 2.0e-04 0.81
7 1.5e-04 8.3e+04 3.0e+01 -1.00e+00 -7.909354389e+06 -7.893023451e+06 4.9e-05 0.83
8 5.6e-05 3.2e+04 1.8e+01 -1.00e+00 -2.039294953e+07 -2.034399163e+07 1.9e-05 0.86
9 1.3e-05 7.4e+03 8.8e+00 -9.99e-01 -8.899730743e+07 -8.876996540e+07 4.3e-06 0.88
10 3.7e-06 2.1e+03 4.7e+00 -9.97e-01 -3.068829680e+08 -3.060896335e+08 1.2e-06 0.91
Optimizer terminated. Time: 1.03
Interior-point solution summary
Problem status : DUAL_INFEASIBLE
Solution status : DUAL_INFEASIBLE_CER
Primal. obj: -3.8342208902e+02 nrm: 7e+04 Viol. con: 3e-05 var: 7e+04 cones: 6e-07
Optimizer summary
Optimizer - time: 1.03
Interior-point - iterations : 10 time: 0.92
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
Here is SDPT3 result:
CVX Warning:
Models involving “rel_entr” or other functions in the log, exp, and entropy
family are solved using an experimental successive approximation method.
This method is slower and less reliable than the method CVX employs for
other models. Please see the section of the user’s guide entitled
The successive approximation method
for more details about the approach, and for instructions on how to
suppress this warning message in the future.
警告: 未来的版本中将会删除 NARGCHK。请改用 NARGINCHK 或 NARGOUTCHK。
In exponential (line 17)
In cvx/rel_entr (line 80)
In Untitled (line 55)
=====================================
Using Pade approximation for exponential
cone with parameters m=3, k=3
=====================================
Calling SDPT3 4.0: 26850 variables, 12000 equality constraints
For improved efficiency, SDPT3 is solving the dual problem.
num. of constraints = 12000
dim. of sdp var = 14400, num. of sdp blk = 7200
dim. of linear var = 5250
SDPT3: Infeasible path-following algorithms
version predcorr gam expon scale_data
HKM 1 0.000 1 0
it pstep dstep pinfeas dinfeas gap prim-obj dual-obj cputime
0|0.000|0.000|6.9e+02|3.2e+01|4.9e+07| 1.433737e+05 0.000000e+00| 0:0:01| spchol 1 1
1|0.442|0.369|3.8e+02|2.0e+01|3.2e+07| 2.776319e+05 -1.003695e+04| 0:0:02| spchol 1 1
2|0.355|0.222|2.5e+02|1.6e+01|2.9e+07| 5.013593e+05 -2.406821e+04| 0:0:02| spchol 1 1
3|0.541|0.517|1.1e+02|7.7e+00|1.7e+07| 8.372919e+05 -6.217225e+04| 0:0:03| spchol 1 1
4|0.819|0.752|2.1e+01|1.9e+00|5.5e+06| 9.931271e+05 -9.483851e+04| 0:0:03| spchol 1 1
5|0.692|0.966|6.3e+00|7.6e-02|1.2e+06| 6.862235e+05 -8.194823e+04| 0:0:04| spchol 1 1
6|0.881|1.000|7.5e-01|7.8e-03|2.5e+05| 1.747625e+05 -4.151346e+04| 0:0:04| spchol 1 1
7|0.900|0.989|7.5e-02|3.9e-03|2.3e+04| 1.671461e+04 -4.399913e+03| 0:0:04| spchol 1 1
8|0.604|1.000|3.0e-02|8.0e-03|1.6e+04| 1.085278e+04 -2.479579e+03| 0:0:05| spchol 1 1
9|0.895|1.000|3.1e-03|2.2e-03|3.1e+03| 1.674946e+03 -9.299409e+02| 0:0:05| spchol 1 1
10|0.550|0.939|1.4e-03|8.6e-04|2.2e+03| 1.196736e+03 -6.078528e+02| 0:0:06| spchol 1 1
11|0.872|0.984|1.8e-04|3.3e-04|7.7e+02| 1.502621e+02 -5.192416e+02| 0:0:06| spchol 1 1
12|0.501|0.865|9.0e-05|8.8e-05|4.2e+02| 7.320034e+01 -2.829341e+02| 0:0:06| spchol 1 1
13|0.832|0.991|1.5e-05|2.2e-05|1.3e+02|-1.259486e+02 -2.377042e+02| 0:0:07| spchol 1 1
14|0.518|0.982|7.3e-06|4.2e-06|6.3e+01|-1.425211e+02 -1.826220e+02| 0:0:07| spchol 1 1
15|0.619|0.850|2.8e-06|2.3e-06|4.1e+01|-1.483151e+02 -1.735583e+02| 0:0:07| spchol 1 1
16|0.311|0.578|1.9e-06|1.6e-06|3.4e+01|-1.481115e+02 -1.667601e+02| 0:0:08| spchol 1 1
17|0.372|0.551|1.2e-06|1.1e-06|3.0e+01|-1.460661e+02 -1.597056e+02| 0:0:08| spchol 1 1
18|0.436|0.622|6.7e-07|6.6e-07|2.5e+01|-1.429901e+02 -1.542950e+02| 0:0:09| spchol 1 1
19|0.471|0.623|3.6e-07|3.8e-07|1.9e+01|-1.403958e+02 -1.472893e+02| 0:0:09| spchol 1 1
20|0.383|0.553|2.2e-07|2.4e-07|1.7e+01|-1.378068e+02 -1.429672e+02| 0:0:09| spchol 1 1
21|0.368|0.565|1.4e-07|1.5e-07|1.5e+01|-1.351514e+02 -1.379910e+02| 0:0:10| spchol 1 1
22|0.398|0.541|8.4e-08|9.7e-08|1.3e+01|-1.319399e+02 -1.350534e+02| 0:0:10| spchol 1 1
23|0.441|0.575|4.7e-08|5.8e-08|1.1e+01|-1.291054e+02 -1.305398e+02| 0:0:11| spchol 1 1
24|0.411|0.561|2.8e-08|3.5e-08|9.0e+00|-1.264492e+02 -1.270822e+02| 0:0:11| spchol 1 1
25|0.359|0.513|1.8e-08|2.2e-08|8.1e+00|-1.241161e+02 -1.237002e+02| 0:0:12| spchol 1 1
26|0.364|0.473|1.1e-08|1.5e-08|7.6e+00|-1.215947e+02 -1.216146e+02| 0:0:12| spchol 1 1
27|0.440|0.530|6.3e-09|9.4e-09|6.2e+00|-1.189989e+02 -1.184934e+02| 0:0:12| spchol 1 1
28|0.188|0.122|5.1e-09|9.5e-09|6.3e+00|-1.178572e+02 -1.179070e+02| 0:0:13| spchol 1 1
29|0.367|0.154|3.2e-09|9.0e-09|5.9e+00|-1.157997e+02 -1.171110e+02| 0:0:13| spchol 1 1
30|0.472|0.151|1.7e-09|8.4e-09|5.7e+00|-1.134813e+02 -1.161230e+02| 0:0:13| spchol 1 1
31|0.515|0.126|8.3e-10|7.7e-09|5.9e+00|-1.111541e+02 -1.152423e+02| 0:0:14| spchol 1 1
32|0.464|0.127|4.4e-10|7.0e-09|6.1e+00|-1.097651e+02 -1.146128e+02| 0:0:14| spchol 1 1
33|0.493|0.135|2.3e-10|6.3e-09|6.0e+00|-1.090022e+02 -1.142652e+02| 0:0:14| spchol 1 1
34|0.370|0.400|1.4e-10|3.9e-09|5.2e+00|-1.088869e+02 -1.135774e+02| 0:0:15| spchol 1 1
35|0.581|0.561|5.9e-11|1.9e-09|3.8e+00|-1.091639e+02 -1.127028e+02| 0:0:15| spchol 1 1
36|0.468|0.399|3.2e-11|1.2e-09|3.2e+00|-1.093328e+02 -1.123867e+02| 0:0:15| spchol 1 1
37|0.402|0.616|1.9e-11|5.6e-10|2.5e+00|-1.095313e+02 -1.119042e+02| 0:0:16| spchol 1 1
38|0.407|0.488|1.1e-11|3.3e-10|2.1e+00|-1.096685e+02 -1.117400e+02| 0:0:16| spchol 1 1
39|0.489|1.000|5.7e-12|2.2e-12|1.4e+00|-1.098886e+02 -1.113001e+02| 0:0:16| spchol 1 1
40|0.548|0.530|2.6e-12|2.2e-12|1.2e+00|-1.100822e+02 -1.112305e+02| 0:0:17| spchol 1 1
41|0.669|0.844|8.6e-13|1.4e-12|7.7e-01|-1.102853e+02 -1.110455e+02| 0:0:17| spchol 1 1
42|0.851|1.000|1.3e-13|1.0e-12|3.4e-01|-1.105004e+02 -1.108425e+02| 0:0:17| spchol 1 1
43|0.977|0.967|3.0e-14|1.1e-12|1.0e-02|-1.106768e+02 -1.106870e+02| 0:0:18| spchol 1 1
44|1.000|1.000|2.7e-14|1.0e-12|6.2e-04|-1.106810e+02 -1.106816e+02| 0:0:18| spchol 1 1
45|1.000|1.000|2.8e-14|1.0e-12|1.2e-05|-1.106813e+02 -1.106813e+02| 0:0:18| spchol 1 1
46|1.000|1.000|4.3e-14|1.0e-12|4.1e-07|-1.106813e+02 -1.106813e+02| 0:0:19|
stop: max(relative gap, infeasibilities) < 1.49e-08
number of iterations = 46
primal objective value = -1.10681269e+02
dual objective value = -1.10681270e+02
gap := trace(XZ) = 4.12e-07
relative gap = 1.85e-09
actual relative gap = 1.82e-09
rel. primal infeas (scaled problem) = 4.26e-14
rel. dual " " " = 1.04e-12
rel. primal infeas (unscaled problem) = 0.00e+00
rel. dual " " " = 0.00e+00
norm(X), norm(y), norm(Z) = 1.1e+02, 7.3e+10, 7.3e+10
norm(A), norm(b), norm© = 8.1e+02, 1.3e+01, 2.8e+02
Total CPU time (secs) = 18.53
CPU time per iteration = 0.40
termination code = 0
DIMACS: 2.8e-13 0.0e+00 1.4e-11 0.0e+00 1.8e-09 1.9e-09
Status: Solved
Optimal value (cvx_optval): +145.458
Here is SeDuMi result:
CVX Warning:
Models involving “rel_entr” or other functions in the log, exp, and entropy
family are solved using an experimental successive approximation method.
This method is slower and less reliable than the method CVX employs for
other models. Please see the section of the user’s guide entitled
The successive approximation method
for more details about the approach, and for instructions on how to
suppress this warning message in the future.
警告: 未来的版本中将会删除 NARGCHK。请改用 NARGINCHK 或 NARGOUTCHK。
In exponential (line 17)
In cvx/rel_entr (line 80)
In Untitled (line 55)
=====================================
Using Pade approximation for exponential
cone with parameters m=3, k=3
=====================================
Calling SeDuMi 1.3.4: 26850 variables, 12000 equality constraints
For improved efficiency, SeDuMi is solving the dual problem.
SeDuMi 1.3.4 by AdvOL, 2005-2008 and Jos F. Sturm, 1998-2003.
Alg = 2: xz-corrector, Adaptive Step-Differentiation, theta = 0.250, beta = 0.500
eqs m = 12000, order n = 19651, dim = 26851, blocks = 7201
nnz(A) = 61650 + 0, nnz(ADA) = 104400, nnz(L) = 71100
it : by gap delta rate t/tP t/tD* feas cg cg prec
0 : 1.67E+02 0.000
1 : 7.98E+01 4.41E+01 0.000 0.2643 0.9000 0.9000 7.60 1 1 5.3E+00
2 : -2.53E+01 1.91E+01 0.000 0.4340 0.9000 0.9000 1.17 1 1 2.8E+00
3 : -1.92E+02 1.07E+01 0.000 0.5620 0.9000 0.9000 0.52 1 1 2.2E+00
4 : -7.26E+02 2.76E+00 0.000 0.2573 0.9000 0.9000 0.75 1 1 5.3E-01
5 : -6.90E+02 7.43E-01 0.000 0.2689 0.9000 0.9000 0.65 1 1 1.7E-01
6 : -5.71E+02 2.19E-01 0.000 0.2950 0.9000 0.9000 0.70 1 1 6.5E-02
7 : -4.94E+02 7.64E-02 0.000 0.3486 0.9000 0.9000 0.60 1 1 3.1E-02
8 : -4.52E+02 3.32E-02 0.000 0.4341 0.9000 0.9000 0.53 1 1 1.8E-02
9 : -4.04E+02 1.13E-02 0.000 0.3402 0.9000 0.9000 0.42 1 1 9.9E-03
10 : -3.77E+02 4.78E-03 0.000 0.4238 0.9000 0.9000 0.36 1 1 6.7E-03
11 : -3.40E+02 1.42E-03 0.000 0.2961 0.9000 0.9000 0.27 1 1 4.1E-03
12 : -3.16E+02 4.92E-04 0.000 0.3474 0.9000 0.9000 0.22 1 1 3.0E-03
13 : -2.89E+02 1.38E-04 0.000 0.2806 0.9000 0.9000 0.19 2 2 2.0E-03
14 : -2.69E+02 1.75E-09 0.000 0.0000 0.9000 0.8571 0.17 2 2 2.5E-04
15 : -2.55E+02 7.14E-10 0.000 0.4076 0.9000 0.7862 0.18 5 2 1.5E-04
16 : -2.42E+02 2.81E-10 0.000 0.3932 0.8023 0.9000 0.18 5 5 9.1E-05
17 : -2.29E+02 9.41E-11 0.000 0.3352 0.9000 0.9000 0.17 5 4 4.9E-05
18 : -2.17E+02 3.42E-11 0.000 0.3638 0.9000 0.9000 0.17 4 4 2.8E-05
19 : -2.07E+02 1.24E-11 0.000 0.3625 0.9000 0.9000 0.17 4 4 1.6E-05
20 : -1.97E+02 3.80E-12 0.000 0.3064 0.9000 0.9000 0.15 4 4 8.2E-06
21 : -1.87E+02 1.22E-12 0.000 0.3208 0.9000 0.9000 0.15 4 4 4.4E-06
22 : -1.79E+02 3.74E-13 0.000 0.3064 0.9000 0.9000 0.14 6 6 2.3E-06
23 : -1.72E+02 1.28E-13 0.000 0.3434 0.9000 0.9000 0.14 14 14 1.3E-06
24 : -1.65E+02 4.18E-14 0.000 0.3254 0.9000 0.9000 0.14 13 13 7.1E-07
25 : -1.59E+02 1.46E-14 0.000 0.3489 0.9000 0.9000 0.13 15 15 4.1E-07
26 : -1.54E+02 5.29E-15 0.000 0.3629 0.9000 0.9000 0.13 21 14 2.4E-07
27 : -1.48E+02 1.61E-15 0.000 0.3037 0.9000 0.9000 0.13 16 16 1.2E-07
28 : -1.43E+02 5.61E-16 0.000 0.3495 0.9000 0.9000 0.11 22 16 7.2E-08
29 : -1.39E+02 1.85E-16 0.000 0.3297 0.9000 0.9000 0.12 17 18 3.9E-08
30 : -1.34E+02 5.54E-17 0.000 0.2993 0.9000 0.9000 0.12 26 23 2.0E-08
31 : -1.31E+02 2.00E-17 0.000 0.3608 0.9000 0.9000 0.11 26 26 1.2E-08
iter seconds digits cx by
31 11.3 Inf -1.3078322396e+02 -1.3078267434e+02
|Ax-b| = 3.8e-07, [Ay-c]_+ = 0.0E+00, |x|= 8.1e+01, |y|= 5.3e+08
Detailed timing (sec)
Pre IPM Post
4.610E-01 5.448E+00 5.600E-02
Max-norms: ||b||=1, ||c|| = 2.000000e+01,
Cholesky |add|=300, |skip| = 0, ||L.L|| = 2.63428e+08.
Status: Solved
Optimal value (cvx_optval): +163.94
I don’t know which one to use . And why is Mosek the worst one? Is it that I didn’t call it properly or install it wrong? Is it bad scaling?Thank you for your time.