12 December 2022
In this article we continue the Python Production mix series. Specifically, we build Model 10 using the CVXPY library.
CVXPY is an open source Python package for representing and solving convex optimization problems.
Our objective is to compare a model built using CVXPY with the same model built using Pyomo.
22 November 2022
In this article we continue the Python Production mix series. Specifically, we build Model 9 using the Gekko library.
Gekko is a Python package for machine learning, optimization of mixed-integer, and differential algebraic equations.
Our objective is to compare a model built using Gekko with the same model built using Pyomo.
31 October 2022
In this article we continue the Python Production mix series. Specifically, we build Model 8 using the OR-Tools library.
OR-Tools is a project from Google. The library is freely available, the code is open source, and it is widely used.
Our objective is to compare a model built using OR-Tools with the same model built using Pyomo.
4 October 2022
In this article we continue the Python Production mix series. Specifically, we build Model 7 using the PuLP library.
PuLP, like Pyomo, is a COIN-OR project. The library is freely available, the code is open source, and it is widely used.
Our objective is to compare a model built using PuLP with the same model built using Pyomo.
21 September 2022
In this article we continue the Python Production mix series, using the Pyomo library. Specifically, we build Model 6, which changes Model 5 to:
- Declare the model as a Pyomo
pyo.AbstractModel
, rather than as apyo.ConcreteModel
. - Read the data from a
dat
file rather than ajson
file.
These changes show that, contrary to how abstract and concrete models are portrayed in most blogs, there is actually little difference between abstract and concrete Pyomo models.
5 September 2022
In this article we continue the Python Production mix series, using the Pyomo library. Specifically, we build Model 5, which changes Model 4 to:
- Define the constraints and objective function using
def
function blocks. - Output the slack values and dual prices (also known as shadow prices) for each constraint.
These changes give us more control over how the model is defined and provide more information about the solution.
16 August 2022
In this article we continue the Python Production mix series, using the Pyomo library. Specifically, we build Model 4, which changes Model 3 to:
- Import the data from an external json file.
- Read the data into the Model object, rather than into separate objects.
These changes reflect features that we may need to include in an operational model.
2 August 2022
In this article we continue the Python Production mix series, using the Pyomo library. Specifically, we build Model 3, which improves Model 2 by:
- Extracting the data from the model, and putting it in an external file.
- Implementing better handling of the solve process.
- Expanding the output to include additional information.
Each of these improvements are important steps in developing a practical design that can be used for operational models.
14 July 2022
In this article we continue the Python Production mix series, using the Pyomo library. Specifically, we build Model 2, which improves Model 1 by extracting the hard coded coefficients and putting them into Python data structures.
Separately the data from the model is an important step in developing a practical design that can be used for operational models.
1 July 2022
In this article we build Model 1 of the Python Production mix series, using the Pyomo library. The Production mix model relates to our hypothetical boutique pottery business, which is described in more detail in the article Python optimization Rosetta Stone.
Our objective for this article is to build and explain the workings of a simple Pyomo example.
Although Model 1 is like many examples of a Pyomo model that you may find on the web and in textbooks, it certainly does not represent best (or even good) practice. In subsequent articles, we'll incrementally improve the model, leading to a structure that is more suitable for operational models.
Even so, Model 1 is an easy-to-understand place to start our exploration of building optimization models in Python. It is worth understanding this model before moving on to more sophisticated versions.