MOSEK solver for MILP with YALMIP

731 views
Skip to first unread message

Giannis Kalogeropoulos

unread,
Dec 28, 2015, 1:47:29 PM12/28/15
to YALMIP
Hello everyone!!

I had a QP and afterwords I added some binary variables. The solver I use for my problem is MOSEK, but after executing my program i receive the following message :

Mosek error: MSK_RES_ERR_LICENSE_FEATURE (The feature 'PTOM' is not in license file. Consult the license manager error message.)

What should I do in order to use the mixed integer conic optimizer??

Many thanks in advance!!

Giannis Kalogeropoulos

Johan Löfberg

unread,
Dec 28, 2015, 1:57:41 PM12/28/15
to YALMIP
Contact Mosek. You obviously don't have a license for binary problems

Erling D. Andersen

unread,
Dec 29, 2015, 3:06:12 AM12/29/15
to YALMIP
MOSEK has two mixed-integer optimizers and one comes for free and the other is an expensive paid add on we are phasing out. See


You get the error because you try to use the paid one. However, if you set parameter


to


MOSEK should solve the problem. Btw this will be only option in version 8 to be released soon.



Erling D. Andersen

unread,
Dec 29, 2015, 3:06:48 AM12/29/15
to YALMIP
Btw I understand if you find it confusing but it will cleaned up in version 8.

Giannis Kalogeropoulos

unread,
Dec 29, 2015, 8:39:09 AM12/29/15
to YALMIP
Firstly thank you very much for the interest you showed on my case!!!

I see your point but I don't know (or I can't understand) how can I change solver parameters while using yalmip!! For instance, I quote a part of my matlab code where I solve the optimization problem in order to help me on how can I change it, i.e. which commands should I use to change optimizer parameters.

for i = 1:t
 
    if i==1
       
        e_1{1} = e0_1;%Starting with zero initial values
        e_2{1} = e0_2;%Starting with zero initial values
       
    else
       
        e_1{1} = D_1 * e_opt_1(:,i-1) + u_opt_1(:,i-1);%State update using optimal solution P_con_1{1} and optimal state e_1{1}
        e_2{1} = D_2 * e_opt_2(:,i-1) + u_opt_2(:,i-1);%State update using optimal solution P_con_2{1} and optimal state e_2{1}
       
    end
   
    constraints = [];%Initiallization of constraint matrices
    F = 0;%Objective function Initiallization
    F_1 = 0;
    F_2 = 0;
    P_1 = zeros(2,N_c);
    P_2 = zeros(1,N_c);
    sum_1 = zeros(N_c,1);
    sum_2 = zeros(N_c,1);
   
    for k = 1:N_c
       
        for j = 1:N_c
           
            P_1(2,j) = P_shifted_1(j+k-1);
            P_2(1,j) = P_shifted_2(j+k-1);
           
        end
       
        %Objective function
        F_1 = F_1 + (norm(Y_1*(P_unc_1(:,i+k-1)+P_con_1{k}+P_1*d_1{k}) - Q_spot_1(i+k-1),2))^2;
        F_2 = F_2 + (norm(Y_2*(P_unc_2(:,i+k-1)+P_con_2{k}+P_2*d_2{k}) - Q_spot_2(i+k-1),2))^2;
        F = F_1 + F_2;
        sum_1 = sum_1 + d_1{k};
        sum_2 = sum_2 + d_2{k};
   
        %Subject to
        constraints = [constraints, e_1{k+1} == D_1 * e_1{k} + P_con_1{k}];
        constraints = [constraints, e_2{k+1} == D_2 * e_2{k} + P_con_2{k}];
        constraints = [constraints, T_1{k} == R_1 * (P_unc_1(:,i+k-1)+P_con_1{k})];
        constraints = [constraints, T_2{k} == R_2 * (P_unc_2(:,i+k-1)+P_con_2{k})];
        constraints = [constraints, e_min_1 <= e_1{k+1} <= e_max_1];
        constraints = [constraints, e_min_2 <= e_2{k+1} <= e_max_2];
        constraints = [constraints, p_min_1 <= P_con_1{k} <= p_max_1];
        constraints = [constraints, p_min_2 <= P_con_2{k} <= p_max_2];
        constraints = [constraints, T_1{k} + T_2{k} <= f_max];
       
    end

    constraints = [constraints, sum_1 == ones(N_c,1), sum_2 == ones(N_c,1)];
    %Solver selection(MOSEK)
    options = sdpsettings('solver', 'mosek');
    %problem solved for each BRP
    controller = optimize(constraints, F, options);
 
    u_opt_1(:,i) = value(P_con_1{1});
    u_opt_2(:,i) = value(P_con_2{1});
    T_opt_1(:,i) = value(T_1{1});
    T_opt_2(:,i) = value(T_2{1});
    e_opt_1(:,i) = value(e_1{1});
    e_opt_2(:,i) = value(e_2{1});

end

Where all the variables are sdp ones, while variables d_1{k} and d_2{k} are binaries!!

Thank you in advance!!

Erling D. Andersen

unread,
Dec 29, 2015, 8:43:18 AM12/29/15
to YALMIP
The page http://users.isy.liu.se/johanl/yalmip/pmwiki.php?n=Solvers.MOSEK does not show how to set MOSEK specific parameters. There must way a way to do it but I cannot help.

Johan Löfberg

unread,
Dec 29, 2015, 8:53:59 AM12/29/15
to YALMIP
options = sdpsettings('solver','mosek','mosek.MSK_IPAR_OPTIMIZER',' MSK_OPTIMIZER_MIXED_INT_CONIC')


Giannis Kalogeropoulos

unread,
Dec 29, 2015, 9:34:49 AM12/29/15
to YALMIP
Thank you very much prof. Johan Löfberg!!!

I used the command you suggested and the message I got back from the solver was :

MOSEK Error 1217     : The parameter value string 'MSK_OPTIMIZER_MIXED_INT_CONIC' for parameter param.MSK_IPAR_OPTIMIZER is incorrect.
Return code - 1217 [MSK_RES_ERR_PARAM_VALUE_STR] [A parameter value string is incorrect.]

So there must be a spelling issue...

Johan Löfberg

unread,
Dec 29, 2015, 11:04:28 AM12/29/15
to YALMIP
Don't know. I just copied Erlings comment

Erling D. Andersen

unread,
Dec 29, 2015, 1:47:33 PM12/29/15
to YALMIP
The error will occur if you use an old MOSEK version. I would use version 7.1.

You could try

[r,res] = mosekopt('symbcon'); 
sc = res.symbcon
options = sdpsettings('solver','mosek','mosek.MSK_IPAR_OPTIMIZER',sc.MSK_OPTIMIZER_MIXED_INT_CONIC)

as indicated at

If yalmip accepts sc.MSK_OPTIMIZER_MIXED_INT_CONIC instead of the string value MSK_OPTIMIZER_MIXED_INT_CONIC'.


Johan Löfberg

unread,
Dec 29, 2015, 3:19:16 PM12/29/15
to YALMIP
yalmip accepts anything for options value

Giannis Kalogeropoulos

unread,
Dec 30, 2015, 1:21:51 AM12/30/15
to YALMIP
I would like to thank both of you!!!

The problem was that I used Mosek 6.0 instead of 7.1, and that's why yalmip didn't recognize the option values prof. Lofberg mentioned above!!!

Your help was invaluable to me, as my deadlines for the dissertation of mine are very tight and your immediate responses helped me a lot!!!

Thanks again both of you!!

With regards,
Giannis Kalogeropoulos

Johan Löfberg

unread,
Dec 30, 2015, 4:57:01 AM12/30/15
to YALMIP
YALMIP accepts any option. It is Mosek which doesn't like the supplied value

Erling D. Andersen

unread,
Dec 30, 2015, 5:01:13 AM12/30/15
to YALMIP
MOSEK version 6 did not like the value because that value could only be used in version 7 and forward. That is the way it has to be.

One lesson that can learned is: Tell which version of the software you are using and you will help support a lot.






Giannis Kalogeropoulos

unread,
Dec 30, 2015, 5:14:08 AM12/30/15
to YALMIP
I want to correct something I said in my previous message...

By saying invaluable I meant priceless!!! In Greek both words have the same meaning...

It was my fault omitting to mention the version I used...

Thanks a lot again!!
Reply all
Reply to author
Forward
0 new messages