The MOSEK Python optimizer API manual Version 7.0 (Revision 141)
Optimizer API for Python - Documentation - Mosek Optimizer API for Python - Documentation - Mosek
612 APPENDIX F. MOSEK FILE FORMATS • iparam.opf write sol itg, include integer solution, if defined. • iparam.opf write sol itr, include interior solution, if defined. • iparam.opf write parameters, include all parameter settings. F.3.5 Examples This section contains a set of small examples written in OPF and describing how to formulate linear, quadratic and conic problems. F.3.5.1 Linear example lo1.opf Consider the example: having the bounds maximize 3x 0 + 1x 1 + 5x 2 + 1x 3 subject to 3x 0 + 1x 1 + 2x 2 = 30, 2x 0 + 1x 1 + 3x 2 + 1x 3 ≥ 15, 2x 1 + 3x 3 ≤ 25, 0 ≤ x 0 ≤ ∞, 0 ≤ x 1 ≤ 10, 0 ≤ x 2 ≤ ∞, 0 ≤ x 3 ≤ ∞. In the OPF format the example is displayed as shown below: [comment] The lo1 example in OPF format [/comment] [hints] [hint NUMVAR] 4 [/hint] [hint NUMCON] 3 [/hint] [hint NUMANZ] 9 [/hint] [/hints] [variables disallow new variables] x1 x2 x3 x4 [/variables] [objective maximize ’obj’] 3 x1 + x2 + 5 x3 + x4 [/objective] [constraints] [con ’c1’] 3 x1 + x2 + 2 x3 = 30 [/con] [con ’c2’] 2 x1 + x2 + 3 x3 + x4 >= 15 [/con] [con ’c3’] 2 x2 + 3 x4
F.3. THE OPF FORMAT 613 [bounds] [b] 0
- Page 583 and 584: D.11. FEASIBILITY REPAIR TYPES 561
- Page 585 and 586: D.13. INTEGER INFORMATION ITEMS. 56
- Page 587 and 588: D.13. INTEGER INFORMATION ITEMS. 56
- Page 589 and 590: D.13. INTEGER INFORMATION ITEMS. 56
- Page 591 and 592: D.16. INPUT/OUTPUT MODES 569 intpnt
- Page 593 and 594: D.20. CONTINUOUS MIXED-INTEGER SOLU
- Page 595 and 596: D.26. OBJECTIVE SENSE TYPES 573 D.2
- Page 597 and 598: D.31. PRESOLVE METHOD. 575 paramete
- Page 599 and 600: D.35. RESPONSE CODE TYPE 577 D.35 R
- Page 601 and 602: D.42. PROBLEM REFORMULATION. 579 si
- Page 603 and 604: D.46. SOLUTION TYPES 581 solsta.dua
- Page 605 and 606: D.50. STREAM TYPES 583 startpointty
- Page 607 and 608: Appendix E Troubleshooting When cre
- Page 609 and 610: Appendix F Mosek file formats MOSEK
- Page 611 and 612: F.1. THE MPS FILE FORMAT 589 Fields
- Page 613 and 614: F.1. THE MPS FILE FORMAT 591 must b
- Page 615 and 616: F.1. THE MPS FILE FORMAT 593 Constr
- Page 617 and 618: F.1. THE MPS FILE FORMAT 595 v 1 is
- Page 619 and 620: F.1. THE MPS FILE FORMAT 597 Please
- Page 621 and 622: F.2. THE LP FILE FORMAT 599 minimiz
- Page 623 and 624: F.2. THE LP FILE FORMAT 601 st defi
- Page 625 and 626: F.2. THE LP FILE FORMAT 603 bounds
- Page 627 and 628: F.3. THE OPF FORMAT 605 iparam.writ
- Page 629 and 630: F.3. THE OPF FORMAT 607 [tag "value
- Page 631 and 632: F.3. THE OPF FORMAT 609 Note that a
- Page 633: F.3. THE OPF FORMAT 611 F.3.2.3 Nam
- Page 637 and 638: F.4. THE TASK FORMAT 615 This can b
- Page 639 and 640: F.7. THE SOLUTION FILE FORMAT 617 c
- Page 641 and 642: Appendix G Problem analyzer example
- Page 643 and 644: G.2. ARKI001 621 2 476 45.42 48.19
- Page 645 and 646: G.4. PROBLEM WITH BOTH LINEAR AND C
- Page 647 and 648: Bibliography [1] Chvátal, V.. Line
- Page 649 and 650: Index analyzenames (Task method), 2
- Page 651 and 652: INDEX 629 getpcni (Task method), 25
- Page 653 and 654: INDEX 631 putbarablocktriplet (Task
- Page 655 and 656: INDEX 633 rescode.err inv numj, 521
- Page 657 and 658: INDEX 635 rescode.err sen bound inv
612 APPENDIX F. <strong>MOSEK</strong> FILE FORMATS<br />
• iparam.opf write sol itg, include integer solution, if defined.<br />
• iparam.opf write sol itr, include interior solution, if defined.<br />
• iparam.opf write parameters, include all parameter settings.<br />
F.3.5<br />
Examples<br />
This section contains a set of small examples written in OPF and describing how to formulate linear,<br />
quadratic and conic problems.<br />
F.3.5.1<br />
Linear example lo1.opf<br />
Consider the example:<br />
having the bounds<br />
maximize 3x 0 + 1x 1 + 5x 2 + 1x 3<br />
subject to 3x 0 + 1x 1 + 2x 2 = 30,<br />
2x 0 + 1x 1 + 3x 2 + 1x 3 ≥ 15,<br />
2x 1 + 3x 3 ≤ 25,<br />
0 ≤ x 0 ≤ ∞,<br />
0 ≤ x 1 ≤ 10,<br />
0 ≤ x 2 ≤ ∞,<br />
0 ≤ x 3 ≤ ∞.<br />
In the OPF format the example is displayed as shown below:<br />
[comment]<br />
<strong>The</strong> lo1 example in OPF format<br />
[/comment]<br />
[hints]<br />
[hint NUMVAR] 4 [/hint]<br />
[hint NUMCON] 3 [/hint]<br />
[hint NUMANZ] 9 [/hint]<br />
[/hints]<br />
[variables disallow new variables]<br />
x1 x2 x3 x4<br />
[/variables]<br />
[objective maximize ’obj’]<br />
3 x1 + x2 + 5 x3 + x4<br />
[/objective]<br />
[constraints]<br />
[con ’c1’] 3 x1 + x2 + 2 x3 = 30 [/con]<br />
[con ’c2’] 2 x1 + x2 + 3 x3 + x4 >= 15 [/con]<br />
[con ’c3’] 2 x2 + 3 x4