Non-linear
This category includes models specifically intended to demonstrate how to formulate and solve models with non-linear constraints and/or objective function. Some of the models include binary and integer variables. These models are mostly solved using the IPOPT, Bonmin, or Couenne solvers.
Key features of this model:
- Description: Find the maximum area of a rectangle within a circle.
- Category: Non-linear functions.
- Type: NLP.
- Library: Pyomo.
- Solver: IPOPT.
Notes:
- Includes alternative scenarios where the values of some variables are fixed/unfixed using the
fix()
andunfix()
Pyomo functions. - Added printing of final scenario, which was omitted from original code.
GitHub: Biggest rectangle in a circle.
Key features of this model:
- Description: Global optimization example on the (aptly named) egg-holder function.
- Category: Non-linear functions.
- Type: NLP.
- Library: SciPy.
- Solver: shgo, dual_annealing, and differential_evolution.
Notes:
- Converted to Jupyter notebook.
- Demonstrates different non-linear solvers, including feature to find all local minima.
- Modified to create contour plot used in this article.
Key features of this model:
- Description: Explore the potential of non-linear programming, specifically conic optimization (or cone programming), as a tool for marketing budget allocation. In this example, there are diminishing returns for additional investment. That is, the marketing channel response follows a natural logarithm curve.
- Category: Non-linear functions.
- Type: Non-linear conic.
- Library: CVXPY.
- Solver: ECOS.
Notes:
- Described in blog article: Optimize your marketing budget with nonlinear programming
GitHub: Marketing mix using CVXPY.
Key features of this model:
- Description: Minimize 3D polynomial with multiple local optima.
- Category: Non-linear functions.
- Type: Non-convex MINLP.
- Library: Pyomo.
- Solver: Couenne.
Notes:
- The source article describes how to install the Couenne solver on Windows, then presents an example of solving a model using Pyomo and Couenne.
- There is a brief discussion of specifying options for the Couenne solver. For some solvers, options can be specified directly within the Python code. However, that does not work with Couenne, so an external options file must be used. We include an example of an options file, which must be in the same folder as the program.
GitHub: Non-convex MINLP with Couenne.