What do these terms mean from mosek's output?

I got a falied from mosek and these terms from the output :
Primal. obj: -1.9773600018e+02 nrm: 9e+05 Viol. con: 2e-03 var: 5e-05 cones: 2e-07
Dual. obj: -2.0106543498e+02 nrm: 3e+06 Viol. con: 0e+00 var: 1e-02 cones: 0e+00
what does each term mean respectively? Is there any instructions or official documents? I remember they are important and mean something to why I failed. Thank you.
Complete output is the following, the code and related data for reproducing are too many so I omit it here for the moment :

Calling Mosek_2 9.3.10: 114587 variables, 42294 equality constraints
   For improved efficiency, Mosek_2 is solving the dual problem.
------------------------------------------------------------

MOSEK Version 9.3.10 (Build date: 2021-11-5 08:42:07)
Copyright (c) MOSEK ApS, Denmark. WWW: mosek.com
Platform: Windows/64-X86

MOSEK warning 710: #2 (nearly) zero elements are specified in sparse col '' (22) of matrix 'A'.
MOSEK warning 710: #2 (nearly) zero elements are specified in sparse col '' (26) of matrix 'A'.
MOSEK warning 710: #2 (nearly) zero elements are specified in sparse col '' (34) of matrix 'A'.
MOSEK warning 710: #2 (nearly) zero elements are specified in sparse col '' (38) of matrix 'A'.
MOSEK warning 710: #2 (nearly) zero elements are specified in sparse col '' (89) of matrix 'A'.
MOSEK warning 710: #2 (nearly) zero elements are specified in sparse col '' (96) of matrix 'A'.
MOSEK warning 710: #4 (nearly) zero elements are specified in sparse col '' (102) of matrix 'A'.
MOSEK warning 710: #2 (nearly) zero elements are specified in sparse col '' (161) of matrix 'A'.
MOSEK warning 710: #2 (nearly) zero elements are specified in sparse col '' (191) of matrix 'A'.
MOSEK warning 710: #2 (nearly) zero elements are specified in sparse col '' (259) of matrix 'A'.
Warning number 710 is disabled.
Problem
  Name                   :                 
  Objective sense        : min             
  Type                   : CONIC (conic optimization problem)
  Constraints            : 42294           
  Cones                  : 32796           
  Scalar variables       : 114587          
  Matrix variables       : 0               
  Integer variables      : 0               

Optimizer started.
Presolve started.
Linear dependency checker started.
Linear dependency checker terminated.
Eliminator started.
Freed constraints in eliminator : 8259
Eliminator terminated.
Eliminator started.
Freed constraints in eliminator : 0
Eliminator terminated.
Eliminator - tries                  : 2                 time                   : 0.00            
Lin. dep.  - tries                  : 1                 time                   : 0.02            
Lin. dep.  - number                 : 0               
Presolve terminated. Time: 0.09    
Problem
  Name                   :                 
  Objective sense        : min             
  Type                   : CONIC (conic optimization problem)
  Constraints            : 42294           
  Cones                  : 32796           
  Scalar variables       : 114587          
  Matrix variables       : 0               
  Integer variables      : 0               

Optimizer  - threads                : 2               
Optimizer  - solved problem         : the primal      
Optimizer  - Constraints            : 27161
Optimizer  - Cones                  : 32796
Optimizer  - Scalar variables       : 104678            conic                  : 102700          
Optimizer  - Semi-definite variables: 0                 scalarized             : 0               
Factor     - setup time             : 0.13              dense det. time        : 0.00            
Factor     - ML order time          : 0.02              GP order time          : 0.00            
Factor     - nonzeros before factor : 1.36e+05          after factor           : 2.15e+05        
Factor     - dense dim.             : 0                 flops                  : 3.41e+06        
ITE PFEAS    DFEAS    GFEAS    PRSTATUS   POBJ              DOBJ              MU       TIME  
0   6.3e+00  8.0e+04  1.3e+07  0.00e+00   1.331059216e+07   1.000000000e+02   1.0e+00  0.30  
1   2.4e+00  3.1e+04  8.3e+06  -1.00e+00  1.330897248e+07   9.687700316e+01   3.8e-01  0.39  
2   7.8e-01  9.9e+03  4.7e+06  -1.00e+00  1.330167313e+07   9.267974882e+01   1.2e-01  0.47  
3   2.0e-01  2.5e+03  2.4e+06  -9.98e-01  1.327160125e+07   7.175950845e+01   3.1e-02  0.58  
4   4.3e-02  5.4e+02  1.1e+06  -9.94e-01  1.312006044e+07   -3.241806244e+01  6.8e-03  0.66  
5   2.7e-02  3.4e+02  8.4e+05  -9.69e-01  1.298682728e+07   -1.240213955e+02  4.2e-03  0.73  
6   2.0e-02  2.5e+02  7.2e+05  -9.47e-01  1.286520018e+07   -2.075948139e+02  3.2e-03  0.83  
7   1.5e-02  1.9e+02  6.1e+05  -9.26e-01  1.268105023e+07   -3.336795125e+02  2.3e-03  0.91  
8   1.1e-02  1.4e+02  5.0e+05  -8.94e-01  1.239627729e+07   -5.277420702e+02  1.7e-03  1.02  
9   7.9e-03  1.0e+02  4.2e+05  -8.43e-01  1.202248909e+07   -7.808909248e+02  1.3e-03  1.13  
10  5.7e-03  7.3e+01  3.4e+05  -7.76e-01  1.148114643e+07   -1.144978748e+03  9.1e-04  1.22  
11  3.8e-03  4.9e+01  2.5e+05  -6.82e-01  1.056884038e+07   -1.754043097e+03  6.1e-04  1.30  
12  2.3e-03  2.9e+01  1.6e+05  -5.28e-01  9.016153753e+06   -2.782435178e+03  3.6e-04  1.41  
13  9.1e-04  1.2e+01  6.4e+04  -2.78e-01  5.751997247e+06   -4.926730902e+03  1.4e-04  1.48  
14  3.4e-04  4.3e+00  1.8e+04  2.26e-01   2.768937577e+06   -6.856223380e+03  5.4e-05  1.59  
15  1.7e-04  2.2e+00  7.1e+03  6.26e-01   1.543973950e+06   -7.655757058e+03  2.7e-05  1.69  
16  8.9e-05  1.1e+00  2.9e+03  7.41e-01   8.668271774e+05   -8.121214843e+03  1.4e-05  1.78  
17  4.9e-05  6.2e-01  1.2e+03  8.79e-01   4.795169362e+05   -8.338844003e+03  7.8e-06  1.84  
18  2.8e-05  3.5e-01  4.8e+02  1.05e+00   2.509434426e+05   -8.348247685e+03  4.4e-06  1.94  
19  1.9e-05  2.4e-01  2.6e+02  1.19e+00   1.581705756e+05   -8.164427522e+03  3.0e-06  2.02  
20  5.4e-06  6.9e-02  3.5e+01  1.23e+00   3.374670719e+04   -7.486274705e+03  8.6e-07  2.08  
21  2.0e-06  2.5e-02  7.2e+00  1.28e+00   8.441633742e+03   -4.682895423e+03  3.1e-07  2.16  
22  8.8e-07  1.1e-02  2.1e+00  1.12e+00   2.822921995e+03   -2.849435019e+03  1.4e-07  2.23  
23  6.2e-07  7.8e-03  1.3e+00  1.04e+00   1.762526003e+03   -2.226828142e+03  9.8e-08  2.31  
24  3.5e-07  4.4e-03  5.4e-01  1.01e+00   6.914179367e+02   -1.564673276e+03  5.5e-08  2.39  
25  2.7e-07  3.4e-03  3.7e-01  9.64e-01   4.502420837e+02   -1.326305460e+03  4.3e-08  2.47  
26  1.8e-07  2.3e-03  2.1e-01  9.49e-01   1.751109163e+02   -1.037342811e+03  2.9e-08  2.53  
27  1.3e-07  1.6e-03  1.3e-01  9.24e-01   4.230483111e+01   -8.503873595e+02  2.1e-08  2.61  
28  7.4e-08  9.4e-04  5.7e-02  9.06e-01   -1.101748433e+02  -6.396709760e+02  1.2e-08  2.69  
29  4.4e-08  5.6e-04  2.7e-02  8.76e-01   -1.803825784e+02  -5.101300258e+02  7.0e-09  2.77  
30  3.2e-08  2.0e-04  6.4e-03  8.53e-01   -2.321121572e+02  -3.606798217e+02  2.5e-09  2.83  
31  1.5e-08  9.1e-05  2.0e-03  8.17e-01   -2.294953730e+02  -2.919029220e+02  1.1e-09  3.02  
32  1.1e-08  6.5e-05  1.3e-03  7.98e-01   -2.255961036e+02  -2.727543663e+02  8.1e-10  3.20  
33  6.1e-09  2.6e-05  3.4e-04  8.39e-01   -2.130353919e+02  -2.329304833e+02  3.3e-10  3.39  
34  6.1e-09  2.6e-05  3.4e-04  9.05e-01   -2.130353919e+02  -2.329304833e+02  3.3e-10  3.72  
35  3.5e-09  1.3e-05  1.2e-04  9.05e-01   -2.033698338e+02  -2.131838509e+02  1.6e-10  3.92  
36  3.2e-09  1.2e-05  1.0e-04  9.50e-01   -2.024093815e+02  -2.114381767e+02  1.4e-10  4.13  
37  2.9e-09  1.0e-05  8.7e-05  9.57e-01   -2.013544492e+02  -2.094874521e+02  1.3e-10  4.36  
38  1.8e-09  6.6e-06  4.5e-05  9.63e-01   -1.982177126e+02  -2.034306941e+02  8.3e-11  4.58  
39  1.3e-09  4.6e-06  2.6e-05  9.85e-01   -1.976827698e+02  -2.012820311e+02  5.7e-11  4.78  
40  1.3e-09  4.6e-06  2.6e-05  1.00e+00   -1.976827698e+02  -2.012820311e+02  5.7e-11  5.13  
41  1.3e-09  4.6e-06  2.6e-05  1.00e+00   -1.976827698e+02  -2.012820311e+02  5.7e-11  5.44  
42  1.2e-09  4.3e-06  2.3e-05  1.00e+00   -1.977360002e+02  -2.010654350e+02  5.3e-11  5.67  
43  1.2e-09  4.3e-06  2.3e-05  1.00e+00   -1.977360002e+02  -2.010654350e+02  5.3e-11  6.00  
44  1.2e-09  4.3e-06  2.3e-05  1.00e+00   -1.977360002e+02  -2.010654350e+02  5.3e-11  6.33  
Optimizer terminated. Time: 6.69    


Interior-point solution summary
  Problem status  : UNKNOWN
  Solution status : UNKNOWN
  Primal.  obj: -1.9773600018e+02   nrm: 9e+05    Viol.  con: 2e-03    var: 5e-05    cones: 2e-07  
  Dual.    obj: -2.0106543498e+02   nrm: 3e+06    Viol.  con: 0e+00    var: 1e-02    cones: 0e+00  
Optimizer summary
  Optimizer                 -                        time: 6.69    
    Interior-point          - iterations : 45        time: 6.67    
      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
1 Like

At this stage the user can encounter warnings which should not be ignored, unless they are well-understood.

Have you been ignoring Mosek’s warnings about (nearly) zero elements in the input data?

1 Like

I saw that but I don’t konw which element is too small. and what is input data, does it mean all data except variables?

Look at all the numbers (not CVX variables) appearing in your program. Perhaps your scaling needs to be improved (or you have “nuisance” near zero input numbers which should be exactly zero)… You should try to get all non-zero input data to be within a small number of orders of magnitude of 1.

1 Like

I just handled some nearly zeros elements in some way, this time I have the following failed mosek output with no warnings,

Calling Mosek_2 9.3.10: 223577 variables, 82294 equality constraints
   For improved efficiency, Mosek_2 is solving the dual problem.
------------------------------------------------------------

MOSEK Version 9.3.10 (Build date: 2021-11-5 08:42:07)
Copyright (c) MOSEK ApS, Denmark. WWW: mosek.com
Platform: Windows/64-X86

Problem
  Name                   :                 
  Objective sense        : min             
  Type                   : CONIC (conic optimization problem)
  Constraints            : 82294           
  Cones                  : 64796           
  Scalar variables       : 223577          
  Matrix variables       : 0               
  Integer variables      : 0               

Optimizer started.
Presolve started.
Linear dependency checker started.
Linear dependency checker terminated.
Eliminator started.
Freed constraints in eliminator : 16871
Eliminator terminated.
Eliminator started.
Freed constraints in eliminator : 0
Eliminator terminated.
Eliminator - tries                  : 2                 time                   : 0.00            
Lin. dep.  - tries                  : 1                 time                   : 0.05            
Lin. dep.  - number                 : 0               
Presolve terminated. Time: 0.27    
Problem
  Name                   :                 
  Objective sense        : min             
  Type                   : CONIC (conic optimization problem)
  Constraints            : 82294           
  Cones                  : 64796           
  Scalar variables       : 223577          
  Matrix variables       : 0               
  Integer variables      : 0               

Optimizer  - threads                : 2               
Optimizer  - solved problem         : the primal      
Optimizer  - Constraints            : 52381
Optimizer  - Cones                  : 64796
Optimizer  - Scalar variables       : 205055            conic                  : 202620          
Optimizer  - Semi-definite variables: 0                 scalarized             : 0               
Factor     - setup time             : 0.25              dense det. time        : 0.00            
Factor     - ML order time          : 0.05              GP order time          : 0.00            
Factor     - nonzeros before factor : 2.62e+05          after factor           : 4.09e+05        
Factor     - dense dim.             : 0                 flops                  : 6.50e+06        
ITE PFEAS    DFEAS    GFEAS    PRSTATUS   POBJ              DOBJ              MU       TIME  
0   6.5e+00  1.7e+05  1.0e+08  0.00e+00   9.985826541e+07   1.000000000e+01   1.0e+00  0.75  
1   3.4e+00  9.1e+04  7.2e+07  -1.00e+00  9.985217783e+07   8.971805361e+00   5.3e-01  1.17  
2   1.4e+00  3.6e+04  4.6e+07  -1.00e+00  9.983366683e+07   9.899524312e+00   2.1e-01  1.34  
3   5.5e-01  1.5e+04  2.9e+07  -9.99e-01  9.978096439e+07   9.358877042e+00   8.4e-02  1.52  
4   2.3e-01  6.2e+03  1.9e+07  -9.98e-01  9.965936468e+07   8.288361539e+00   3.6e-02  1.70  
5   9.6e-02  2.6e+03  1.2e+07  -9.96e-01  9.933195225e+07   5.611201503e+00   1.5e-02  1.88  
6   4.2e-02  1.1e+03  7.9e+06  -9.88e-01  9.853900807e+07   -8.764038201e-01  6.4e-03  2.05  
7   1.7e-02  4.6e+02  5.0e+06  -9.71e-01  9.632367525e+07   -1.914835793e+01  2.7e-03  2.23  
8   1.3e-02  3.5e+02  4.3e+06  -9.17e-01  9.493619223e+07   -3.077453557e+01  2.0e-03  2.41  
9   8.3e-03  2.2e+02  3.2e+06  -8.84e-01  9.133847799e+07   -6.082453625e+01  1.3e-03  2.58  
10  4.0e-03  1.1e+02  2.0e+06  -7.94e-01  8.109327009e+07   -1.461291667e+02  6.2e-04  2.77  
11  2.0e-03  5.2e+01  1.1e+06  -5.41e-01  6.377676841e+07   -2.903761930e+02  3.0e-04  2.94  
12  6.5e-04  1.7e+01  3.3e+05  -1.60e-01  3.374026156e+07   -5.423345709e+02  1.0e-04  3.13  
13  2.4e-04  6.3e+00  7.9e+04  4.60e-01   1.440003466e+07   -7.082587024e+02  3.6e-05  3.30  
14  1.5e-04  4.0e+00  4.1e+04  7.48e-01   9.650024411e+06   -7.536418806e+02  2.3e-05  3.47  
15  1.0e-04  2.8e+00  2.5e+04  7.69e-01   7.068177012e+06   -7.801808077e+02  1.6e-05  3.66  
16  6.3e-05  1.7e+00  1.2e+04  8.30e-01   4.447011359e+06   -8.071175697e+02  9.7e-06  3.83  
17  4.0e-05  1.1e+00  6.1e+03  9.43e-01   2.771791497e+06   -8.241868854e+02  6.1e-06  4.00  
18  3.2e-05  8.5e-01  4.3e+03  1.05e+00   2.173979154e+06   -8.303772390e+02  4.9e-06  4.17  
19  1.3e-05  3.6e-01  1.1e+03  1.09e+00   8.471154995e+05   -8.433607860e+02  2.0e-06  4.36  
20  4.8e-06  1.3e-01  2.2e+02  1.22e+00   2.685531684e+05   -8.474980666e+02  7.4e-07  4.53  
21  2.2e-06  5.8e-02  6.5e+01  1.22e+00   1.117434495e+05   -8.466285447e+02  3.4e-07  4.70  
22  1.1e-06  2.9e-02  2.3e+01  1.13e+00   5.351306437e+04   -8.434664679e+02  1.7e-07  4.89  
23  7.2e-07  1.9e-02  1.2e+01  1.07e+00   3.451507907e+04   -8.380642381e+02  1.1e-07  5.06  
24  3.4e-07  9.0e-03  3.8e+00  1.05e+00   1.529871906e+04   -8.218362838e+02  5.2e-08  5.24  
25  1.5e-07  4.0e-03  1.1e+00  1.03e+00   6.347163832e+03   -7.493380844e+02  2.3e-08  5.64  
26  8.1e-08  2.2e-03  4.4e-01  1.03e+00   3.336219527e+03   -4.720338313e+02  1.2e-08  6.06  
27  5.5e-08  1.5e-03  2.5e-01  1.03e+00   2.187786000e+03   -4.061755899e+02  8.5e-09  6.49  
28  3.4e-08  9.1e-04  1.2e-01  1.02e+00   1.241204242e+03   -3.417547643e+02  5.2e-09  6.89  
29  2.3e-08  6.1e-04  6.4e-02  1.02e+00   7.536991948e+02   -3.011392479e+02  3.5e-09  7.36  
30  1.4e-08  3.9e-04  3.2e-02  1.01e+00   3.992849003e+02   -2.678620045e+02  2.2e-09  7.81  
31  9.1e-09  2.4e-04  1.6e-02  1.01e+00   1.780308631e+02   -2.426756086e+02  1.4e-09  8.30  
32  6.0e-09  1.6e-04  8.6e-03  1.01e+00   5.205222484e+01   -2.242612495e+02  9.2e-10  8.77  
33  5.0e-09  1.3e-04  6.5e-03  1.00e+00   1.258308936e+01   -2.166009931e+02  7.7e-10  9.30  
34  3.8e-09  1.0e-04  4.3e-03  1.00e+00   -3.223300157e+01  -2.073857463e+02  5.9e-10  9.81  
35  2.8e-09  7.5e-05  2.7e-03  9.97e-01   -6.853888531e+01  -1.984110419e+02  4.3e-10  10.33 
36  2.0e-09  5.3e-05  1.6e-03  9.94e-01   -9.808238814e+01  -1.894504401e+02  3.0e-10  10.83 
37  1.6e-09  4.2e-05  1.1e-03  9.90e-01   -1.124580579e+02  -1.844620836e+02  2.4e-10  11.39 
38  1.1e-09  3.0e-05  6.8e-04  9.87e-01   -1.272404960e+02  -1.789585759e+02  1.7e-10  11.94 
39  7.2e-10  1.9e-05  3.6e-04  9.84e-01   -1.402060668e+02  -1.738516440e+02  1.1e-10  12.47 
40  5.0e-10  1.3e-05  2.1e-04  9.80e-01   -1.472794170e+02  -1.707960179e+02  7.7e-11  13.06 
41  4.3e-10  1.2e-05  1.7e-04  9.77e-01   -1.494163053e+02  -1.698004839e+02  6.7e-11  13.64 
42  3.0e-10  8.1e-06  9.9e-05  9.77e-01   -1.534554050e+02  -1.678771620e+02  4.7e-11  14.25 
43  2.4e-10  6.4e-06  7.0e-05  9.77e-01   -1.554581683e+02  -1.669190439e+02  3.7e-11  14.88 
44  1.5e-10  4.0e-06  3.4e-05  9.78e-01   -1.583740302e+02  -1.655368873e+02  2.3e-11  15.44 
45  1.1e-10  3.0e-06  2.3e-05  9.79e-01   -1.595198623e+02  -1.649973047e+02  1.8e-11  16.02 
46  7.5e-11  2.0e-06  1.2e-05  9.81e-01   -1.607610783e+02  -1.643893183e+02  1.2e-11  16.58 
47  4.4e-11  1.2e-06  5.5e-06  1.00e+00   -1.617676637e+02  -1.638964592e+02  6.8e-12  17.08 
48  3.3e-11  8.7e-07  3.5e-06  9.87e-01   -1.621425287e+02  -1.637211029e+02  5.0e-12  17.89 
49  3.3e-11  8.7e-07  3.5e-06  1.00e+00   -1.621432555e+02  -1.637207706e+02  5.0e-12  18.45 
50  3.3e-11  8.7e-07  3.5e-06  9.99e-01   -1.621434369e+02  -1.637206875e+02  5.0e-12  19.08 
51  3.3e-11  8.7e-07  3.5e-06  1.00e+00   -1.621434823e+02  -1.637206668e+02  5.0e-12  19.73 
52  3.3e-11  8.7e-07  3.5e-06  1.00e+00   -1.621434823e+02  -1.637206668e+02  5.0e-12  20.41 
53  3.3e-11  8.7e-07  3.5e-06  1.00e+00   -1.621434823e+02  -1.637206668e+02  5.0e-12  21.11 
Optimizer terminated. Time: 22.03   


Interior-point solution summary
  Problem status  : UNKNOWN
  Solution status : UNKNOWN
  Primal.  obj: -1.6214348235e+02   nrm: 1e+03    Viol.  con: 5e-04    var: 3e-04    cones: 1e-08  
  Dual.    obj: -1.6372066679e+02   nrm: 1e+05    Viol.  con: 0e+00    var: 3e-03    cones: 0e+00  
Optimizer summary
  Optimizer                 -                        time: 22.03   
    Interior-point          - iterations : 54        time: 21.94   
      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

Should I keep looking for nearly zero elements? What should I do? I guess it has something to do with the log and log_exp function in my code which is not posted out here for the moment because it is a large file. I can post it later if it is needed. Thank you for your time and patience.

PRSTATUS is 1, which is good, but the gap between primal and dual objective is not as small as desired, and maybe the solution is not quite as feasible (I don’;t know whether Mosek was provided the dual by CVX) as desired. I will defer to Mosek personnel for more refined assessment as to how good the solution might be and the reasons for Mosek terminating with UNKNOWN (maybe Slater condition (feasible points strictly interior to nonlinear constraints) is either not satisfied or borderline not satisfied with model as constructed).

But I will share this comment, which I’ve made previously on the forum, as well as to the CVX developer. It would be better if CVX made available to the CVX user the solution from a Mosek run which ends with UNKNOWN. This could be reported with a suitable CVX status (something like “Unknown solution quality”). YALMIP make the Mosek output available to the user when Mosek ends with UNKNOWN, and so in my opinion should CVX. In many cases, an UNKNOWN solution is perfectly usable.

1 Like

Mosek has numerical difficulties computing a sufficiently accurate solution.

You welcome to dump the problem to disk using the instructions at

and email it to Mosek support for an analysis.

1 Like