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

614 APPENDIX F. MOSEK FILE FORMATS minimize x 3 + x 4 + x 5 subject to x 0 + x 1 + 2x 2 = 1, x 0 √ , x 1 , x 2 ≥ 0, x 3 ≥ x 2 0 + x2 1 , 2x 4 x 5 ≥ x 2 2. Please note that the type of the cones is defined by the parameter to [cone ...]; the content of the cone-section is the names of variables that belong to the cone. [comment] The cqo1 example in OPF format. [/comment] [hints] [hint NUMVAR] 6 [/hint] [hint NUMCON] 1 [/hint] [hint NUMANZ] 3 [/hint] [/hints] [variables disallow new variables] x1 x2 x3 x4 x5 x6 [/variables] [objective minimize ’obj’] x4 + x5 + x6 [/objective] [constraints] [con ’c1’] x1 + x2 + 2e+00 x3 = 1e+00 [/con] [/constraints] [bounds] # We let all variables default to the positive orthant [b] 0 = sqrt( x1^2 + x2^2 ) [cone quad ’k1’] x4, x1, x2 [/cone] # Define rotated quadratic cone: 2 x5 x6 >= x3^2 [cone rquad ’k2’] x5, x6, x3 [/cone] [/bounds] F.3.5.4 Mixed integer example milo1.opf Consider the mixed integer problem: maximize x 0 + 0.64x 1 subject to 50x 0 + 31x 1 ≤ 250, 3x 0 − 2x 1 ≥ − 4, x 0 , x 1 ≥ 0 and integer

F.4. THE TASK FORMAT 615 This can be implemented in OPF with: [comment] The milo1 example in OPF format [/comment] [hints] [hint NUMVAR] 2 [/hint] [hint NUMCON] 2 [/hint] [hint NUMANZ] 4 [/hint] [/hints] [variables disallow new variables] x1 x2 [/variables] [objective maximize ’obj’] x1 + 6.4e-1 x2 [/objective] [constraints] [con ’c1’] 5e+1 x1 + 3.1e+1 x2

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

minimize x 3 + x 4 + x 5<br />

subject to x 0 + x 1 + 2x 2 = 1,<br />

x 0<br />

√<br />

, x 1 , x 2 ≥ 0,<br />

x 3 ≥ x 2 0 + x2 1 ,<br />

2x 4 x 5 ≥ x 2 2.<br />

Please note that the type of the cones is defined by the parameter to [cone ...]; the content of the<br />

cone-section is the names of variables that belong to the cone.<br />

[comment]<br />

<strong>The</strong> cqo1 example in OPF format.<br />

[/comment]<br />

[hints]<br />

[hint NUMVAR] 6 [/hint]<br />

[hint NUMCON] 1 [/hint]<br />

[hint NUMANZ] 3 [/hint]<br />

[/hints]<br />

[variables disallow new variables]<br />

x1 x2 x3 x4 x5 x6<br />

[/variables]<br />

[objective minimize ’obj’]<br />

x4 + x5 + x6<br />

[/objective]<br />

[constraints]<br />

[con ’c1’] x1 + x2 + 2e+00 x3 = 1e+00 [/con]<br />

[/constraints]<br />

[bounds]<br />

# We let all variables default to the positive orthant<br />

[b] 0 = sqrt( x1^2 + x2^2 )<br />

[cone quad ’k1’] x4, x1, x2 [/cone]<br />

# Define rotated quadratic cone: 2 x5 x6 >= x3^2<br />

[cone rquad ’k2’] x5, x6, x3 [/cone]<br />

[/bounds]<br />

F.3.5.4<br />

Mixed integer example milo1.opf<br />

Consider the mixed integer problem:<br />

maximize x 0 + 0.64x 1<br />

subject to 50x 0 + 31x 1 ≤ 250,<br />

3x 0 − 2x 1 ≥ − 4,<br />

x 0 , x 1 ≥ 0 and integer

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

Saved successfully!

Ooh no, something went wrong!