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

18 CHAPTER 3. MOSEK AND AMPL 3.11 Using the command line version of the AMPL interface AMPL can generate a data file containing all the optimization problem and all relevant information which can then be read and solved by the MOSEK command line tool. When the problem has been loaded into AMPL, the commands ampl: option auxfiles rc; ampl: write bprob; will make AMPL write the appropriate data files, i.e. prob.nl prob.col prob.row Then the problem can be solved using the command line version of MOSEK as follows mosek prob.nl outlev=10 -a The -a command line option indicates that MOSEK is invoked in AMPL mode. When MOSEK is invoked in AMPL mode the normal MOSEK command line options should appear after the -a option except for the file name which should be the first argument. As the above example demonstrates MOSEK accepts command line options as specified by the AMPL ”convention”. Which command line arguments MOSEK accepts in AMPL mode can be viewed by executing mosek -= -a For linear, quadratic and quadratic constrained problems a text file representation of the problem can be obtained using one of the commands mosek prob.nl -a -x -out prob.mps mosek prob.nl -a -x -out prob.opf mosek prob.nl -a -x -out prob.lp

Chapter 4 Problem formulation and solutions In this chapter we will discuss the following issues: • The formal definitions of the problem types that MOSEK can solve. • The solution information produced by MOSEK. • The information produced by MOSEK if the problem is infeasible. 4.1 Linear optimization A linear optimization problem can be written as where minimize c T x + c f subject to l c ≤ Ax ≤ u c , l x ≤ x ≤ u x , (4.1) • m is the number of constraints. • n is the number of decision variables. • x ∈ R n is a vector of decision variables. • c ∈ R n is the linear part of the objective function. • A ∈ R m×n is the constraint matrix. • l c ∈ R m is the lower limit on the activity for the constraints. • u c ∈ R m is the upper limit on the activity for the constraints. 19

18 CHAPTER 3. <strong>MOSEK</strong> AND AMPL<br />

3.11 Using the <strong>command</strong> <strong>line</strong> version of the AMPL interface<br />

AMPL can generate a data file containing all the optimization problem and all relevant information<br />

which can then be read and solved by the <strong>MOSEK</strong> <strong>command</strong> <strong>line</strong> <strong>tool</strong>.<br />

When the problem has been loaded into AMPL, the <strong>command</strong>s<br />

ampl: option auxfiles rc;<br />

ampl: write bprob;<br />

will make AMPL write the appropriate data files, i.e.<br />

prob.nl<br />

prob.col<br />

prob.row<br />

<strong>The</strong>n the problem can be solved using the <strong>command</strong> <strong>line</strong> version of <strong>MOSEK</strong> as follows<br />

mosek prob.nl outlev=10 -a<br />

<strong>The</strong> -a <strong>command</strong> <strong>line</strong> option indicates that <strong>MOSEK</strong> is invoked in AMPL mode. When <strong>MOSEK</strong> is<br />

invoked in AMPL mode the normal <strong>MOSEK</strong> <strong>command</strong> <strong>line</strong> options should appear after the -a option<br />

except for the file name which should be the first argument. As the above example demonstrates<br />

<strong>MOSEK</strong> accepts <strong>command</strong> <strong>line</strong> options as specified by the AMPL ”convention”. Which <strong>command</strong> <strong>line</strong><br />

arguments <strong>MOSEK</strong> accepts in AMPL mode can be viewed by executing<br />

mosek -= -a<br />

For <strong>line</strong>ar, quadratic and quadratic constrained problems a text file representation of the problem can<br />

be obtained using one of the <strong>command</strong>s<br />

mosek prob.nl -a -x -out prob.mps<br />

mosek prob.nl -a -x -out prob.opf<br />

mosek prob.nl -a -x -out prob.lp

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

Saved successfully!

Ooh no, something went wrong!