6
$\begingroup$

I have a code in MATLAB which uses YALMIP to structure my optimization model and solve it via a solver. I would like to obtain a .mps file out of my model, apparently, YALMIP does not produce this if I am not mistaken. I would like to obtain a .mps file, how can I do this?

Edit: I know this is not an OR question, but I am sure a lot of OR people may face this challenge someday.

$\endgroup$
  • 1
    $\begingroup$ I think, this is an OR question :) $\endgroup$ – Marco Lübbecke Oct 30 '19 at 10:09
  • $\begingroup$ at least not theory :P $\endgroup$ – independentvariable Oct 30 '19 at 10:55
2
$\begingroup$

I am not an expert in YALMIP but you may check the saveampl(F,h,filename) command written in YALMIP website. An example of the implementation is given as:

x = sdpvar(3,1);
A = randn(5,3);
b = randn(5,1);
c = randn(3,1);
F = [A*x <= b, integer(x(2:3))];
saveampl(F,c'*x,'myamplmodel.mod');

where I think you can save the model with .mps extension instead of .mod.

$\endgroup$
  • 1
    $\begingroup$ I think this is wrong since ``` saveampl exports a YALMIP model to an AMPL model. ``` $\endgroup$ – independentvariable Oct 29 '19 at 16:25
  • 1
    $\begingroup$ @independentvariable, as I mentioned you may save it as .mps by changing .dat to .mps where the saveampl gives the option to mention the extension of your file in the command. $\endgroup$ – Oguz Toragay Oct 29 '19 at 16:36

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.