The MOSEK command line tool Version 7.0 (Revision 141)

The MOSEK command line tool. Version 7.0 ... - Documentation The MOSEK command line tool. Version 7.0 ... - Documentation

25.11.2015 Views

12 CHAPTER 3. MOSEK AND AMPL Value Message 0 the solution is optimal. 100 suboptimal primal solution. 101 superoptimal (dual feasible) solution. 150 the solution is near optimal. 200 primal infeasible problem. 300 dual infeasible problem. 400 too many iterations. 500 solution status is unknown. 501 ill-posed problem, solution status is unknown. ≥ 501 The value - 501 is a MOSEK response code. See Appendix 10 for all MOSEK response codes. Figure 3.1: Interpretation of solve result num. when the AMPL shell has started type the commands: ampl: model diet.mod; ampl: data diet.dat; ampl: option solver mosek; ampl: solve; The resulting output is: MOSEK finished. Problem status - PRIMAL AND DUAL FEASIBLE Solution status - OPTIMAL Primal objective - 14.8557377 Dual objective - 14.8557377 Objective = Total Cost 3.4 Determining the outcome of an optimization The AMPL parameter solve result num is used to indicate the outcome of the optimization process. It is used as follows ampl: display solve result num Please refer to table 3.1 for possible values of this parameter. 3.5 Optimizer options 3.5.1 The MOSEK parameter database The MOSEK optimizer has options and parameters controlling such things as the termination criterion and which optimizer is used. These parameters can be modified within AMPL as shown in the example

3.6. CONSTRAINT AND VARIABLE NAMES 13 below: ampl: model diet.mod; ampl: data diet.dat; ampl: option solver mosek; ampl: option mosek options ampl? ’msk ipar optimizer = msk optimizer primal simplex \ ampl? msk ipar sim max iterations = 100000’; ampl: solve; In the example above a string called mosek options is created which contains the parameter settings. Each parameter setting has the format parameter name = value where ”parameter name” can be any valid MOSEK parameter name. See Appendix 9 for a description of all valid MOSEK parameters. An alternative way of specifying the options is ampl: option mosek options ampl? ’msk ipar optimizer = msk optimizer primal simplex’ ampl? ’ msk ipar sim max iterations = 100000’; New options can also be appended to an existing option string as shown below ampl: option mosek options $mosek options ampl? ’ msk ipar sim print freq = 0 msk ipar sim max iterations = 1000’; The expression $mosek options expands to the current value of the option. Line two in the example appends an additional value msk ipar sim max iterations to the option string. 3.5.2 Options 3.5.2.1 outlev MOSEK also recognizes the outlev option which controls the amount of printed output. 0 means no printed output and a higher value means more printed output. An example of setting outlev is as follows: ampl: option mosek options ’outlev=2’; 3.5.2.2 wantsol MOSEK recognize the option wantsol. We refer the reader to the AMPL manual [1] for details about this option. 3.6 Constraint and variable names AMPL assigns meaningfull names to all the constraints and variables. Since MOSEK uses item names in error and log messages, it may be useful to pass the AMPL names to MOSEK. Using the command

3.6. CONSTRAINT AND VARIABLE NAMES 13<br />

below:<br />

ampl: model diet.mod;<br />

ampl: data diet.dat;<br />

ampl: option solver mosek;<br />

ampl: option mosek options<br />

ampl? ’msk ipar optimizer = msk optimizer primal simplex \<br />

ampl? msk ipar sim max iterations = 100000’;<br />

ampl: solve;<br />

In the example above a string called mosek options is created which contains the parameter settings.<br />

Each parameter setting has the format<br />

parameter name = value<br />

where ”parameter name” can be any valid <strong>MOSEK</strong> parameter name. See Appendix 9 for a description<br />

of all valid <strong>MOSEK</strong> parameters.<br />

An alternative way of specifying the options is<br />

ampl: option mosek options<br />

ampl? ’msk ipar optimizer = msk optimizer primal simplex’<br />

ampl? ’ msk ipar sim max iterations = 100000’;<br />

New options can also be appended to an existing option string as shown below<br />

ampl: option mosek options $mosek options<br />

ampl? ’ msk ipar sim print freq = 0 msk ipar sim max iterations = 1000’;<br />

<strong>The</strong> expression $mosek options expands to the current value of the option. Line two in the example<br />

appends an additional value msk ipar sim max iterations to the option string.<br />

3.5.2 Options<br />

3.5.2.1 outlev<br />

<strong>MOSEK</strong> also recognizes the outlev option which controls the amount of printed output. 0 means no<br />

printed output and a higher value means more printed output. An example of setting outlev is as<br />

follows:<br />

ampl: option mosek options ’outlev=2’;<br />

3.5.2.2 wantsol<br />

<strong>MOSEK</strong> recognize the option wantsol. We refer the reader to the AMPL manual [1] for details about<br />

this option.<br />

3.6 Constraint and variable names<br />

AMPL assigns meaningfull names to all the constraints and variables. Since <strong>MOSEK</strong> uses item names<br />

in error and log messages, it may be useful to pass the AMPL names to <strong>MOSEK</strong>.<br />

Using the <strong>command</strong>

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!