The MOSEK Python optimizer API manual Version 7.0 (Revision 141)

Optimizer API for Python - Documentation - Mosek Optimizer API for Python - Documentation - Mosek

25.11.2015 Views

600 APPENDIX F. MOSEK FILE FORMATS F.2.1.1 The objective The first section beginning with one of the keywords max maximum maximize min minimum minimize defines the objective sense and the objective function, i.e. The objective may be given a name by writing myname: c T x + 1 2 xT Q o x. before the expressions. If no name is given, then the objective is named obj. The objective function contains linear and quadratic terms. The linear terms are written as 4 x1 + x2 - 0.1 x3 and so forth. The quadratic terms are written in square brackets ([]) and are either squared or multiplied as in the examples x1^2 and x1 * x2 There may be zero or more pairs of brackets containing quadratic expressions. An example of an objective section is: minimize myobj: 4 x1 + x2 - 0.1 x3 + [ x1^2 + 2.1 x1 * x2 ]/2 Please note that the quadratic expressions are multiplied with 1 2 , so that the above expression means minimize 4x 1 + x 2 − 0.1 · x 3 + 1 2 (x2 1 + 2.1 · x 1 · x 2 ) If the same variable occurs more than once in the linear part, the coefficients are added, so that 4 x1 + 2 x1 is equivalent to 6 x1. In the quadratic expressions x1 * x2 is equivalent to x2 * x1 and as in the linear part , if the same variables multiplied or squared occur several times their coefficients are added. F.2.1.2 The constraints The second section beginning with one of the keywords subj to subject to s.t.

F.2. THE LP FILE FORMAT 601 st defines the linear constraint matrix (A ) and the quadratic matrices (Q i ). A constraint contains a name (optional), expressions adhering to the same rules as in the objective and a bound: subject to con1: x1 + x2 + [ x3^2 ]/2

600 APPENDIX F. <strong>MOSEK</strong> FILE FORMATS<br />

F.2.1.1<br />

<strong>The</strong> objective<br />

<strong>The</strong> first section beginning with one of the keywords<br />

max<br />

maximum<br />

maximize<br />

min<br />

minimum<br />

minimize<br />

defines the objective sense and the objective function, i.e.<br />

<strong>The</strong> objective may be given a name by writing<br />

myname:<br />

c T x + 1 2 xT Q o x.<br />

before the expressions. If no name is given, then the objective is named obj.<br />

<strong>The</strong> objective function contains linear and quadratic terms. <strong>The</strong> linear terms are written as<br />

4 x1 + x2 - 0.1 x3<br />

and so forth. <strong>The</strong> quadratic terms are written in square brackets ([]) and are either squared or<br />

multiplied as in the examples<br />

x1^2<br />

and<br />

x1 * x2<br />

<strong>The</strong>re may be zero or more pairs of brackets containing quadratic expressions.<br />

An example of an objective section is:<br />

minimize<br />

myobj: 4 x1 + x2 - 0.1 x3 + [ x1^2 + 2.1 x1 * x2 ]/2<br />

Please note that the quadratic expressions are multiplied with 1 2<br />

, so that the above expression means<br />

minimize 4x 1 + x 2 − 0.1 · x 3 + 1 2 (x2 1 + 2.1 · x 1 · x 2 )<br />

If the same variable occurs more than once in the linear part, the coefficients are added, so that 4 x1<br />

+ 2 x1 is equivalent to 6 x1. In the quadratic expressions x1 * x2 is equivalent to x2 * x1 and as<br />

in the linear part , if the same variables multiplied or squared occur several times their coefficients are<br />

added.<br />

F.2.1.2<br />

<strong>The</strong> constraints<br />

<strong>The</strong> second section beginning with one of the keywords<br />

subj to<br />

subject to<br />

s.t.

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

Saved successfully!

Ooh no, something went wrong!