I have a problem with a vector variable $w \in \mathbb{R}^n$ and a symmetric matrix variable $V \in \mathbb{R^{n \times n}}$. I am solving a problem which is roughly like:

\begin{align} \begin{array}{ll} \max & \sqrt{\operatorname{trace}(A^\top V A)} + a^\top w + \operatorname{entropy}(w) \\ \mathrm{s.t. }& \text{some linear constraints over $w$, and $V$}\\ & V \succeq ww^\top \end{array} \end{align} where by Schur complement the last constraint can be: \begin{align} \begin{pmatrix} V & w \\ w^\top & 1 \end{pmatrix} \succeq 0. \end{align}

So, I have a positive semi-definiteness constraint, some linear constraints, and the function that I am maximizing is concave because the square root of a linear function is concave, as well as the entropy.

I am using YALMIP - MATLAB combination to call a solver. However, MOSEK cannot solve this. I know MOSEK can solve entropy maximization over some conic constraints (exponential cone solver), but this problem is not being able to solve.

Am I using MOSEK wrongly? Would you expect MOSEK to solve this problem? If not, which convex optimization solver shall I try using?

  • 1
    $\begingroup$ As discussed below, this is solvable using YALMIP + Mosek now with the bug fix in the latest develop branch. Also make sure to use convexity aware operator sqrtm and not general nonlinear function sqrt. $\endgroup$ – Johan Löfberg Mar 28 '20 at 17:31
  • $\begingroup$ @JohanLöfberg Shall I check here for the difference between sqrt and sqrtm: yalmip.github.io/squareroots The thing is, trace is scalar so I don't get why it is beneficial to use sqrtm. $\endgroup$ – independentvariable Mar 28 '20 at 20:02
  • 1
    $\begingroup$ It doesn't have anything to do with scalar vs matrix in YALMIP. sqrtm is convexity aware and modelled by SOCP cones, sqrt is a callback based. $\endgroup$ – Johan Löfberg Mar 29 '20 at 8:03
  • 1
    $\begingroup$ ...and I got it backwards. sqrt is the operator to use, sqrtm is the general nonlinear $\endgroup$ – Johan Löfberg Mar 29 '20 at 13:54

EDIT: Per comment below by YALMIP deveeloper Johan Lofberg, the bug in YALMIP was a typo, which has now been corrected and available at https://github.com/yalmip/YALMIP/archive/develop.zip . Using this newest develop version of YALMIP, Mosek should now be able to solve the problem.

Edited to reflect YALMIP developer's acknowledgement that there is a bug in YALMIP.

Mosek should be able to solve this, and indeed can (see below) under CVX 2.2.

There is a bug in YALMIP which results in an error message when entropy is used in combination with an SDP constraint with the solvers Mosek or SCS.

For example,


Unrecognized function or variable 'sdpDAta'.
Error in normalizeExponentialCone (line 236)
            sdpDAta(end,size(model.F_struc,2)) = 0;
Error in callmosek>call_mosek_lpqpsocpsdp (line 84)
[model,output] = normalizeExponentialCone(model);
Error in callmosek (line 51)
    [x,D_struc,problem,r,res,solvertime,prob] = call_mosek_lpqpsocpsdp(model);
Error in solvesdp (line 361)
    eval(['output = ' solver.call '(interfacedata);']);
Error in optimize (line 31)
[varargout{1:nargout}] = solvesdp(varargin{:}); 

Similarly with SCS as solver (which absent the YALMIP bug, also should be able to solve this).

See the YALMIP forum topic Entropy + SDP constraint with Mosek and SCS: Unrecognized function or variable 'sdpDAta' which I just opened, to which the YALMIP developer, Johan Lofberg, has now responded, acknowledging the bug.

CVX 2.2 + Mosek 9.1 as solver can handle this.

cvx_begin sdp
variable V(3,3) symmetric
variable w(3)
% Insert other constraints here
[V w;w' 1] >= 0
cvx_solver mosek
  • $\begingroup$ Johan replied to my YALMIP forum topic, acknowledging that is is a bug. Anyhow, as I mentioned in the answer. CVX 2.2 + Mosek as solver can handle this, using syntax not all that different than YALMIP. $\endgroup$ – Mark L. Stone Mar 28 '20 at 12:07
  • 2
    $\begingroup$ It's been fixed in the develop branch now (typo in code, simply change sdpDAta to sdpData on the line that crashes in matlab...) $\endgroup$ – Johan Löfberg Mar 28 '20 at 17:06
  • 1
    $\begingroup$ @Johan Löfberg Thanks. I guess you held the shift key for a fraction of a second longer than you should have during coding. $\endgroup$ – Mark L. Stone Mar 28 '20 at 17:15
  • 2
    $\begingroup$ Yes, and obviously I am missing a test in my test suite. $\endgroup$ – Johan Löfberg Mar 28 '20 at 17:30
  • $\begingroup$ This is a great answer, thanks Mark! @JohanLöfberg thanks for updating YALMIP! $\endgroup$ – independentvariable Mar 28 '20 at 17:57

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.