From c55865996b7f0bdda2e66f2ac46e7f638a8f8485 Mon Sep 17 00:00:00 2001 From: Edward Burnell Date: Sat, 8 Jan 2022 15:32:26 -0700 Subject: [PATCH] fix --- docs/source/debugging.rst | 7 +++++-- docs/source/examples.rst | 5 +++++ docs/source/examples/breakdowns.py | 6 +++++- docs/source/modelbuilding.rst | 3 +++ docs/source/signomialprogramming.rst | 2 ++ 5 files changed, 20 insertions(+), 3 deletions(-) diff --git a/docs/source/debugging.rst b/docs/source/debugging.rst index b72902bd0..e917219b4 100644 --- a/docs/source/debugging.rst +++ b/docs/source/debugging.rst @@ -1,7 +1,7 @@ Debugging Models **************** -A number of errors and warnings may be raised when attempting to solve a model. +A number of errors and warnings may be raised when attempting to solve a model. A model may be primal infeasible: there is no possible solution that satisfies all constraints. A model may be dual infeasible: the optimal value of one or more variables is 0 or infinity (negative and positive infinity in logspace). For a GP model that does not solve, solvers may be able to prove its primal or dual infeasibility, or may return an unknown status. @@ -11,6 +11,7 @@ GPkit contains several tools for diagnosing which constraints and variables migh .. literalinclude:: examples/debug.py .. literalinclude:: examples/debug_output.txt + :language: breakdowns Note that certain modeling errors (such as omitting or forgetting a constraint) may be difficult to diagnose from this output. @@ -33,7 +34,7 @@ Potential errors and warnings - ``RuntimeWarning: Dual cost nan does not match primal cost 1.00122315152`` - Similarly to the above, this warning may be seen in dual infeasible models, see *Dual Infeasibility* below. -.. +.. note: remove the above when we match solver tolerance in GPkit (issue #753) @@ -54,6 +55,7 @@ For example, Mosek returns ``DUAL_INFEAS_CER`` when attempting to solve the foll Upon viewing the printed output, .. literalinclude:: examples/unbounded_output.txt + :language: breakdowns The problem, unsurprisingly, is that the cost ``1/x`` has no lower bound because ``x`` has no upper bound. @@ -84,3 +86,4 @@ If you suspect your model is primal infeasible, you can find the nearest primal .. literalinclude:: examples/relaxation.py .. literalinclude:: examples/relaxation_output.txt + :language: breakdowns diff --git a/docs/source/examples.rst b/docs/source/examples.rst index 9a970e78e..b3a899b87 100644 --- a/docs/source/examples.rst +++ b/docs/source/examples.rst @@ -17,6 +17,7 @@ minimize :math:`x` subject to the constraint :math:`x \ge 1`. Of course, the optimal value is 1. Output: .. literalinclude:: examples/x_greaterthan_1_output.txt + :language: breakdowns Maximizing the Volume of a Box ============================== @@ -27,6 +28,7 @@ This example comes from Section 2.4 of the `GP tutorial ` which this code outputs shows how it is Note that the output table has been filtered above to show only variables of interest. .. literalinclude:: examples/performance_modeling_output.txt + :language: breakdowns diff --git a/docs/source/signomialprogramming.rst b/docs/source/signomialprogramming.rst index 61875dd8c..2a2f8c2c8 100644 --- a/docs/source/signomialprogramming.rst +++ b/docs/source/signomialprogramming.rst @@ -55,6 +55,7 @@ This problem is not GP compatible due to the :math:`sin(x)` constraint. One app .. literalinclude:: examples/sin_approx_example.py .. literalinclude:: examples/sin_approx_example_output.txt + :language: breakdowns Assume we have some external code which is capable of evaluating our incompatible function: @@ -69,6 +70,7 @@ and replace the incompatible constraint in our GP: .. literalinclude:: examples/external_sp.py .. literalinclude:: examples/external_sp_output.txt + :language: breakdowns which is the expected result. This method has been generalized to larger problems, such as calling XFOIL and AVL.