Mosek is a versatile linear, quadratic, quadratically constrained and conic optimizer that supports continuous and discrete variables.

[Read More] [Options] [Changes] [Download]

How to use it

ampl: option solver mosek; # change the solver
ampl: option mosek_options 'option1=value1 option2=value2'; # specify options
ampl: solve; # solve the problem

At a glance



Solver options

Full list of solver options:

Many solver parameters can be changed directly from AMPL, by specifying them as a space separated string in the option mosek_options. A list of all supported options is available here or can be obtained by executing the solver driver with the -= command line parameter:

mosek -=

or from AMPL:

shell "mosek -=";

Solver options can have multiple aliases, to accomodate for different user types. The main numenclature is given first in the -= output, then followed by aliases in brackets, see for example the listing for lim:iter:

lim:iter (iterlim, iterlimit)
      Iteration limit (default: no limit).

The main numenclature contains a prefix (lim: in this case) to help categorize and find the options relevant to a context. To list only the options with a specific prefix (lim: for this example), run:

mosek -=lim:

Specifying solver options and solving a model

After formulating the model in AMPL, execute the following to select Mosek as solver and pass the two options: return_mipgap=3 and outlev=1.

option solver mosek;
option mosek_options "retmipgap=3 outlev=1";

Retrieving solutions

The outcome of the last optimization is stored in the AMPL parameter solve_result_num and the relative message in solve_result.

display solve_result_num, solve_result;