None Notebook

This notebook contains material from CBE30338; content is available on Github.

< 6.4 Linear Production Model in Pyomo | Contents | Tag Index | 6.6 Linear Blending Problem >

Open in Colab

Download

6.5 Linear Programming in Pyomo

Pyomo is an example of a recent generation of modeling languages that are fully integrated with an underlying scripting language.

The purpose of this tutorial is to introduce the basics of constructing Pyomo models. In this first example we consider the production of two products, 'A' and 'B', subject to constraints. The objective is to maximize profit

\begin{align} \max_{x,y} \mbox{profit} = 40 x + 30 y \end{align}

subject to \begin{align} x & \leq 40 \\ x + 2y & \leq 80 \\ x + y & \leq 100 \end{align}

where $x$ refers the production of 'A', and $y$ to the production of 'B'.

6.5.1 Starting the Model

At the highest level, Pyomo employs two objects -- a model and a solver -- to generate a resulting solution.

< 6.4 Linear Production Model in Pyomo | Contents | Tag Index | 6.6 Linear Blending Problem >

Open in Colab

Download