I am solving a convex problem in CVX 2.2 with Mosek 9.1.9. But every time it fails.
The following is the output. Could you please tell me what is wrong here. I think this problem abides by the DCP ruleset.
cvx_begin
cvx_precision default
cvx_solver mosek
variables obj(1) rho(n*m,1) p_ub(K,1) x(K,1)
minimize (obj)
rho’c + sqrt(p0/(1-p0))norm(COV_crho,2) <= obj;
for l = 1:K
0.5x(l)log(p1) - 0.5log(1-p_ub(l)) + log(V(l)) <= log(xi(l) - rho’*d{l});
x(l)*log(p1) <= log(p_ub(l));
end
sum(x) == 1;
x >= 0;
rho’*A == (1-alpha)*gamma’;
rho >= 0;
cvx_end
CVX Warning:
Models involving “log” 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.
Calling Mosek 9.1.9: 1152 variables, 531 equality constraints
For improved efficiency, Mosek is solving the dual problem.
Please try with more recent Mosek (10.1.16 is the last one).
Please don’t use cvx_precision.
If that doesn’t help please either post a fully reproducible example with input data or save the task file (1 Technical Issues — MOSEK FAQ 10.1.15) and send to Mosek support
In order to carry out @Michal_Adamaszek suggestion to use the latest version of Mosek:
Download the latest stable Mosek version, currently 10.1.16, from the Mosek werbsite. You can use that instead of Mosek 9.1.9, which is bundled with CVX 2.2…
To make sure you don’t wind up using Mosek 9.1.9 which is bundled with CVX 2.2:
Download the latest Mosek from the Mosek werbsite and install it under MATLAB. Make sure mosekdiag succeeds. Then reinstall CVX so it will find the new solver.
Either delete or rename the mosek directory under CVX (before reinstalling CVX)
or cvx_solver shows all the versions of all the solvers available to CVX. Choose the Mosek 10.x version, which might be called something like Mosek_2, then use cvx_solver Mosek_2 to get that version, and you can save_prefs.
In any event, cvx_solver will show all the versions available to CVX.
1.First problem: My MOSEK version: 10.1.16 was installed successfully in the command line window, but the version displayed under cvx_solver was not correct. mosekdiag Matlab version : 9.11.0.1769968 (R2021b) Architecture : PCWIN64 mosekopt path : C:\Program Files\Mosek\10.1\toolbox\r2017aom\mosekopt.mexw64 MOSEK version : 10.1.16 Test linear solve: Success mosekopt works OK. You can use MOSEK in MATLAB. >> cvx_solver
Name Status Version Location* -----------------------------------------------------------------------------------------
2.The second question is in the cvx code section, how should we choose the version?
code:
‘*cvx_begin * cvx_solver mosek’
, then the command line indicates: MOSEK Version 9.1.9 (Build date: 2019-11-21 11:34:40)
The version 9.1.9 displayed by CVX is wrong. I never quite understood why it does that. You can always trust the version printed by Mosek itself in the summary and also in the log when it starts solving.
Judging from your list you should choose cvx_solver Mosek_2 to get Mosek 10.1
I installed Mosek for Windows(64bit x 86) from link Mosek - Downloads , but after installation In MATLAB command window, if I type mosekdiag or msktestlic getting as Unrecognized function or variable ‘mosekdiag’ or Unrecognized function or variable ‘msktestlic’ respectively. Also, if I type C:\Users\Rajashekhar\mosek\10.1\tools\platform\win64x86\bin
↑
Invalid use of operator.
Even I restarted MATLAB, not solved
Trying to run msktestlic or some binaries inside matlab is pointless, these can be used in the command line (of the operating system), they are not matlab scripts.
I am not getting how to Check that the path
\mosek\10.1\tools\platform<PLATFORM>\bin
was added to the OS variable PATH or not.
Also, in MATLAB command window if I type
addpath C:\Users\Rajashekhar\mosek\10.1\toolbox\r2017a
Warning: Name is nonexistent or not a directory:
C:\Users\Rajashekhar\mosek\10.1\toolbox\r2017a
In path (line 109)
In addpath>doPathAddition (line 116)
In addpath (line 80)
I am getting above one. And also still getting
Unrecognized function or variable ‘mosekdiag’ in matlab if run mosekdiag. Please help me. Only if I run the msktestlic in the command prompt saying A license was checked out correctly.
Sir, I downloaded & installed latest version of Mosek in the folder "C:\Users\Rajashekhar" . Is it fine or I have to install in "C:\Program Files\MATLAB" only?
You can install Mosek anywhere you like, using any installer. It makes no difference, you choose. If you use the MSI installer the PATH will be set for you, and the only thing you have to do is “addpath” in Matlab and setting up the license.
I think Windows administration issues are a bit out of the scope of this CVX forum. If you have trouble installing Mosek you can for example ask at the Mosek forum https://groups.google.com/g/mosek or write an email to support or check the troubleshooting section in the installation manual.
If you installed Mosek where you claim you did, but you don’t have the toolbox folder then maybe you installed the 32bit version instead of the 64bit.
Also, here cvx_solver Mosek_2 I need to select right (not Mosek_3) to get latest version?
Also even with the latest Mosek_2 version, I am not getting even accurate result and also even simulation run-time in MATLAB is also same as that of earlier version of Mosek 9.1.9? But usually latest Mosek_2 version should perform better right??