CVX solve failure with log function

The problem is given as follows :
\begin{array}{l} \mathop {\max }\limits_{{p_{i,}}{\tau _{{k_2}}}\left[ n \right],{\gamma _{j \to {k_2}}}\left[ n \right]} \sum\limits_{{k_2} = 1}^{{K_2}} {\sum\limits_{n = 1}^N {{\tau _{{k_2}}}\left[ n \right]} } \\ {\rm{s}}{\rm{.t}}{\rm{.}}{\kern 1pt} {\kern 1pt} {\kern 1pt} {\kern 1pt} {\kern 1pt} {\kern 1pt} {R_{{k_2}}}\left[ n \right] - {\gamma _{j \to {k_2}}}\left[ n \right] \ge {\tau _{{k_2}}}\left[ n \right],\forall n,{k_2},j \in {{\cal K}_1}\\ {\kern 1pt} {\kern 1pt} {\kern 1pt} {\kern 1pt} {\kern 1pt} {\kern 1pt} {\kern 1pt} {\kern 1pt} {\kern 1pt} {\kern 1pt} {\kern 1pt} {\kern 1pt} {\kern 1pt} {\kern 1pt} {\kern 1pt} {\kern 1pt} {\gamma _{j \to {k_2}}}\left[ n \right] \ge {R_{j \to {k_2}}},\forall n,{k_2},j \in {{\cal K}_1}\\ {\kern 1pt} {\kern 1pt} {\kern 1pt} {\kern 1pt} {\kern 1pt} {\kern 1pt} {\kern 1pt} {\kern 1pt} {\kern 1pt} {\kern 1pt} {\kern 1pt} {\kern 1pt} {\kern 1pt} {\kern 1pt} 0 \le {p_i} \le {P_{\max }},\forall i, \end{array}
where
\begin{array}{l} {R_{{k_2}}}\left[ n \right] = B\sum\limits_{{m_2} = 1}^{{M_2}} {{a_{{k_2},{m_2}}}\left[ n \right]{{\log }_2}\left( {1 + \frac{{{p_{{m_2}}}\left[ n \right]{h_{{k_2},{m_2}}}\left[ n \right]}}{{\sum\limits_{i \in {{\cal M}_2}\backslash \left\{ {{m_2}} \right\} \cup {{\cal M}_1}} {{p_i}\left[ n \right]{h_{{k_2},i}}\left[ n \right]} + {\sigma ^2}}}} \right),{k_2} \in {{\cal K}_2},{m_2} \in {{\cal M}_2},\forall n} \\ {R_{j \to {k_2}}} = B\sum\limits_{{m_2} = 1}^{{M_2}} {{a_{{k_2},{m_2}}}\left[ n \right]{{\log }_2}\left( {1 + \frac{{{p_{{m_2}}}\left[ n \right]{h_{j,{m_2}}}\left[ n \right]}}{{\sum\limits_{i \in {{\cal M}_2}\backslash \left\{ {{m_2}} \right\} \cup {{\cal M}_1}} {{p_i}\left[ n \right]{h_{j,i}}\left[ n \right]} + {\sigma ^2}}}} \right),j \in {{\cal K}_1},{m_2} \in {{\cal M}_2},\forall n} \end{array}

Since the problem is non-convex with respect to power p_i, i employ the successive convex approximation technique, specifically, take the first Taylor expand with non-convex constraint, however, the cvx cannot solve it (sdpt3,mosek,sedumi). The code is given as follows:

   function [ p] = PowerallocationUsingCVX(p_initial,a, q)
%UNTITLED2 æ­€ć€„æ˜Ÿç€șæœ‰ć…łæ­€ć‡œæ•°çš„æ‘˜èŠ
%   p_initial is initial power
global K1 K2 M1 M2  User_Position sigma belta H N B P_max
for n=1:N
    for m=1:M1+M2
        for k=1:K1+K2
             h(k,m,n)=belta/(sum_square(q(:,m,n+1)-User_Position(:,k))+H^2);
        end
    end
end

cvx_begin
%cvx_solver mosek
%cvx_solver sedumi
cvx_solver sdpt3
    variable tau(K2,N)
    variable p(M1+M2,N)
     variable gamma_vari(K1,N)
    for n=1:N
        for k=1:K1+K2
            for m=1:M1+M2
                 R_bar(k,m,n)=B*1/log(2)*log(h(k,:,n)*p(:,n)+sigma);
            end
        end
    end
    for n=1:N
        for k=1:K1+K2
            for m=1:M1+M2
                 R_wave(k,m,n)=B/log(2)*log(h(k,:,n)*p(:,n)-h(k,m,n)*p(m,n)+sigma);
            end
        end
    end
    for n=1:N
        for k=1:K1+K2
            for m=M1+M2
                 A(k,m,n)=h(k,m,n)/(h(k,:,n)*p_initial(:,n)-h(k,m,n)*p_initial(m,n)+sigma)*(p(m,n)-p_initial(m,n));
            end
        end
    end

    for n=1:N
        for k=1:K1+K2
            for m=1:M1+M2
                 R_wave_up(k,m,n)=B/log(2)*log(h(k,:,n)*p_initial(:,n)-h(k,m,n)*p_initial(m,n)+sigma)+...
                     B/log(2)*(sum(A(k,:,n))-A(k,m,n));
            end
        end
    end

    for n=1:N
        for k=1:K1+K2
            for m=1:M1+M2
                 R_bar_up(k,m,n)=B/log(2)*log(h(k,:,n)*p_initial(:,n)+sigma)+...
                     B/log(2)*sum(A(k,:,n));
            end
        end
    end

    maximize sum(sum(tau))
    subject to   
    for n=1:N
        for k=1:K2
            sum((R_bar(K1+k,[M1+1:M1+M2],n)-R_wave_up(K1+k,[M1+1:M1+M2],n)).*a(k,:,n))-max(gamma_vari(:,n))>=tau(k,n);
        end
    end
    
    for n=1:N
        for k=1:K2
         gamma_vari(:,n)>=sum((R_bar_up(k,[M1+1:M1+M2],n)-R_wave(k,[M1+1:M1+M2],n)).*a(k,:,n));
        end
    end    
  0<=p<=P_max;
cvx_end

end

for example, i use solver sedumi, the window shows

_Successive approximation method to be employed._

_ SeDuMi will be called several times to refine the solution._
_ Original size: 9296 variables, 3216 equality constraints_
_ 328 exponentials add 2624 variables, 1640 equality constraints_
_ -----------------------------------------------------------------_
_ Cones | Errors |_
_ Mov/Act | Centering Exp cone Poly cone | Status_
_ --------±--------------------------------±--------_
_ 0/313 | 8.000e+00 1.687e+02 1.687e+02 | Failed_
_ 26/231 | 8.000e+00 1.854e+02 1.825e+02 | Failed_
_ 85/252 | 8.000e+00 8.870e+01 7.962e+01 | Failed_
_ 90/288 | 8.000e+00 1.223e+02 1.059e+02 | Failed_
_ 83/313 | 8.000e+00 1.247e+02 1.029e+02 | Failed_
_ 115/314 | 8.000e+00 2.374e+02 2.078e+02 | Failed_
_ -----------------------------------------------------------------_
_ Status: Failed_
_ Optimal value (cvx_optval): NaN_

Any one can help me ? Thanks in advance .

Install CVXQUAD GitHub - hfawzi/cvxquad: Implementation in MATLAB-based CVX of various convex/concave functions of matrices (matrix geometric means, quantum relative entropy, ...) and its exponential.m replacement for CVX’s versoin, as described at the link.

I just skimmed through your CVX code, but it looks like the only “exponential cone” item in your code, and therefore the only item in your code causing CVV’;s successive approximation method (read all the disclaimers at Advanced topics — CVX Users' Guide) to be invoked is log .If you replace all occurrences of log(cvx_expression) with the mathematically equivalent -rel_entr(1,cvx_expression), that should be sufficient to invoke CVXQUAD’s PadĂ© approximant instead of CVX’s unreliable successive approximation method. CVXQUAD’s PadĂ© approximant succeeds more often than CVX’s successive approximation method, but may fail on very difficult problems (using Mosek as the solver probably gives you the nest chance of success when using .CVXQUAD’s PadĂ© approximant). I9f ut turns out that CVX’s successive approximation method is still invoked (as evidenced by the

Cones | Errors |_
_ Mov/Act | Centering Exp cone Poly cone | Status_

output, that means either CVXQUAD and its exponential.m replacement are not installed correctly or there is some other exponential cone item in your CVX code, such as a power (all exponential cone items can be reformulated in such a way as to cause CVXQUAD’'s PadĂ© approximant to be invoked instead of CVX’s successive approximation method)


1 Like

Thank you for your useful suggestion. However, I donnot know to how to install CVXQUAD in the matlab correctly. I add the cvxquad-master file as below :

then, I run the example code

```
n = 4;
M = randn(n,n);
M = M*M';
cvx_begin
  variable X(n,n) symmetric
  minimize quantum_rel_entr(M,X)
  subject to
    diag(X) == ones(n,1)
cvx_end
```

However, it not works, the matlab window shows:
image

I hope this wil not trouble you too much!

Are you using CVX 3.0neta? If so, use CVX 2.1 instead, because 3.0beta has many bugs. What is the output from cvx_version ?

I can run that example just fine and get an optimal solution. Many posters on this forum have successfully installed and run CVXQUAD; I don’t recall any posters other than you (so far) who trued to install it reporting failure in doing so.

My best guess as to how to get CVXQUAD toi work:: You can try to start with a fresh MATLAB session, then install CVXQUAD and run it. Perhaps there is a problem if you already ran a CVX program using log before you installed CVXQUAD’s version of exponential.m in, and then tried to run “CVXQUAD” in the same MATLAB session 
Or you may not have to reinstall CVXQUAD, just start using it in a new MATLAB session.

Dear Mark,
CVX: Software for Disciplined Convex Programming ©2014 CVX Research
Version 2.1, Build 1123 (cff5298) Sun Dec 17 18:58:10 2017
---------------------------------------------------------------------------
Installation info:
Path: C:\Program Files\MATLAB\R2017a\cvx
MATLAB version: 9.2 (R2017a)
OS: Windows 7 amd64 version 6.1
Java version: 1.7.0_60
Verfying CVX directory contents:
WARNING: The following extra files/directories were found:
C:\Program Files\MATLAB\R2017a\cvx\cvxquad-master\ + 18 files, 2 subdirectories
These files may alter the behavior of CVX in unsupported ways.
Preferences:
Path: C:\Users\wy\AppData\Roaming\MathWorks\MATLAB\cvx_prefs.mat
License host:
Username: wy
Host ID: b4b52fdabe98 (eth3)
Installed license:
Also in file: C:\Users\wy\Downloads\cvx_license.dat
Organization: southeast university
Contact: meng hua (mhua@seu.edu.cn)
License type: academic
Named user: wy
Host ID: b4b52fdabe98
Expiration: 2019-04-25 (175 days remaining)
Status: verified
---------------------------------------------------------------------------
How to verify that the CVXQUAD is correctly installed in my matlab ?

I recommend removing all CVX and CVXQUAD directories from your MATLAB path, then reinstall CVX and install CVXQUAD and its exponential.m replacement. Then try running a CVXQUAD example. Perhaps something got corrupted in your installation.

Dear Mark,

 I try various  ways to install CVXQUAD, even reinstall the CVXQUAD in another computer, but still failed.  When I use the following code .

n = 4;
M = randn(n,n);
M = M*M';
cvx_begin
  variable X(n,n) symmetric
  minimize quantum_rel_entr(M,X)
  subject to
    diag(X) == ones(n,1)
cvx_end

The matlab window shows:
Error using evalin
undefined function ‘quantum_rel_entr’ for input arguments of type ‘cvx’ .

Error minimize (line 8)
x = evalin( ‘caller’, sprintf( '%s ', varargin{:} ) );

Error test (line 6)
minimize quantum_rel_entr(M,X)

I donnot know why I cannot install it correctly .

Did you remember to include the folder containing CVXQUAD in your MATLAB path?

If the folder containing CVVXQUAD is in your MATLAB path, then have suggested everything I can. You can try opening an issue at https://github.com/hfawzi/cvxquad/issues . You should include the output from cvx_version when you submit the issue.

So far, you are the only poster I know of who tried to install CVXQUAD and did not succeed.

Dear mark,

I am sure the folder is added in my MATLA path as you see the previous attached figure. I download the folder, extract it and copy it in the cvx file, then copy the experimental file to “sets” file.

Have you explicitly checked that the cvxquad-mater folder is in the MATLAB path? Don’t assume that it is. I doubt it was added by CVX to your MATLAB path, despite being under a CVX directory. So if you haven’t added it to your path, it won;t be in it.

Dear mark,
Thanks for your kind explanations. I think i know where is wrong. thank you very much!

Please let us know what happens when you use CVXQUAD on this problem (with Mosek and.or whatever other solvers you try).

Dear Mark,

The CVXQUAD works now. Thanks for your help.

And was the problem you posted in this thread successfully solved using CVXQUAD? Can you show us the CVX and solver output?

Dear Mark,

The folder of CVXQUAD was put in wrong path before., and I corret it and works now.

The output of solver is given as following:

Using Pade approximation for exponential
cone with parameters m=3, k=3
=====================================
=====================================
Using Pade approximation for exponential
cone with parameters m=3, k=3
=====================================
=====================================
Using Pade approximation for exponential
cone with parameters m=3, k=3
=====================================
=====================================
Using Pade approximation for exponential
cone with parameters m=3, k=3
=====================================
=====================================
Using Pade approximation for exponential
cone with parameters m=3, k=3
=====================================
=====================================
Using Pade approximation for exponential
cone with parameters m=3, k=3
=====================================
 
Calling SeDuMi 1.34: 38876 variables, 14740 equality constraints
   For improved efficiency, SeDuMi is solving the dual problem.
------------------------------------------------------------
SeDuMi 1.34 (beta) 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 = 14740, order n = 27357, dim = 38877, blocks = 11521
nnz(A) = 58240 + 0, nnz(ADA) = 56160, nnz(L) = 36156
 it :     b*y       gap    delta  rate   t/tP*  t/tD*   feas cg cg  prec
  0 :            9.00E+03 0.000
  1 :   1.74E+04 6.27E+03 0.000 0.6974 0.9000 0.9000   2.69  1  1  3.5E+01
  2 :   5.93E+03 3.65E+03 0.000 0.5817 0.9000 0.9000   4.39  1  1  7.4E+00
  3 :   2.25E+03 1.92E+03 0.000 0.5251 0.9000 0.9000   2.43  1  1  2.7E+00
  4 :   5.53E+02 8.06E+02 0.000 0.4205 0.9000 0.9000   1.72  1  1  9.6E-01
  5 :  -2.27E+02 4.38E+02 0.000 0.5439 0.9000 0.9000   1.28  1  1  5.7E-01
  6 :  -7.26E+02 2.50E+02 0.000 0.5714 0.9000 0.9000   1.04  1  1  4.1E-01
  7 :  -7.26E+02 2.44E+01 0.000 0.0976 0.9000 0.0000   1.00  1  1  2.0E-01
  8 :  -1.24E+03 2.77E-06 0.000 0.0000 0.8876 0.9000   0.95  1  1  5.0E-02
  9 :  -1.42E+03 1.30E-06 0.000 0.4690 0.9099 0.9000   0.78  1  1  2.7E-02
 10 :  -1.49E+03 9.27E-07 0.000 0.7122 0.9000 0.9000   0.70  1  1  2.1E-02
 11 :  -1.55E+03 7.10E-07 0.000 0.7661 0.9000 0.7991   0.44  1  1  1.8E-02
 12 :  -1.60E+03 5.23E-07 0.000 0.7373 0.9000 0.9000   0.35  1  1  1.5E-02
 13 :  -1.60E+03 2.80E-07 0.000 0.5353 0.9000 0.0000   0.42  1  1  1.1E-02
 14 :  -1.73E+03 1.07E-07 0.000 0.3833 0.9100 0.9000   0.26  1  1  4.8E-03
 15 :  -1.83E+03 5.29E-08 0.000 0.4930 0.9000 0.9265   0.10  4  5  3.5E-03
 16 :  -1.88E+03 2.75E-08 0.000 0.5203 0.9000 0.7006   0.17  4  5  2.7E-03
 17 :  -1.95E+03 1.24E-08 0.000 0.4496 0.9000 0.9000   0.23  1  4  1.7E-03
 18 :  -1.99E+03 6.51E-09 0.000 0.5258 0.9000 0.9000   0.29  1  4  1.2E-03
 19 :  -2.03E+03 3.90E-09 0.000 0.5995 0.9000 0.9000   0.25  2  4  9.0E-04
 20 :  -2.07E+03 2.18E-09 0.000 0.5590 0.9000 0.9000   0.25  2  8  6.6E-04
 21 :  -2.11E+03 1.26E-09 0.000 0.5781 0.9000 0.9000   0.25  2  9  4.9E-04
 22 :  -2.14E+03 8.09E-10 0.000 0.6415 0.9000 0.9000   0.22  2  8  4.0E-04
 23 :  -2.16E+03 5.32E-10 0.000 0.6575 0.9000 0.9000   0.19  2 10  3.2E-04
 24 :  -2.19E+03 3.32E-10 0.000 0.6239 0.9000 0.9000   0.20  2 13  2.5E-04
 25 :  -2.22E+03 2.17E-10 0.000 0.6538 0.9000 0.9000   0.21  2 13  2.0E-04
 26 :  -2.24E+03 1.51E-10 0.000 0.6940 0.9000 0.9000   0.19  2  7  1.7E-04
 27 :  -2.27E+03 1.05E-10 0.000 0.6967 0.9000 0.9000   0.18  2  7  1.4E-04
 28 :  -2.29E+03 7.05E-11 0.000 0.6713 0.9000 0.9000   0.19  2  7  1.2E-04
 29 :  -2.31E+03 4.93E-11 0.000 0.6992 0.9000 0.9000   0.20  2  7  9.7E-05
 30 :  -2.33E+03 3.58E-11 0.000 0.7258 0.9000 0.9000   0.18  1 15  8.3E-05
 31 :  -2.35E+03 2.58E-11 0.000 0.7210 0.9000 0.9000   0.18  1 15  7.1E-05
 32 :  -2.37E+03 1.82E-11 0.000 0.7058 0.9000 0.9000   0.19  1 14  5.9E-05
 33 :  -2.39E+03 1.32E-11 0.000 0.7276 0.9000 0.9000   0.19  1 14  5.0E-05
 34 :  -2.41E+03 9.85E-12 0.000 0.7440 0.9000 0.9000   0.18  1 25  4.4E-05
 35 :  -2.43E+03 7.29E-12 0.000 0.7402 0.9000 0.9000   0.18  1 17  3.8E-05
 36 :  -2.45E+03 5.28E-12 0.000 0.7237 0.9000 0.9000   0.18  1 16  3.2E-05
 37 :  -2.47E+03 3.82E-12 0.000 0.7247 0.9000 0.9000   0.17  1 16  2.7E-05
 38 :  -2.49E+03 2.80E-12 0.000 0.7322 0.9000 0.9000   0.18  1 19  2.3E-05
 39 :  -2.51E+03 2.06E-12 0.000 0.7339 0.9000 0.9000   0.13  1 18  2.0E-05
 40 :  -2.53E+03 1.46E-12 0.000 0.7121 0.9000 0.9000   0.14  1 18  1.7E-05
 41 :  -2.55E+03 1.04E-12 0.000 0.7080 0.9000 0.9000   0.11  1 17  1.4E-05
 42 :  -2.57E+03 7.30E-13 0.000 0.7048 0.9000 0.9000   0.10  1 19  1.2E-05
 43 :  -2.60E+03 4.90E-13 0.000 0.6709 0.9000 0.9000   0.08  1 19  9.8E-06
 44 :  -2.62E+03 3.21E-13 0.000 0.6546 0.9000 0.9000   0.09  1 19  7.9E-06
 45 :  -2.65E+03 2.02E-13 0.000 0.6301 0.9000 0.9000   0.09  1 18  6.3E-06
 46 :  -2.68E+03 1.32E-13 0.000 0.6528 0.9000 0.9000   0.09  1 33  5.1E-06
 47 :  -2.70E+03 8.35E-14 0.000 0.6331 0.9000 0.9000   0.08  1 20  4.0E-06
 48 :  -2.73E+03 5.48E-14 0.000 0.6563 0.9000 0.9000   0.08  1 22  3.3E-06
 49 :  -2.75E+03 3.94E-14 0.000 0.7190 0.9000 0.9000   0.07  1 19  2.8E-06
 50 :  -2.77E+03 2.95E-14 0.000 0.7482 0.9000 0.9000   0.05  1 19  2.4E-06
 51 :  -2.79E+03 2.02E-14 0.000 0.6843 0.9000 0.9000   0.04  1 23  2.0E-06
 52 :  -2.81E+03 1.41E-14 0.000 0.6976 0.9000 0.9000   0.03  1 27  1.7E-06
 53 :  -2.82E+03 1.08E-14 0.000 0.7643 0.9000 0.9000   0.04  1 22  1.5E-06
 54 :  -2.84E+03 8.65E-15 0.000 0.8037 0.9000 0.9000   0.03  3 33  1.3E-06
 55 :  -2.86E+03 6.39E-15 0.000 0.7385 0.9000 0.9000   0.03  1 37  1.1E-06
 56 :  -2.87E+03 4.73E-15 0.000 0.7408 0.9000 0.9000   0.03  1 21  9.6E-07
 57 :  -2.89E+03 3.75E-15 0.000 0.7928 0.9000 0.9000   0.04  3 25  8.6E-07
 58 :  -2.90E+03 3.10E-15 0.000 0.8258 0.9000 0.9000   0.04  1 32  7.8E-07
 59 :  -2.91E+03 2.46E-15 0.000 0.7932 0.9000 0.9000   0.04  3 29  6.9E-07
 60 :  -2.93E+03 1.91E-15 0.072 0.7767 0.9000 0.9000   0.04  3 21  6.1E-07
 61 :  -2.94E+03 1.55E-15 0.208 0.8125 0.9000 0.9000   0.04  3 24  5.5E-07
 62 :  -2.95E+03 1.33E-15 0.151 0.8586 0.9000 0.9000   0.04  3 30  5.1E-07
 63 :  -2.96E+03 1.16E-15 0.098 0.8699 0.9000 0.9000   0.03  3 39  4.7E-07
 64 :  -2.97E+03 7.66E-16 0.001 0.6615 0.9282 0.9000   0.03  3 27  3.8E-07
 65 :  -2.99E+03 6.37E-16 0.347 0.8310 0.9000 0.9196   0.03 23 30  3.5E-07
 66 :  -2.99E+03 5.63E-16 0.341 0.8844 0.9000 0.9022   0.06  3 32  3.2E-07
 67 :  -3.00E+03 5.05E-16 0.401 0.8970 0.9000 0.9273   0.06  3 29  3.1E-07
 68 :  -3.01E+03 4.47E-16 0.391 0.8850 0.9000 0.9084   0.07  3 49  2.9E-07
 69 :  -3.02E+03 3.84E-16 0.255 0.8598 0.9000 0.9002   0.07  3 32  2.7E-07
 70 :  -3.03E+03 3.22E-16 0.163 0.8369 0.9037 0.9000   0.06  3 25  2.4E-07
 71 :  -3.04E+03 2.64E-16 0.117 0.8206 0.9063 0.9000   0.04  3 34  2.2E-07
 72 :  -3.05E+03 2.17E-16 0.125 0.8210 0.9000 0.9016   0.02  5 42  2.0E-07
Run into numerical problems.

iter seconds digits       c*x               b*y
 72     21.5   Inf -3.0523682468e+03 -3.0513505341e+03
|Ax-b| =   9.7e-06, [Ay-c]_+ =   2.3E-07, |x|=  5.3e+07, |y|=  5.5e+07

Detailed timing (sec)
   Pre          IPM          Post
6.710E-01    1.170E+01    6.599E-02    
Max-norms: ||b||=1.154156e+01, ||c|| = 4.058503e+01,
Cholesky |add|=1771, |skip| = 0, ||L.L|| = 215.832.
------------------------------------------------------------
Status: Inaccurate/Solved
Optimal value (cvx_optval): +1533.79

Hmm, that;s not too great because SeDuMi ran into numerical problems and CVX declared it inaccurate/solved.

Can you try it with Mosek and SDPT3, and if you have it, Gurobi?

Dear Mark,

I try to run the code with Mosek and SDPT3. Unfortunately, The MOSEK fails, and the matlab is crashed when use SDPT3.

Using Pade approximation for exponential
cone with parameters m=3, k=3
=====================================
=====================================
Using Pade approximation for exponential
cone with parameters m=3, k=3
=====================================
=====================================
Using Pade approximation for exponential
cone with parameters m=3, k=3
=====================================
 
Calling Mosek 8.0.0.60: 38876 variables, 14740 equality constraints
   For improved efficiency, Mosek is solving the dual problem.
------------------------------------------------------------

MOSEK Version 8.0.0.60 (Build date: 2017-3-1 13:09:33)
Copyright (c) MOSEK ApS, Denmark. WWW: mosek.com
Platform: Windows/64-X86

MOSEK warning 710: #3 (nearly) zero elements are specified in sparse col '' (2) of matrix 'A'.
MOSEK warning 710: #4 (nearly) zero elements are specified in sparse col '' (3) of matrix 'A'.
MOSEK warning 710: #3 (nearly) zero elements are specified in sparse col '' (7) of matrix 'A'.
MOSEK warning 710: #4 (nearly) zero elements are specified in sparse col '' (8) of matrix 'A'.
MOSEK warning 710: #3 (nearly) zero elements are specified in sparse col '' (12) of matrix 'A'.
MOSEK warning 710: #4 (nearly) zero elements are specified in sparse col '' (13) of matrix 'A'.
MOSEK warning 710: #3 (nearly) zero elements are specified in sparse col '' (17) of matrix 'A'.
MOSEK warning 710: #4 (nearly) zero elements are specified in sparse col '' (18) of matrix 'A'.
MOSEK warning 710: #3 (nearly) zero elements are specified in sparse col '' (22) of matrix 'A'.
MOSEK warning 710: #5 (nearly) zero elements are specified in sparse col '' (23) of matrix 'A'.
Warning number 710 is disabled.
Problem
  Name                   :                 
  Objective sense        : min             
  Type                   : CONIC (conic optimization problem)
  Constraints            : 14740           
  Cones                  : 11520           
  Scalar variables       : 38876           
  Matrix variables       : 0               
  Integer variables      : 0               

Optimizer started.
Conic interior-point optimizer started.
Presolve started.
Linear dependency checker started.
Linear dependency checker terminated.
Eliminator started.
Freed constraints in eliminator : 292
Eliminator terminated.
Eliminator - tries                  : 1                 time                   : 0.00            
Lin. dep.  - tries                  : 1                 time                   : 0.00            
Lin. dep.  - number                 : 0               
Presolve terminated. Time: 0.05    
Optimizer  - threads                : 2               
Optimizer  - solved problem         : the primal      
Optimizer  - Constraints            : 6856
Optimizer  - Cones                  : 11520
Optimizer  - Scalar variables       : 36183             conic                  : 34560           
Optimizer  - Semi-definite variables: 0                 scalarized             : 0               
Factor     - setup time             : 0.05              dense det. time        : 0.00            
Factor     - ML order time          : 0.00              GP order time          : 0.00            
Factor     - nonzeros before factor : 2.07e+004         after factor           : 2.12e+004       
Factor     - dense dim.             : 0                 flops                  : 2.95e+005       
ITE PFEAS    DFEAS    GFEAS    PRSTATUS   POBJ              DOBJ              MU       TIME  
0   4.3e+000 1.0e+001 2.2e+003 0.00e+000  3.775560871e+004  2.456078795e+003  1.0e+000 0.20  
1   2.9e+000 6.9e+000 2.3e+003 7.82e-002  1.863605495e+004  -2.868629310e+003 6.8e-001 0.33  
2   1.7e+000 3.9e+000 1.8e+003 4.70e-001  1.118263278e+004  -1.404844579e+003 3.8e-001 0.36  
3   3.6e-001 8.5e-001 1.0e+003 9.02e-001  2.166740272e+003  -4.727152052e+002 8.4e-002 0.38  
4   1.5e-001 3.5e-001 5.8e+002 1.19e+000  -1.570638054e+001 -1.061732219e+003 3.5e-002 0.41  
5   8.3e-002 2.0e-001 4.1e+002 1.07e+000  -7.343220648e+002 -1.313588258e+003 1.9e-002 0.44  
6   3.3e-002 7.7e-002 2.3e+002 9.99e-001  -1.305856724e+003 -1.543421271e+003 7.6e-003 0.45  
7   2.4e-002 5.6e-002 1.8e+002 8.04e-001  -1.420242709e+003 -1.612174240e+003 5.5e-003 0.48  
8   1.0e-002 2.5e-002 1.1e+002 8.41e-001  -1.649675132e+003 -1.741374948e+003 2.4e-003 0.50  
9   8.3e-003 2.0e-002 8.5e+001 5.80e-001  -1.685959474e+003 -1.769475857e+003 1.9e-003 0.53  
10  3.3e-003 7.8e-003 4.3e+001 6.16e-001  -1.833239951e+003 -1.875052764e+003 7.7e-004 0.56  
11  1.5e-003 3.5e-003 2.3e+001 5.68e-001  -1.923036343e+003 -1.946950632e+003 3.5e-004 0.58  
12  1.1e-003 2.5e-003 1.5e+001 2.29e-001  -1.947055160e+003 -1.970097919e+003 2.5e-004 0.61  
13  3.2e-004 7.5e-004 5.6e+000 3.98e-001  -2.061654911e+003 -2.071236846e+003 7.4e-005 0.64  
14  1.2e-004 2.9e-004 2.1e+000 2.77e-001  -2.129926079e+003 -2.136061607e+003 2.9e-005 0.66  
15  5.7e-005 1.3e-004 1.0e+000 3.04e-001  -2.187382812e+003 -2.191297036e+003 1.3e-005 0.69  
16  1.9e-005 4.5e-005 3.7e-001 2.72e-001  -2.260566339e+003 -2.262696012e+003 4.4e-006 0.72  
17  8.5e-006 2.0e-005 1.6e-001 1.96e-001  -2.311063134e+003 -2.312561753e+003 2.0e-006 0.73  
18  2.7e-006 6.3e-006 5.3e-002 2.20e-001  -2.386604705e+003 -2.387363897e+003 6.2e-007 0.77  
19  1.2e-006 2.8e-006 2.2e-002 1.28e-001  -2.433711070e+003 -2.434283367e+003 2.8e-007 0.78  
20  4.9e-007 1.1e-006 1.0e-002 3.21e-001  -2.495232078e+003 -2.495545899e+003 1.1e-007 0.81  
21  2.9e-007 6.7e-007 5.2e-003 1.97e-002  -2.521843926e+003 -2.522135393e+003 6.6e-008 0.84  
22  7.7e-008 1.8e-007 1.7e-003 2.32e-001  -2.609318412e+003 -2.609434770e+003 1.8e-008 0.86  
23  2.9e-008 6.7e-008 5.5e-004 7.35e-002  -2.664982811e+003 -2.665058293e+003 6.6e-009 0.89  
24  9.1e-009 2.1e-008 2.0e-004 2.21e-001  -2.736005920e+003 -2.736040005e+003 2.1e-009 0.91  
25  4.0e-009 9.5e-009 7.4e-005 -2.25e-003 -2.780206594e+003 -2.780228756e+003 9.4e-010 0.94  
26  1.1e-009 2.7e-009 2.4e-005 2.16e-001  -2.860221405e+003 -2.860227421e+003 2.7e-010 0.97  
27  4.6e-010 2.2e-009 8.8e-006 1.21e-001  -2.912393893e+003 -2.912393421e+003 1.1e-010 0.98  
28  1.5e-010 1.0e-008 3.2e-006 2.38e-001  -2.979096095e+003 -2.979092527e+003 3.5e-011 1.01  
29  7.3e-011 1.4e-008 1.4e-006 6.09e-002  -3.017852197e+003 -3.017844859e+003 1.7e-011 1.03  
30  2.1e-011 5.8e-008 4.5e-007 2.30e-001  -3.094184842e+003 -3.094178052e+003 4.8e-012 1.06  
31  7.7e-012 1.2e-007 1.5e-007 6.89e-002  -3.147460059e+003 -3.147450047e+003 1.8e-012 1.09  
32  2.7e-012 6.3e-007 6.1e-008 3.04e-001  -3.210689717e+003 -3.210682272e+003 6.3e-013 1.11  
33  1.3e-012 8.4e-007 2.5e-008 2.89e-002  -3.246810778e+003 -3.246800542e+003 3.0e-013 1.14  
34  3.5e-013 3.8e-006 7.9e-009 1.64e-001  -3.321231081e+003 -3.321222837e+003 8.2e-014 1.16  
35  1.3e-013 2.6e-005 2.6e-009 4.84e-002  -3.372776623e+003 -3.372766206e+003 3.0e-014 1.19  
36  5.3e-013 1.3e-004 2.5e-009 2.56e-001  -3.375000547e+003 -3.374990223e+003 2.9e-014 1.29  
37  5.3e-013 1.3e-004 2.5e-009 2.50e-001  -3.375044814e+003 -3.375034491e+003 2.9e-014 1.37  
38  5.1e-013 1.3e-004 2.4e-009 2.49e-001  -3.377606712e+003 -3.377596493e+003 2.8e-014 1.48  
39  5.0e-013 1.3e-004 2.4e-009 2.44e-001  -3.378169633e+003 -3.378159436e+003 2.8e-014 1.59  
40  5.0e-013 1.3e-004 2.4e-009 2.42e-001  -3.378242396e+003 -3.378232202e+003 2.7e-014 1.69  
41  4.6e-013 1.2e-004 2.2e-009 2.41e-001  -3.383506040e+003 -3.383496050e+003 2.5e-014 1.78  
42  4.6e-013 1.2e-004 2.2e-009 2.31e-001  -3.383602825e+003 -3.383592838e+003 2.5e-014 1.90  
43  5.7e-013 1.2e-004 2.2e-009 2.30e-001  -3.384186740e+003 -3.384176775e+003 2.5e-014 2.01  
44  5.6e-013 1.2e-004 2.2e-009 2.30e-001  -3.384746768e+003 -3.384736823e+003 2.5e-014 2.11  
45  5.5e-013 1.1e-004 2.1e-009 2.28e-001  -3.385523675e+003 -3.385513758e+003 2.4e-014 2.21  
46  5.7e-013 1.1e-004 2.1e-009 2.26e-001  -3.385999927e+003 -3.385990027e+003 2.4e-014 2.31  
47  5.4e-013 1.1e-004 2.0e-009 2.25e-001  -3.388601509e+003 -3.388591701e+003 2.3e-014 2.40  
48  5.4e-013 1.1e-004 2.0e-009 2.20e-001  -3.388868824e+003 -3.388859025e+003 2.3e-014 2.51  
49  4.9e-013 9.8e-005 1.9e-009 2.19e-001  -3.394188156e+003 -3.394178537e+003 2.1e-014 2.61  
50  5.1e-013 9.6e-005 1.8e-009 2.10e-001  -3.395397982e+003 -3.395388402e+003 2.1e-014 2.75  
51  4.8e-013 9.6e-005 1.8e-009 2.08e-001  -3.395673489e+003 -3.395663918e+003 2.1e-014 2.84  
52  4.1e-013 8.1e-005 1.6e-009 2.07e-001  -3.405755794e+003 -3.405746540e+003 1.7e-014 2.92  
53  4.5e-013 8.0e-005 1.6e-009 1.96e-001  -3.406340880e+003 -3.406331642e+003 1.7e-014 3.01  
54  4.5e-013 8.0e-005 1.6e-009 1.95e-001  -3.406451531e+003 -3.406442296e+003 1.7e-014 3.09  
55  4.5e-013 9.8e-005 1.4e-009 1.94e-001  -3.411138027e+003 -3.411128925e+003 1.6e-014 3.18  
56  4.3e-013 1.1e-004 1.4e-009 1.88e-001  -3.412916674e+003 -3.412907620e+003 1.5e-014 3.28  
57  4.3e-013 1.1e-004 1.4e-009 1.86e-001  -3.413447609e+003 -3.413438570e+003 1.5e-014 3.38  
58  4.3e-013 1.0e-004 1.4e-009 1.85e-001  -3.413527456e+003 -3.413518418e+003 1.5e-014 3.50  
59  4.1e-013 1.0e-004 1.3e-009 1.85e-001  -3.416133256e+003 -3.416124287e+003 1.4e-014 3.57  
60  4.1e-013 9.9e-005 1.3e-009 1.82e-001  -3.416604825e+003 -3.416595868e+003 1.4e-014 3.67  
61  3.7e-013 9.5e-005 1.2e-009 1.81e-001  -3.421946019e+003 -3.421937200e+003 1.3e-014 3.77  
62  3.7e-013 9.5e-005 1.2e-009 1.76e-001  -3.422058822e+003 -3.422050005e+003 1.3e-014 3.87  
63  2.2e-013 1.7e-004 4.4e-010 1.75e-001  -3.481107941e+003 -3.481100586e+003 4.3e-015 3.96  
64  2.2e-013 1.7e-004 4.4e-010 1.26e-001  -3.481107941e+003 -3.481100586e+003 4.3e-015 4.06  
Interior-point optimizer terminated. Time: 4.20. 

Optimizer terminated. Time: 4.27    

Interior-point solution summary
  Problem status  : ILL_POSED
  Solution status : DUAL_ILLPOSED_CER
  Primal.  obj: -1.5179485844e-002  nrm: 6e+002   Viol.  con: 4e-012   var: 2e-006   cones: 3e-005 
Optimizer summary
  Optimizer                 -                        time: 4.27    
    Interior-point          - iterations : 65        time: 4.20    
      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    

Mosek error: MSK_RES_TRM_STALL ()
------------------------------------------------------------
Status: Failed
Optimal value (cvx_optval): NaN

Look at A. Mosek is warning about small non-zero elements. What is the magnitude of the smallest magnitude non-zero element in A ? Either re-scaling is needed, or perhaps roundoff error level non-zero elements in A should be set to exactly zero.

Mosek was not able to achieve termination criteria, :appearing to “blame” it on the problem being dual ill-posed Given that CVX passed the dual of your original problem to Mosek, I think this means that Mosek has found your primal problem to be ill-posed. Perhaps very small magnitude non-zero elements in A are contributing to or causing this ill-posedness.

1 Like

Now 3 optimizers could not produce an optimal solution.

And Mosek tells you that your problem is broken. SeDuMi says

|Ax-b| = 9.7e-06, [Ay-c]_+ = 2.3E-07, |x|= 5.3e+07, |y|= 5.5e+07

so that indicates attainment issues since the solutions are very large,

So maybe the conclusion is that your problem is badly posed.

Dear Mark,

I will try and rescale some parameter vaules, then run the code.