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

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

120 CHAPTER 9. USAGE GUIDELINES<br />

the reasons stated above, it may be caused by a bug in the solver; in this case, please contact <strong>MOSEK</strong><br />

support.<br />

9.1.1 Verifying primal feasibility<br />

If it has been verified that <strong>MOSEK</strong> solves the problem correctly but the solution is still not as expected,<br />

next step is to verify that the primal solution satisfies all the constraints. Hence, using the original<br />

problem it must be determined whether the solution satisfies all the required constraints in the model.<br />

For instance assume that the problem has the constraints<br />

and <strong>MOSEK</strong> reports the optimal solution<br />

x 1 + 2x 2 + x 3 ≤ 1,<br />

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

x 1 = x 2 = x 3 = 1.<br />

<strong>The</strong>n clearly the solution violates the constraints. <strong>The</strong> most likely explanation is that the model does<br />

not match the problem entered into <strong>MOSEK</strong>, for instance<br />

may have been inputted instead of<br />

x 1 − 2x 2 + x 3 ≤ 1<br />

x 1 + 2x 2 + x 3 ≤ 1.<br />

A good way to debug such an issue is to dump the problem to OPF file and check whether the violated<br />

constraint has been specified correctly.<br />

9.1.2 Verifying optimality<br />

Verifying that a feasible solution is optimal can be harder. However, for continuous problems optimality<br />

can verified using a dual solution. Normally, <strong>MOSEK</strong> will report a dual solution; if that is feasible<br />

and has the same objective value as the primal solution, then the primal solution must be optimal.<br />

An alternative method is to find another primal solution that has better objective value than the one<br />

reported to <strong>MOSEK</strong>. If that is possible then either the problem is badly posed or there is bug in<br />

<strong>MOSEK</strong>.<br />

9.2 Turn on logging<br />

While developing a new application it is recommended to turn on logging, so that error and diagnostics<br />

messages are displayed. See example in section 5.2 for instructions on turning log output on. You<br />

should also always cache and handle any exceptions thrown by <strong>MOSEK</strong>.<br />

More log information can be obtained by modifying one or more of the parameters:

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

Saved successfully!

Ooh no, something went wrong!