25.11.2015 Views

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

Optimizer API for Python - Documentation - Mosek

Optimizer API for Python - Documentation - Mosek

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

Chapter 5<br />

Basic <strong>API</strong> tutorial<br />

In this chapter the reader will learn how to build a simple application that uses <strong>MOSEK</strong>.<br />

A number of examples is provided to demonstrate the functionality required for solving linear, conic,<br />

semidefinite and quadratic problems as well as mixed integer problems.<br />

Please note that the section on linear optimization also describes most of the basic functionality needed<br />

to specify optimization problems. Hence, it is recommended to read Section 5.2 before reading about<br />

other optimization problems.<br />

5.1 <strong>The</strong> basics<br />

A typical program using the <strong>MOSEK</strong> <strong>Python</strong> interface can be described shortly:<br />

• Create an environment object (Env).<br />

• Set up some environment specific data and initialize the environment object.<br />

• Create a task object (Task).<br />

• Load a problem into the task object.<br />

• Optimize the problem.<br />

• Fetch the result.<br />

• Dispose of the environment and task.<br />

5.1.1 <strong>The</strong> environment and the task<br />

<strong>The</strong> first <strong>MOSEK</strong> related step in any program that employs <strong>MOSEK</strong> is to create an environment<br />

object. <strong>The</strong> environment contains environment specific data such as information about the license file,<br />

21

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

Saved successfully!

Ooh no, something went wrong!