The optimal value is NaN using Mosek

I’m using cvx tools with Mosek 10.1 to solve the following problem.

    cvx_solver  mosek;
    cvx_precision high
    cvx_begin
    variable w_n(M,1) complex;
    variable w_c(M,1) complex;
    variable w_p(M,N_user) complex;
    variable common_rate(N_user,1) nonnegative;
    variable rho_p(N_user,1) nonnegative;
    variable Gamma_n(N_user,1) nonnegative;
    variable Gamma_c(N_user,1) nonnegative;
    variable Gamma_p(N_user,1) nonnegative;
    minimize( sum_square( common_rate + rho_p - user_demand ) )
    subject to
    % power constraint
    sum_square_abs(w_n) + sum_square_abs(w_c)+ sum(sum_square_abs(w_p)) <= transmit_power_W;
    
    common_rate >= 0;
    rho_p   >= 0;
    Gamma_n >= 0;
    Gamma_c   >= 0;
    Gamma_p   >= 0;
    
    for k=1:N_user 
        sum(common_rate) <= log(1 + Gamma_c(k)) / log(2); 
        rho_p(k) <= log(1 + Gamma_p(k)) / log(2); 
        SINR_n_th <= Gamma_n(k); 
    end
    
    for k=1:N_user
        Hk = ChannelGain(:,k) * ChannelGain(:,k)';   % M × M,Hermitian PSD
        
        I_n = 1e6*square_abs(ChannelGain(:,k)'*w_c);
        for j=1:N_user
            I_n = I_n + 1e6*square_abs(ChannelGain(:,k)'*w_p(:,j));
        end
        f_n = 1e6*(2 / Gamma_n_old(k))* real( w_n_old' * Hk * w_n )...
            -1e6*real(w_n_old' * Hk * w_n_old)/(Gamma_n_old(k)^2) * Gamma_n(k);
         f_n >= I_n + 1e6*noise_power;
         
         
         I_c=0;
        for j=1:N_user
            I_c = I_c + 1e6*square_abs(ChannelGain(:,k)'*w_p(:,j));
        end
        f_c = 1e6*(2 / Gamma_c_old(k))* real( w_c_old' * Hk * w_c )...
            -1e6*real(w_c_old' * Hk * w_c_old)/(Gamma_c_old(k)^2) * Gamma_c(k);
         f_c >= I_c + 1e6*noise_power;
         
       
        I_p=0;
        for j=1:N_user
            if j ~= k
                I_p = I_p + 1e6*square_abs(ChannelGain(:,k)'*w_p(:,j));
            end
        end
        f_p = 1e6*(2 / Gamma_p_old(k))* real( w_p_old(:,k)' * Hk * w_p(:,k) )...
            -1e6*real(w_p_old(:,k)' * Hk * w_p_old(:,k))/(Gamma_p_old(k)^2) * Gamma_p(k);
         f_p >= I_p + 1e6*noise_power;
    end
    cvx_end 

The output is

Calling Mosek 10.1.31: 5364 variables, 564 equality constraints
------------------------------------------------------------

MOSEK Version 10.1.31 (Build date: 2024-5-6 13:20:51)
Copyright (c) MOSEK ApS, Denmark WWW: mosek.com
Platform: Windows/64-X86

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

Optimizer started.
Presolve started.
Linear dependency checker started.
Linear dependency checker terminated.
Eliminator started.
Freed constraints in eliminator : 19
Eliminator terminated.
Eliminator - tries                  : 1                 time                   : 0.00            
Lin. dep.  - tries                  : 1                 time                   : 0.00            
Lin. dep.  - primal attempts        : 1                 successes              : 1               
Lin. dep.  - dual attempts          : 0                 successes              : 0               
Lin. dep.  - primal deps.           : 0                 dual deps.             : 0               
Presolve terminated. Time: 0.16    
GP based matrix reordering started.
GP based matrix reordering terminated.
Optimizer  - threads                : 14              
Optimizer  - solved problem         : the primal      
Optimizer  - Constraints            : 342             
Optimizer  - Cones                  : 171             
Optimizer  - Scalar variables       : 5296              conic                  : 5265            
Optimizer  - Semi-definite variables: 0                 scalarized             : 0               
Factor     - setup time             : 0.11            
Factor     - dense det. time        : 0.01              GP order time          : 0.00            
Factor     - nonzeros before factor : 7360              after factor           : 1.09e+04        
Factor     - dense dim.             : 0                 flops                  : 6.83e+06        
Factor     - GP saved nzs           : 4182              GP saved flops         : 6.83e+06        
ITE PFEAS    DFEAS    GFEAS    PRSTATUS   POBJ              DOBJ              MU       TIME  
0   3.9e+02  1.3e+00  8.7e+01  0.00e+00   1.000000000e+00   -8.477142802e+01  1.0e+00  0.52  
1   8.7e+01  2.9e-01  4.0e+01  -9.82e-01  4.446673964e+00   -7.538141055e+01  2.2e-01  0.77  
2   4.0e+01  1.3e-01  2.6e+01  -9.43e-01  2.865590629e+01   -4.470939180e+01  1.0e-01  0.78  
3   2.8e+01  9.1e-02  2.1e+01  -8.94e-01  1.052533570e+02   3.734482261e+01   7.0e-02  0.80  
4   1.2e+01  4.0e-02  1.4e+01  -9.29e-01  9.228711497e+01   3.843077580e+01   3.1e-02  0.81  
5   9.4e+00  3.1e-02  1.1e+01  -8.28e-01  6.711447803e+02   6.261015167e+02   2.4e-02  0.84  
6   3.2e+00  1.0e-02  5.4e+00  -7.41e-01  2.440754367e+03   2.440960454e+03   8.0e-03  0.86  
7   1.5e+00  4.8e-03  3.2e+00  -6.13e-01  4.554282421e+03   4.599999441e+03   3.7e-03  0.88  
8   7.0e-01  2.3e-03  1.1e+00  9.92e-02   1.299078725e+04   1.301547495e+04   1.8e-03  0.89  
9   2.8e-01  9.0e-04  5.8e-01  -2.87e-01  1.664355518e+04   1.670947765e+04   7.0e-04  0.91  
10  6.4e-02  2.1e-04  7.9e-02  5.38e-01   2.638191045e+04   2.640561958e+04   1.6e-04  0.94  
11  3.0e-02  9.7e-05  3.2e-02  5.06e-01   2.709382761e+04   2.711313041e+04   7.5e-05  0.95  
12  1.1e-02  3.7e-05  9.3e-03  5.86e-01   2.781640659e+04   2.782816246e+04   2.9e-05  0.97  
13  7.9e-03  2.6e-05  6.9e-03  2.51e-01   2.725729330e+04   2.727141593e+04   2.0e-05  0.98  
14  2.6e-03  8.5e-06  1.8e-03  4.08e-01   2.711551177e+04   2.712496961e+04   6.6e-06  1.00  
15  1.1e-03  3.7e-06  8.0e-04  3.53e-01   2.652707389e+04   2.653679473e+04   2.9e-06  1.03  
16  5.4e-04  1.8e-06  3.7e-04  3.01e-01   2.606890235e+04   2.607805617e+04   1.4e-06  1.05  
17  1.6e-04  5.3e-07  9.8e-05  2.86e-01   2.544267025e+04   2.545007661e+04   4.1e-07  1.06  
18  1.0e-04  3.3e-07  6.9e-05  1.05e-01   2.495183185e+04   2.496109659e+04   2.6e-07  1.08  
19  3.1e-05  1.0e-07  1.9e-05  1.75e-01   2.428163800e+04   2.428941460e+04   7.9e-08  1.11  
20  1.7e-05  5.5e-08  1.1e-05  1.39e-01   2.374759295e+04   2.375630207e+04   4.3e-08  1.12  
21  4.2e-06  1.4e-08  2.5e-06  1.76e-01   2.300412191e+04   2.301114380e+04   1.1e-08  1.14  
22  2.2e-06  7.3e-09  1.5e-06  2.90e-02   2.236367991e+04   2.237298536e+04   5.6e-09  1.16  
23  5.6e-07  1.8e-09  3.1e-07  2.13e-01   2.176120620e+04   2.176754520e+04   1.4e-09  1.17  
24  2.6e-07  8.4e-10  1.7e-07  -9.56e-03  2.100428169e+04   2.101333787e+04   6.5e-10  1.20  
25  7.3e-08  2.4e-10  3.9e-08  2.29e-01   2.049806974e+04   2.050391582e+04   1.9e-10  1.22  
26  3.5e-08  1.3e-10  2.2e-08  -3.70e-02  1.986358875e+04   1.987154952e+04   8.8e-11  1.23  
27  7.9e-09  1.1e-10  4.6e-09  8.87e-02   1.910457979e+04   1.911146626e+04   2.0e-11  1.27  
28  3.9e-09  2.9e-10  2.4e-09  1.02e-01   1.879069928e+04   1.879848568e+04   9.9e-12  1.30  
29  2.0e-09  4.9e-10  1.2e-09  5.33e-02   1.853666647e+04   1.854479316e+04   5.0e-12  1.31  
30  6.5e-10  2.1e-09  3.9e-10  4.72e-02   1.822770731e+04   1.823530560e+04   1.6e-12  1.33  
31  2.9e-10  4.5e-09  1.8e-10  5.16e-03   1.846536559e+04   1.847375455e+04   7.3e-13  1.36  
32  1.1e-10  5.3e-09  7.2e-11  -3.57e-02  1.897033327e+04   1.897940583e+04   2.7e-13  1.38  
33  5.4e-11  8.9e-09  3.9e-11  -1.79e-01  1.932552622e+04   1.933615165e+04   1.4e-13  1.39  
34  1.7e-11  2.8e-08  1.0e-11  6.93e-02   2.007571747e+04   2.008341463e+04   4.3e-14  1.41  
35  6.0e-12  6.6e-08  4.3e-12  -5.31e-02  2.059811863e+04   2.060865960e+04   1.5e-14  1.42  
36  1.7e-12  2.9e-07  1.0e-12  1.54e-01   2.148765880e+04   2.149524771e+04   4.2e-15  1.44  
37  6.0e-13  5.0e-07  4.1e-13  2.79e-03   2.208059180e+04   2.209044595e+04   1.5e-15  1.45  
38  1.9e-13  8.2e-07  1.2e-13  1.15e-01   2.286770451e+04   2.287573973e+04   4.8e-16  1.47  
39  5.6e-14  1.4e-06  3.7e-14  4.85e-02   2.364577196e+04   2.365471935e+04   1.4e-16  1.48  
40  2.1e-14  1.6e-06  1.4e-14  4.85e-02   2.429174191e+04   2.430114736e+04   5.3e-17  1.52  
41  7.3e-15  3.5e-06  4.7e-15  7.41e-02   2.503399447e+04   2.504296918e+04   1.8e-17  1.53  
42  2.6e-15  5.3e-06  1.8e-15  4.18e-02   2.572483162e+04   2.573444213e+04   6.6e-18  1.55  
43  9.3e-16  9.5e-06  6.2e-16  8.04e-02   2.647399479e+04   2.648300187e+04   2.4e-18  1.56  
44  3.5e-16  1.5e-05  2.3e-16  4.29e-02   2.715365568e+04   2.716330998e+04   8.8e-19  1.58  
45  1.2e-16  5.2e-06  8.1e-17  6.82e-02   2.791097751e+04   2.792033982e+04   3.2e-19  1.61  
46  4.7e-17  1.9e-06  3.1e-17  5.76e-02   2.862249224e+04   2.863208637e+04   1.2e-19  1.64  
47  1.7e-17  6.9e-07  1.2e-17  7.27e-02   2.939266413e+04   2.940205072e+04   4.2e-20  1.67  
48  1.1e-17  4.8e-07  6.2e-18  5.77e-02   2.966125878e+04   2.967078478e+04   2.9e-20  1.70  
49  3.6e-18  1.5e-07  1.4e-18  8.19e-02   3.054865316e+04   3.055756858e+04   9.2e-21  1.73  
50  1.3e-18  6.3e-08  7.5e-19  4.88e-02   3.130671145e+04   3.131636251e+04   3.2e-21  1.77  
51  4.3e-19  6.1e-08  4.6e-19  6.61e-02   3.211603892e+04   3.212593237e+04   1.1e-21  1.81  
52  1.7e-19  1.9e-07  1.0e-19  1.15e-01   3.280888372e+04   3.281790331e+04   4.4e-22  1.84  
53  5.7e-20  5.4e-07  3.9e-20  1.20e-01   3.359489769e+04   3.360349415e+04   1.4e-22  1.89  
54  4.8e-20  1.0e-06  7.0e-22  1.49e-01   3.370880705e+04   3.371727327e+04   1.2e-22  1.92  
55  4.8e-20  1.0e-06  6.4e-21  1.69e-01   3.370882102e+04   3.371728721e+04   1.2e-22  1.98  
56  4.8e-20  1.0e-06  6.4e-21  1.69e-01   3.370882102e+04   3.371728721e+04   1.2e-22  2.06  
57  4.8e-20  1.0e-06  2.7e-21  1.69e-01   3.371061114e+04   3.371907421e+04   1.2e-22  2.11  
58  4.8e-20  1.0e-06  2.7e-21  1.69e-01   3.371061114e+04   3.371907421e+04   1.2e-22  2.17  
59  4.7e-20  1.1e-06  2.4e-21  1.70e-01   3.371420033e+04   3.372265709e+04   1.2e-22  2.23  
60  4.7e-20  1.1e-06  3.6e-21  1.70e-01   3.371422835e+04   3.372268507e+04   1.2e-22  2.30  
61  4.7e-20  1.1e-06  3.6e-21  1.70e-01   3.371422835e+04   3.372268507e+04   1.2e-22  2.36  
62  4.7e-20  1.1e-06  3.6e-21  1.70e-01   3.371422835e+04   3.372268507e+04   1.2e-22  2.44  
Optimizer terminated. Time: 2.77    


Interior-point solution summary
  Problem status  : UNKNOWN
  Solution status : UNKNOWN
  Primal.  obj: 3.3714228353e+04    nrm: 2e+04    Viol.  con: 3e-04    var: 1e-02    cones: 0e+00  
  Dual.    obj: 3.3722685455e+04    nrm: 1e+12    Viol.  con: 0e+00    var: 3e+05    cones: 0e+00  
Optimizer summary
  Optimizer                 -                        time: 2.77    
    Interior-point          - iterations : 63        time: 2.52    
      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: Failed
Optimal value (cvx_optval): NaN

1e6 in the code is introduced to scale the LMI constraints and eliminate the Mosek warning 710 as shown in other topics of our forum. Also I have tried other solvers, but failed to have an ideal solution, such as inaccurate in SDPT3. I wonder why the optimal value is still NaN. Thanks for any advice.

Don’t use cvx_precision high. Stick with the default setting, no matter which solver you are using. When using Mosek, this may or may not result in CVX extracting a solution from Mosek. CVX is fussy in terms of accepting Mosek UNKNOWN for even an Inaccurate/Solvedstatus. A similar solver status for other solvers might result in CVX declaringInaccurate/Solved`. If you run the same problem with Mosek in YALMIP, I think YALMIP would extract a solution from Mosek and make it available to the user.

But the PRSTATUS from Mosek is not converging to 1 or -1; therefore it’s having great difficulty converging.

So your code is probably badly scaled numerically. Multiplying by 1e6 is probably a bad band-aid. The optimal primal and dual objective value of about 3e4 is rather high, and is not good. You should try to choose better units for the variables and input data so that non-zero data is within a small number of orders of magnitude of 1. You can look at the Mosek documentation 7 Practical optimization — MOSEK Modeling Cookbook 3.4.0 and also search for scaling on this forum.

Thank you so much, Mark! I have read the materials you recommended and the cvx problem can be solved. But I found new problem. I hope to get your help. The modified code is given as follows.

    cvx_begin
    variable w_n(M,1) complex;
    variable w_c(M,1) complex;
    variable w_p(M,N_user) complex;
    variable common_rate(N_user,1) nonnegative;
    variable rho_p(N_user,1) nonnegative;
    variable Gamma_n(N_user,1) nonnegative;
    variable Gamma_c(N_user,1) nonnegative;
    variable Gamma_p(N_user,1) nonnegative;
    minimize( sum_square( common_rate + rho_p - user_demand ) ) % relaxed objective
    %minimize 0
    subject to
    
    sum_square_abs(w_n) + sum_square_abs(w_c)+ sum(sum_square_abs(w_p)) <= transmit_power_W;
    
    common_rate >= 0;
    rho_p   >= 0;
    Gamma_n >= 0;
    Gamma_c   >= 0;
    Gamma_p   >= 0;
    
    for k=1:N_user 
        sum(common_rate) <= bandwidth_MHz*log(1 + Gamma_c(k)) / log(2);  % rate constraint 1
        rho_p(k) <= bandwidth_MHz*log(1 + Gamma_p(k)) / log(2);  % rate constraint 2
        SINR_n_th <= Gamma_n(k); 
    end
    
    for k=1:N_user
        hk = 1e5*ChannelGain(:,k);
        Hk = hk * hk';   % M × M,Hermitian PSD

        
        u_n = hk'*w_c;
        for j=1:N_user
            %I_n = I_n + 1e10*square_abs(ChannelGain(:,k)'*w_p(:,j));
            u_n = [u_n hk'*w_p(:,j)];
        end
        f_n =  (2 / Gamma_n_old(k))* real( w_n_old' * Hk * w_n )...
            - real(w_n_old' * Hk * w_n_old)/(Gamma_n_old(k)^2) * Gamma_n(k);
        u_n =  [u_n sqrt(scaled_noise_power )];
        norm([f_n-1e5 2*u_n], 2)<=f_n+1e5;

         
         u_c=0;
        for j=1:N_user
            u_c = [u_c hk'*w_p(:,j)];
        end
        u_c =  [u_c sqrt(scaled_noise_power )];
        f_c =  (2 / Gamma_c_old(k))* real( w_c_old' * Hk * w_c )...
            - real(w_c_old' * Hk * w_c_old)/(Gamma_c_old(k)^2) * Gamma_c(k);
         norm([f_c-1e5 2*u_c], 2)<=f_c+1e5;

        
        u_p=0;
        for j=1:N_user
            if j ~= k
                u_p = [u_p hk'*w_p(:,j)];
            end
        end
        u_p =  [u_p sqrt(scaled_noise_power )];
        f_p =  (2 / Gamma_p_old(k))* real( w_p_old(:,k)' * Hk * w_p(:,k) )...
            - real(w_p_old(:,k)' * Hk * w_p_old(:,k))/(Gamma_p_old(k)^2) * Gamma_p(k);
         norm([f_p-1e5 2*u_p], 2) <= f_p+1e5; 
    end
    cvx_end
    w_new = [w_n,w_c,w_p];
    
     [SINR_new, rate_new] = calc_SINR_rate(ChannelGain, w_new, noise_power, bandwidth_MHz);
    ranging_error_new = calc_ranging_error(SINR_new(:,1), bandwidth_MHz);
    obj_value_t = sum((common_rate + rate_new(:,3) - user_demand).^2); % real objective
    obj_sca_t = cvx_optval;
    gap = obj_sca(end)-obj_sca_t;
    object_value = [object_value obj_value_t];
    fprintf('SOCP - Iteration %3d | Objective value = %.6e\n', t, obj_value_t/(bandwidth_MHz^2));

Now the cvx program can be solved. The output is as follows.

MOSEK Version 10.1.31 (Build date: 2024-5-6 13:20:51)
Copyright (c) MOSEK ApS, Denmark WWW: mosek.com
Platform: Windows/64-X86

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

Optimizer started.
Presolve started.
Linear dependency checker started.
Linear dependency checker terminated.
Eliminator started.
Freed constraints in eliminator : 21
Eliminator terminated.
Eliminator - tries                  : 1                 time                   : 0.00            
Lin. dep.  - tries                  : 1                 time                   : 0.02            
Lin. dep.  - primal attempts        : 1                 successes              : 1               
Lin. dep.  - dual attempts          : 0                 successes              : 0               
Lin. dep.  - primal deps.           : 0                 dual deps.             : 0               
Presolve terminated. Time: 0.06    
GP based matrix reordering started.
GP based matrix reordering terminated.
Optimizer  - threads                : 14              
Optimizer  - solved problem         : the primal      
Optimizer  - Constraints            : 361             
Optimizer  - Cones                  : 45              
Optimizer  - Scalar variables       : 5070              conic                  : 5034            
Optimizer  - Semi-definite variables: 0                 scalarized             : 0               
Factor     - setup time             : 0.05            
Factor     - dense det. time        : 0.02              GP order time          : 0.00            
Factor     - nonzeros before factor : 1.00e+04          after factor           : 3.80e+04        
Factor     - dense dim.             : 0                 flops                  : 1.23e+07        
Factor     - GP saved nzs           : -228              GP saved flops         : 6.88e+06        
ITE PFEAS    DFEAS    GFEAS    PRSTATUS   POBJ              DOBJ              MU       TIME  
0   1.0e+05  1.3e+00  1.3e+01  0.00e+00   1.000000000e+00   -1.127142802e+01  1.0e+00  0.20  
1   2.3e+04  3.0e-01  6.4e+00  -1.00e+00  4.295242875e+00   -4.681519015e+00  2.3e-01  0.38  
2   4.4e+03  5.6e-02  2.8e+00  -1.00e+00  2.287740288e+01   3.246009115e+01   4.4e-02  0.41  
3   8.9e+02  1.2e-02  1.3e+00  -1.00e+00  1.129000328e+02   2.117308557e+02   8.9e-03  0.42  
4   1.2e+02  1.5e-03  4.6e-01  -9.99e-01  8.691962242e+02   1.691955696e+03   1.2e-03  0.44  
5   1.7e+01  2.2e-04  1.7e-01  -9.89e-01  6.860891533e+03   1.247251139e+04   1.7e-04  0.45  
6   4.8e+00  6.2e-05  8.1e-02  -8.98e-01  1.970707880e+04   3.552648761e+04   4.8e-05  0.45  
7   2.3e+00  3.0e-05  3.8e-02  -5.04e-01  1.115532058e+04   2.688701281e+04   2.3e-05  0.47  
8   1.2e+00  1.5e-05  1.1e-02  3.69e-01   2.088416400e+03   7.051910836e+03   1.2e-05  0.48  
9   2.5e-01  3.3e-06  6.8e-04  9.82e-01   3.277956094e+03   3.686163179e+03   2.5e-06  0.50  
10  1.5e-01  1.9e-06  3.1e-04  1.36e+00   9.679739075e+02   1.213306677e+03   1.5e-06  0.52  
11  7.7e-02  1.0e-06  1.2e-04  1.25e+00   9.882783723e+02   1.134140929e+03   7.7e-07  0.53  
12  3.3e-02  4.3e-07  3.6e-05  1.13e+00   1.285372459e+02   1.970573581e+02   3.3e-07  0.55  
13  9.3e-03  1.2e-07  5.8e-06  1.07e+00   8.864076198e+01   1.105324055e+02   9.3e-08  0.56  
14  3.0e-03  3.9e-08  1.1e-06  1.02e+00   4.659400473e+00   1.195888314e+01   3.0e-08  0.58  
15  6.6e-05  8.2e-10  3.4e-09  1.01e+00   4.364104807e-01   5.940083247e-01   6.4e-10  0.59  
16  2.2e-06  1.8e-11  1.1e-11  1.00e+00   2.018262363e-02   2.362949773e-02   1.4e-11  0.61  
17  6.0e-07  1.8e-12  3.5e-13  1.00e+00   2.428142860e-03   2.775739640e-03   1.4e-12  0.62  
18  1.1e-07  8.2e-14  3.3e-15  9.98e-01   1.179446361e-04   1.336130130e-04   6.3e-14  0.64  
19  1.4e-09  1.0e-15  4.7e-18  9.99e-01   1.540657151e-06   1.737443431e-06   7.9e-16  0.69  
20  4.9e-12  1.1e-16  7.5e-22  1.00e+00   4.618521091e-09   5.196969303e-09   2.3e-18  0.72  
Optimizer terminated. Time: 0.88    


Interior-point solution summary
  Problem status  : PRIMAL_AND_DUAL_FEASIBLE
  Solution status : OPTIMAL
  Primal.  obj: 4.6185211211e-09    nrm: 1e+05    Viol.  con: 8e-08    var: 0e+00    cones: 0e+00  
  Dual.    obj: 5.1969693025e-09    nrm: 1e+00    Viol.  con: 0e+00    var: 2e-12    cones: 0e+00  
Optimizer summary
  Optimizer                 -                        time: 0.88    
    Interior-point          - iterations : 20        time: 0.75    
      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: Solved
Optimal value (cvx_optval): +4.61852e-09
 
SOCP - Iteration   1 | Objective value = 1.508403e+00

In my variables, rho_p and Gamma are the relaxation variable introduced to deal with the nonconvex terms, such as the data rate and the SINR. In rate constraint 1 and 2 as I commented in the code, I think the optimization progress will drive the rho_p in the cvx objective to get close to user_demand/bandwidth_MHz-common_rate, and the both sides of sum(common_rate) <= bandwidth_MHz*log(1 + Gamma_c(k)) / log(2); rho_p(k) <= bandwidth_MHz*log(1 + Gamma_p(k)) / log(2); should be equal at the optimal solution. But the result isn’t what I expected. There is gap between the left side and right side, which leads to the different output of the relaxed objective and the real objective.

Optimal value (cvx_optval): +4.61852e-09

SOCP - Iteration   1 | Objective value = 1.508403e+00

What’s wrong with my code? How can I minimize the gap between the rate demand and the achivable rate?? I really really appreciate your help!!!

According to Mosek, your problem was solved to optimality. The optimal objective value is within tolerance of zero, i.e, Mosek found a solution in which all N_user elements of

common_rate + rho_p are equal to user_demand .

If that is not what you expect, there is a deficiency in your model or expectation. I have no idea what your application is, what the purpose of your optimization model is, or why you expect what you expect, so I won’t comment on why the solution doesn’t meet your expectations. If you relax constraints, it is possible that the argmin of the relaxed problem will not satisfy one or more of the omitted constraints.

Thank you, Mark! I’ll think about your suggestion carefully.