Skip to main content
Log in

Pyomo.GDP: an ecosystem for logic based modeling and optimization development

  • Research Article
  • Published:
Optimization and Engineering Aims and scope Submit manuscript

Abstract

We present three core principles for engineering-oriented integrated modeling and optimization tool sets—intuitive modeling contexts, systematic computer-aided reformulations, and flexible solution strategies—and describe how new developments in Pyomo.GDP for Generalized Disjunctive Programming (GDP) advance this vision. We describe a new logical expression system implementation for Pyomo.GDP allowing for a more intuitive description of logical propositions. The logical expression system supports automated reformulation of these logical constraints to linear constraints. We also describe two new logic-based global optimization solver implementations built on Pyomo.GDP that exploit logical structure to avoid “zero-flow” numerical difficulties that arise in nonlinear network design problems when nodes or streams disappear. These new solvers also demonstrate the capability to link to external libraries for expanded functionality within an integrated implementation. We present these new solvers in the context of a flexible array of solution paths available to GDP models. Finally, we present results on a new library of GDP models demonstrating the value of multiple solution approaches.

This is a preview of subscription content, log in via an institution to check access.

Access this article

Price excludes VAT (USA)
Tax calculation will be finalised during checkout.

Instant access to the full article PDF.

Fig. 1
Fig. 2
Fig. 3
Fig. 4
Fig. 5
Fig. 6
Fig. 7
Fig. 8
Fig. 9
Fig. 10
Fig. 11
Fig. 12
Fig. 13

Similar content being viewed by others

Notes

  1. GDPopt is released as part of Pyomo: https://www.github.com/Pyomo/pyomo.

References

Download references

Acknowledgements

We graciously acknowledge funding from the U.S. Department of Energy, Office of Fossil Energy’s Crosscutting Research Program through the Institute for the Design of Advanced Energy Systems (IDAES). We also recognize software development assistance from Zhifei Yuliu, supervised by Qi Chen, on the final logical expression system implementation. Sandia National Laboratories is a multimission laboratory managed and operated by National Technology and Engineering Solutions of Sandia, LLC, a wholly owned subsidiary of Honeywell International, Inc., for the U.S. Department of Energy’s National Nuclear Security Administration under contract DENA0003525.

Author information

Authors and Affiliations

Authors

Corresponding author

Correspondence to Ignacio E. Grossmann.

Ethics declarations

Declarations

This article describes objective technical results and analysis. Any subjective views or opinions that might be expressed in the article do not necessarily represent the views of the U.S. Department of Energy or the United States Government.

Conflict of interest

The authors declare that they have no conflict of interest.

Additional information

Publisher's Note

Springer Nature remains neutral with regard to jurisdictional claims in published maps and institutional affiliations.

Appendices

Pyomo.GDP modeling syntax

Modeling syntax for Pyomo.GDP uses and modeling objects. objects represent a grouping of constraints in a logical context, and objects describe the OR relationship between these logical groupings. Note that by default, Pyomo.GDP objects enforce an “exactly one” relationship among the selection of the disjuncts (generalization of exclusive-OR). That is, exactly one of the indicator variables should take a value.

The example below illustrates the Pyomo.GDP syntax available to express the disjunction (2) between the selection of two units in a process network. In the example, \(Y_1\) and \(Y_2\) are the Boolean variables corresponding to the selection of process units 1 and 2, respectively. The continuous variables \(x_1, x_2, x_3, x_4\) describe flow in and out of the first and second units, respectively. If a unit is selected, the nonlinear equality in the corresponding disjunct enforces the input/output relationship in the selected unit. The final equality in each disjunct forces flows for the absent unit to zero.

$$\begin{aligned} \left[ \begin{array}{c} Y_1 \\ \exp (x_2) - 1 = x_1 \\ x_3 = x_4 = 0 \end{array} \right] \bigvee \left[ \begin{array}{c} Y_2 \\ \exp \left( \frac{x_4}{1.2}\right) - 1 = x_3 \\ x_1 = x_2 = 0 \end{array} \right] \end{aligned}$$
(2)

Expanded syntax: more descriptive

Pyomo.GDP expanded syntax provides more clarity in the declaration of each modeling object (see Listing 13). Assuming the object and variables have been defined, lines 1 and 5 declare the objects corresponding to selection of unit 1 and 2, respectively. Lines 2 and 6 define the input-output relations for each unit, and lines 3-4 and 7-8 enforce zero flow through the unit that is not selected. Finally, line 9 declares the logical disjunction between the two disjunctive terms.

figure bv

The indicator variables for each disjunct \(Y_1\) and \(Y_2\) are automatically generated by Pyomo.GDP, accessible via and .

Compact syntax: more concise

For advanced users, a more compact syntax is also available (see Listing 14), taking advantage of the ability to declare disjuncts and constraints implicitly. When the object constructor is passed a list of lists, the outer list defines the disjuncts and the inner list defines the constraint expressions associated with the respective disjunct.

figure bz

1.1 Nested disjunctions

Pyomo.GDP also supports modeling with nested disjunctions, as given in Equation (3). The inner disjunctions \(q \in {\mathcal {K}}_{ik}\) describe a logical-OR relationship between disjuncts \(p \in {\mathcal {D}}_q\). Selection of the inner disjunct indicated by the Boolean variable \(Y_{pq}\) enforces the corresponding linear constraints \(M_{pq} x + N_{pq} z \le e_{pq}\) and nonlinear constraints \(r_{pq}(x,z)\le 0\). Nested disjunction logic often describes discrete choices that are contingent upon another decision. For example, in chemical process synthesis, a choice between reactor models A, B, or C might be contingent upon existence of the reactor. The selection of a reactor model would therefore be a nested disjunction within the parent disjunction between existence or absence of the reactor.

$$\begin{aligned} \bigvee _{i\in D_k} \left[ \begin{array}{c} Y_{ik} \\ M_{ik} x + N_{ik} z \le e_{ik} \\ r_{ik}(x,z)\le 0\\ \bigvee _{p \in {\mathcal {D}}_q} \left[ \begin{array}{c} Y_{pq} \\ M_{pq} x + N_{pq} z \le e_{pq} \\ r_{pq}(x,z)\le 0\\ \end{array} \right] \quad q \in {\mathcal {K}}_{ik} \\ \end{array} \right] \quad k \in K \end{aligned}$$
(3)

Assuming that the correct sets are defined, Listing 15 gives the Pyomo.GDP code necessary to represent a nested disjunction as described by Equation (3).

figure ca

9PP GDP model formulation

$$\begin{aligned} \min Z =&\ -10 x_{25} + x_{1} \end{aligned}$$
(9PP.1)
$$\begin{aligned} s.t. \quad&\ x_1 = x_2 + x_3 \end{aligned}$$
(9PP.2)
$$\begin{aligned}&\left[ \begin{array}{c} Y_1 \\ x_2 = \exp (x_3 - 1) \\ x_4 = x_5 = 0 \end{array} \right] \vee \left[ \begin{array}{l} Y_2 \\ x_5 = \ln (x_4 + 1) \\ x_2 = x_3 = 0 \end{array} \right] \end{aligned}$$
(9PP.3)
$$\begin{aligned}&\ x_3 + x_5 = x_6 \end{aligned}$$
(9PP.4)
$$\begin{aligned}&\ x_6 = x_7 + x_9 + x_{11} + x_{13} \end{aligned}$$
(9PP.5)
$$\begin{aligned}&\begin{aligned}&\left[ \begin{array}{c} Y_3 \\ x_8 = 2 \ln (x_7) + 3 \\ x_7 \ge 0.2 \\ x_9 = x_{10} = x_{11} = 0\\ x_{12} = x_{14} = x_{15} = 0 \\ \end{array} \right] \vee \left[ \begin{array}{c} Y_4 \\ x_{10} = 1.8 \ln (x_9 + 4) \\ x_{7} = x_{8} = x_{11} = 0\\ x_{12} = x_{14} = x_{15} = 0 \\ \end{array} \right] \\&\quad \vee \left[ \begin{array}{c} Y_5 \\ x_{12} = 1.2 \ln (x_{11}) + 2 \\ x_{11} \ge 0.001 \\ x_{7} = x_{8} = x_{9} = 0\\ x_{10} = x_{14} = x_{15} = 0 \\ \end{array} \right] \vee \left[ \begin{array}{c} Y_6 \\ x_{15} = x_{23} \sqrt{x_{14} - 3} \\ 5 \le x_{14} \le 20 \\ x_{7} = x_{8} = x_{9} = 0\\ x_{10} = x_{11} = x_{12} = 0 \\ \end{array} \right] \end{aligned} \end{aligned}$$
(9PP.6)
$$\begin{aligned}&\ x_{14} = x_{13} + x_{23} \end{aligned}$$
(9PP.7)
$$\begin{aligned}&\ x_{8} + x_{10} + x_{12} + x_{15} = x_{16} \end{aligned}$$
(9PP.8)
$$\begin{aligned}&\begin{aligned}&\left[ \begin{array}{c} Y_7 \\ x_{18} = 0.9 x_{17} \\ x_{19} = x_{20} = 0\\ x_{21} = x_{22} = 0 \\ \end{array} \right] \vee \left[ \begin{array}{c} Y_8 \\ x_{20} = \ln (x_{19}^{1.5}) + 2 \\ x_{19} \ge 1\\ x_{17} = x_{18} = 0\\ x_{21} = x_{22} = 0 \\ \end{array} \right] \\&\quad \vee \left[ \begin{array}{c} Y_9 \\ x_{22} = \ln (x_{21} + \sqrt{x_{21}}) + 1 \\ x_{21} \ge 4 \\ x_{17} = x_{18} = 0\\ x_{19} = x_{20} = 0 \\ \end{array} \right] \end{aligned} \end{aligned}$$
(9PP.9)
$$\begin{aligned}&\ x_{22} = x_{23} + x_{24} \end{aligned}$$
(9PP.10)
$$\begin{aligned}&\ x_{18} + x_{20} + x_{24} = x_{25} \end{aligned}$$
(9PP.11)
$$\begin{aligned}&\ 0 \le x_i \le 50 \quad i \in \{1, 2, \dots , 25\} \end{aligned}$$
(9PP.12)
$$\begin{aligned}&\ x \in \mathbb {R}^{25} \end{aligned}$$
(9PP.13)
$$\begin{aligned}&\ Y_{i} \in \{True, False\} \quad i \in \{1, 2, \dots , 9\} \end{aligned}$$
(9PP.14)

Rights and permissions

Reprints and permissions

About this article

Check for updates. Verify currency and authenticity via CrossMark

Cite this article

Chen, Q., Johnson, E.S., Bernal, D.E. et al. Pyomo.GDP: an ecosystem for logic based modeling and optimization development. Optim Eng 23, 607–642 (2022). https://doi.org/10.1007/s11081-021-09601-7

Download citation

  • Received:

  • Revised:

  • Accepted:

  • Published:

  • Issue Date:

  • DOI: https://doi.org/10.1007/s11081-021-09601-7

Keywords

Navigation