{ "cells": [ { "cell_type": "markdown", "metadata": { "colab_type": "text", "id": "CS1NYCN2Izwn", "nbpages": { "level": 0, "link": "[](https://jckantor.github.io/CBE30338/06.04-Linear-Production-Model-in-Pyomo.html)", "section": "" } }, "source": [ "\n", "*This notebook contains material from [CBE30338](https://jckantor.github.io/CBE30338);\n", "content is available [on Github](https://github.com/jckantor/CBE30338.git).*\n" ] }, { "cell_type": "markdown", "metadata": { "colab_type": "text", "id": "3waXAN0_Izwo", "nbpages": { "level": 0, "link": "[](https://jckantor.github.io/CBE30338/06.04-Linear-Production-Model-in-Pyomo.html)", "section": "" } }, "source": [ "\n", "< [6.3 Linear Programming](https://jckantor.github.io/CBE30338/06.03-Linear-Programming.html) | [Contents](toc.html) | [Tag Index](tag_index.html) | [6.5 Linear Programming in Pyomo](https://jckantor.github.io/CBE30338/06.05-Linear-Programming-in-Pyomo.html) >
"
]
},
{
"cell_type": "markdown",
"metadata": {
"colab_type": "text",
"id": "oEwnwUGoIzwp",
"nbpages": {
"level": 1,
"link": "[6.4 Linear Production Model in Pyomo](https://jckantor.github.io/CBE30338/06.04-Linear-Production-Model-in-Pyomo.html#6.4-Linear-Production-Model-in-Pyomo)",
"section": "6.4 Linear Production Model in Pyomo"
}
},
"source": [
"# 6.4 Linear Production Model in Pyomo\n",
"\n",
"[Pyomo](http://www.pyomo.org/) is a state-of-the-art language for solving optimization problems embedded within Python. Using Pyomo, a user can describe optimization model by specifying decision **variables**, **constraints**, and an optimization **objective**. Pyomo includes a rich set of features to enable modeling of complex systems, specifying a solver, and displaying the solution."
]
},
{
"cell_type": "markdown",
"metadata": {
"colab_type": "text",
"id": "nZEeIf7TIzwq",
"nbpages": {
"level": 2,
"link": "[6.4.1 Installation](https://jckantor.github.io/CBE30338/06.04-Linear-Production-Model-in-Pyomo.html#6.4.1-Installation)",
"section": "6.4.1 Installation"
}
},
"source": [
"## 6.4.1 Installation"
]
},
{
"cell_type": "markdown",
"metadata": {
"colab_type": "text",
"id": "SUBuCMtxIzwv",
"nbpages": {
"level": 3,
"link": "[6.4.1.1 Anaconda](https://jckantor.github.io/CBE30338/06.04-Linear-Production-Model-in-Pyomo.html#6.4.1.1-Anaconda)",
"section": "6.4.1.1 Anaconda"
}
},
"source": [
"### 6.4.1.1 Anaconda\n",
"\n",
"These instructions assume you have previously installed a suitable Python development environment, in particular the [Anaconda package for Python 3.x](https://www.anaconda.com/download).\n",
"\n",
"The following commands will install Pyomo and extra files plus the glpk (MILP) and ipopt (nonlinear) solvers. These commands should be executed one at a time from the terminal window on MacOS, or the Anaconda command prompt on Windows 10.\n",
"\n",
" conda install -c conda-forge pyomo\n",
" conda install -c conda-forge pyomo.extras\n",
" conda install -c conda-forge glpk\n",
" conda install -c conda-forge ipopt\n",
" \n",
"Optionally, you may also wish to install the COIN-OR cbc solvers.\n",
"\n",
" conda install -c conda-forge coincbc\n",
"\n",
"This installation provides a capable open-source optimization suite with multiple solvers well suited a wide range of process applications. The solvers are\n",
"\n",
"* [glpk](https://en.wikibooks.org/wiki/GLPK). \"GNU Linear Programming Kit\" is a software package written in highly portable C for the solution of mixed integer linear programming and related problems.\n",
"* [ipopt](https://en.wikipedia.org/wiki/IPOPT). \"Interior Point Optimizer\" for large scale nonlinear optimization of continuous systems. \n",
"* [cbc](https://projects.coin-or.org/Cbc). \"COIN-OR Branch and Cut\" is a mixed integer linear programming solver written in C++. It generally solves the same problems as glpk, but can run multiple threads, and is often faster and more robust.\n",
"\n",
"This suite can be further augmented by installing additional solvers from open-source and commercial sources.\n",
"\n",
"NOTE: If command window procedure fails on your laptop, you might try running these commands in a Jupyter notebook. In that case, each command needs to be prefixed with the shell escape `!`, and followed by the `-y` option to handle the y/n \n",
"interaction. For example, the basic pyomo install command would read\n",
"\n",
" !conda install -c conda-forge pyomo -y\n",
"\n",
"To provide timely feedback, each install command should be executed in a separate cell."
]
},
{
"cell_type": "markdown",
"metadata": {
"colab_type": "text",
"id": "9LsotoVNIzwv",
"nbpages": {
"level": 3,
"link": "[6.4.1.2 Google Colab](https://jckantor.github.io/CBE30338/06.04-Linear-Production-Model-in-Pyomo.html#6.4.1.2-Google-Colab)",
"section": "6.4.1.2 Google Colab"
}
},
"source": [
"### 6.4.1.2 Google Colab"
]
},
{
"cell_type": "code",
"execution_count": 1,
"metadata": {
"colab": {},
"colab_type": "code",
"id": "0AVcwAQlIzww",
"nbpages": {
"level": 3,
"link": "[6.4.1.2 Google Colab](https://jckantor.github.io/CBE30338/06.04-Linear-Production-Model-in-Pyomo.html#6.4.1.2-Google-Colab)",
"section": "6.4.1.2 Google Colab"
}
},
"outputs": [],
"source": [
"%%capture\n",
"!pip install -q pyomo\n",
"!apt-get install -y -qq glpk-utils"
]
},
{
"cell_type": "markdown",
"metadata": {
"colab_type": "text",
"id": "XFGHskaxIzw1",
"nbpages": {
"level": 2,
"link": "[6.4.2 Algebraic Modeling Languages](https://jckantor.github.io/CBE30338/06.04-Linear-Production-Model-in-Pyomo.html#6.4.2-Algebraic-Modeling-Languages)",
"section": "6.4.2 Algebraic Modeling Languages"
}
},
"source": [
"## 6.4.2 Algebraic Modeling Languages\n",
"\n",
"One of the difficult aspects of applying optimization methods to large scale applications is creating and maintaining the underlying model. An application may include tens, hundreds, even thousdands of variables and constraints, and may incorporate data extracted in real time from sensor networks and corporate data bases. The resulting models can be very complex, and essentially impossible to create and maintain without use of software tools.\n",
"\n",
"Algebraic Modeling Languages (AMLs) were developed to assist with the creation and maintainence of optimization models. [GAMS](https://en.wikipedia.org/wiki/General_Algebraic_Modeling_System) (General Algebraic Modeling System, https://www.gams.com/), first proposed in 1976, was among the first and still widely used. Other notable examples include [AIMMS](https://en.wikipedia.org/wiki/AIMMS), [AMPL](https://en.wikipedia.org/wiki/AMPL), and [FICO XPRESS](https://en.wikipedia.org/wiki/FICO_Xpress).\n",
"\n",
"In recent years, modeling for optimization has become more tightly integrated with scripting languages commonly used in science and engineering. Open-source examples include [YALMIP](https://yalmip.github.io/) and [CVX](http://web.cvxr.com/cvx/doc/) which are tightly integrated with Matlab, [JuMP](https://jump.readthedocs.io/en/latest/) which works with Julia, and a variety of systems integrated with Python.\n",
"\n",
"Of the Python options, the open-source [Pyomo](http://www.pyomo.org/) is perhaps the most ambitious and certainly the most aligned with the needs of process systems engineering. "
]
},
{
"cell_type": "markdown",
"metadata": {
"colab_type": "text",
"id": "hRN0rAPaIzw1",
"nbpages": {
"level": 2,
"link": "[6.4.3 Key Concepts in Pyomo](https://jckantor.github.io/CBE30338/06.04-Linear-Production-Model-in-Pyomo.html#6.4.3-Key-Concepts-in-Pyomo)",
"section": "6.4.3 Key Concepts in Pyomo"
}
},
"source": [
"## 6.4.3 Key Concepts in Pyomo\n",
"\n",
"A typical Pyomo application involves the creation of at least two Pyomo objects from the following classes:\n",
"\n",
"* **ConcreteModel()** A python object representing the optimization problem to be solved.\n",
"* **SolverFactory()** A python object representing the mathematical progamming software to be used for calculating a solution.\n",
"\n",
"There are a number of of open-source and commercial solvers that can be used with Pyomo. This simple structure allows one to test and find solvers suited to a particular application. \n",
"\n",
"A model, in turn, is composed of additional objects used to specify a problem. A minimal set of classes is needed to create useful models. These classes are:\n",
"\n",
"* **Var()** Objects representing variables determined in the course of solving a particular problem.\n",
"* **Objective()** An object denoting the problem objective function that is to be either minimized or maximized.\n",
"* **Contraint()** Objects representing problem constraints.\n",
"\n",
"The following cell presents a typical example."
]
},
{
"cell_type": "markdown",
"metadata": {
"colab_type": "text",
"id": "ppJI3atJIzw2",
"nbpages": {
"level": 2,
"link": "[6.4.4 Example: Linear Production Model with Constraints](https://jckantor.github.io/CBE30338/06.04-Linear-Production-Model-in-Pyomo.html#6.4.4-Example:-Linear-Production-Model-with-Constraints)",
"section": "6.4.4 Example: Linear Production Model with Constraints"
}
},
"source": [
"## 6.4.4 Example: Linear Production Model with Constraints\n",
"\n",
"The mathematical formulation of a simple linear production model is given by\n",
"\n",
"\\begin{align}\n",
"\\max_{x,y \\geq 0} &\\ 40\\ x + 30\\ y & \\mbox{objective}\\\\\n",
"\\mbox{subject to:}\\qquad \\\\\n",
"x & \\leq 40 & \\mbox{demand constraint} \\\\\n",
"x + y & \\leq 80 & \\mbox{labor A constraint} \\\\\n",
"2x + y & \\leq 100 & \\mbox{labor B constraint}\n",
"\\end{align}\n",
"\n",
"where $x$ and $y$ are the rates of production (in units per week) for two products."
]
},
{
"cell_type": "markdown",
"metadata": {
"colab_type": "text",
"id": "Gx-2ROtWIzw3",
"nbpages": {
"level": 3,
"link": "[6.4.4.1 Step 1. Import Pyomo.](https://jckantor.github.io/CBE30338/06.04-Linear-Production-Model-in-Pyomo.html#6.4.4.1-Step-1.-Import-Pyomo.)",
"section": "6.4.4.1 Step 1. Import Pyomo."
}
},
"source": [
"### 6.4.4.1 Step 1. Import Pyomo.\n",
"\n",
"The first step in any Pyomo project is to import relevant components of the Pyomo library. This can be done with the following python statement.\n",
"\n",
" from pyomo.environ import *\n",
" "
]
},
{
"cell_type": "markdown",
"metadata": {
"colab_type": "text",
"id": "ymy6qogUIzw3",
"nbpages": {
"level": 3,
"link": "[6.4.4.2 Step 2. Create the model object.](https://jckantor.github.io/CBE30338/06.04-Linear-Production-Model-in-Pyomo.html#6.4.4.2-Step-2.-Create-the-model-object.)",
"section": "6.4.4.2 Step 2. Create the model object."
}
},
"source": [
"### 6.4.4.2 Step 2. Create the model object.\n",
"\n",
"Pyomo provides two distinct methods to create models. Here we use `ConcreteModel()` to create a model instance which is appropriate when all of the data needed to complete the model is avaiable at the current time.\n",
"\n",
" model = ConcreteModel()\n",
" \n",
"The Python variable `model` stores the model instance. This could be any valid Python variable name.\n",
" "
]
},
{
"cell_type": "markdown",
"metadata": {
"colab_type": "text",
"id": "jXnw98bCIzw4",
"nbpages": {
"level": 3,
"link": "[6.4.4.3 Step 3. Add the Decision Variables, Objective, and Constraints to the model object.](https://jckantor.github.io/CBE30338/06.04-Linear-Production-Model-in-Pyomo.html#6.4.4.3-Step-3.-Add-the-Decision-Variables,-Objective,-and-Constraints-to-the-model-object.)",
"section": "6.4.4.3 Step 3. Add the Decision Variables, Objective, and Constraints to the model object."
}
},
"source": [
"### 6.4.4.3 Step 3. Add the Decision Variables, Objective, and Constraints to the model object.\n",
"\n",
"The first major component of a Pyomo model are decision variables which are added as fields to `model`. In the case we name the fields `model.x` and `model.y` corresponding to $x$ and $y$ in the process model. The Python class `Var()` is used to specify these as real numbers that must be greater than or equal to zero.\n",
"\n",
" model.x = Var(domain=NonNegativeReals)\n",
" model.y = Var(domain=NonNegativeReals)\n",
" \n",
"As we will see in other examples, the `domain` can specify other types of decision variables including reals, integers, and booleans.\n",
"\n",
"The objective is specified as an algebraic expression involving the decision variables. Here we store the objective in `model.profit`, and use the optional keyword `sense` to specify a maximization problem.\n",
"\n",
" model.profit = Objective(expr = 40*model.x + 30*model.y, sense=maximize)\n",
"\n",
"Constraints are added as fields to the model, each constraint created using the `Constraint()` class. The constraints are specified using the `expr` keywork in the form of linear algebraic expressions of the decision variables.\n",
"\n",
" model.demand = Constraint(expr = model.x <= 40)\n",
" model.laborA = Constraint(expr = model.x + model.y <= 80)\n",
" model.laborB = Constraint(expr = 2*model.x + model.y <= 100)"
]
},
{
"cell_type": "markdown",
"metadata": {
"colab_type": "text",
"id": "Kb_kdUe9Izw4",
"nbpages": {
"level": 3,
"link": "[6.4.4.4 Step 4. Create a solver object and solve.](https://jckantor.github.io/CBE30338/06.04-Linear-Production-Model-in-Pyomo.html#6.4.4.4-Step-4.-Create-a-solver-object-and-solve.)",
"section": "6.4.4.4 Step 4. Create a solver object and solve."
}
},
"source": [
"### 6.4.4.4 Step 4. Create a solver object and solve.\n",
"\n",
"The Pyomo libary includes a `SolverFactory()` class used to specify a solver. In this case, because the problem is a linear programming problem, we use the `glpk` solver. \n",
"\n",
" results = SolverFactory('glpk').solve(model)\n",
" results.write()\n",
" if results.solver.status == 'ok':\n",
" model.pprint()\n",
" \n",
"The `solve()` method attempts to solve the model using the specified solver, and returns `results` which can be inspected to see if, in fact, a solution was found. If a solution is found, then `model` will have a pretty-print method `pprint()` that creates a summary of the problem solution."
]
},
{
"cell_type": "markdown",
"metadata": {
"colab_type": "text",
"id": "N_KII94LIzw5",
"nbpages": {
"level": 3,
"link": "[6.4.4.5 Step 5. Display the solution.](https://jckantor.github.io/CBE30338/06.04-Linear-Production-Model-in-Pyomo.html#6.4.4.5-Step-5.-Display-the-solution.)",
"section": "6.4.4.5 Step 5. Display the solution."
}
},
"source": [
"### 6.4.4.5 Step 5. Display the solution.\n",
"\n",
"Most applications will require access to specific components of the model. If a solution is found, the model will include methods with the same name as the fields created above, and which can be used to access solution values.\n",
"\n",
" print('Profit = ', model.profit())\n",
"\n",
" print('\\nDecision Variables')\n",
" print('x = ', model.x())\n",
" print('y = ', model.y())\n",
"\n",
" print('\\nConstraints')\n",
" print('Demand = ', model.demand())\n",
" print('Labor A = ', model.laborA())\n",
" print('Labor B = ', model.laborB())"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {
"colab": {},
"colab_type": "code",
"collapsed": true,
"id": "lDU-ku2aIzw6",
"nbpages": {
"level": 3,
"link": "[6.4.4.5 Step 5. Display the solution.](https://jckantor.github.io/CBE30338/06.04-Linear-Production-Model-in-Pyomo.html#6.4.4.5-Step-5.-Display-the-solution.)",
"section": "6.4.4.5 Step 5. Display the solution."
},
"outputId": "61e8a517-72e6-4ac1-8231-cbab26b8a000"
},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"# ==========================================================\n",
"# = Solver Results =\n",
"# ==========================================================\n",
"# ----------------------------------------------------------\n",
"# Problem Information\n",
"# ----------------------------------------------------------\n",
"Problem: \n",
"- Name: unknown\n",
" Lower bound: 2600.0\n",
" Upper bound: 2600.0\n",
" Number of objectives: 1\n",
" Number of constraints: 4\n",
" Number of variables: 3\n",
" Number of nonzeros: 6\n",
" Sense: maximize\n",
"# ----------------------------------------------------------\n",
"# Solver Information\n",
"# ----------------------------------------------------------\n",
"Solver: \n",
"- Status: ok\n",
" Termination condition: optimal\n",
" Statistics: \n",
" Branch and bound: \n",
" Number of bounded subproblems: 0\n",
" Number of created subproblems: 0\n",
" Error rc: 0\n",
" Time: 0.01840686798095703\n",
"# ----------------------------------------------------------\n",
"# Solution Information\n",
"# ----------------------------------------------------------\n",
"Solution: \n",
"- number of solutions: 0\n",
" number of solutions displayed: 0\n",
"2 Var Declarations\n",
" x : Size=1, Index=None\n",
" Key : Lower : Value : Upper : Fixed : Stale : Domain\n",
" None : 0 : 20.0 : None : False : False : NonNegativeReals\n",
" y : Size=1, Index=None\n",
" Key : Lower : Value : Upper : Fixed : Stale : Domain\n",
" None : 0 : 60.0 : None : False : False : NonNegativeReals\n",
"\n",
"1 Objective Declarations\n",
" profit : Size=1, Index=None, Active=True\n",
" Key : Active : Sense : Expression\n",
" None : True : maximize : 40*x + 30*y\n",
"\n",
"3 Constraint Declarations\n",
" demand : Size=1, Index=None, Active=True\n",
" Key : Lower : Body : Upper : Active\n",
" None : -Inf : x : 40.0 : True\n",
" laborA : Size=1, Index=None, Active=True\n",
" Key : Lower : Body : Upper : Active\n",
" None : -Inf : x + y : 80.0 : True\n",
" laborB : Size=1, Index=None, Active=True\n",
" Key : Lower : Body : Upper : Active\n",
" None : -Inf : 2*x + y : 100.0 : True\n",
"\n",
"6 Declarations: x y profit demand laborA laborB\n",
"\n",
"Profit = 2600.0\n",
"\n",
"Decision Variables\n",
"x = 20.0\n",
"y = 60.0\n",
"\n",
"Constraints\n",
"Demand = 20.0\n",
"Labor A = 80.0\n",
"Labor B = 100.0\n"
]
}
],
"source": [
"from pyomo.environ import *\n",
"\n",
"# create a model\n",
"model = ConcreteModel()\n",
"\n",
"# declare decision variables\n",
"model.x = Var(domain=NonNegativeReals)\n",
"model.y = Var(domain=NonNegativeReals)\n",
"\n",
"# declare objective\n",
"model.profit = Objective(expr = 40*model.x + 30*model.y, sense=maximize)\n",
"\n",
"# declare constraints\n",
"model.demand = Constraint(expr = model.x <= 40)\n",
"model.laborA = Constraint(expr = model.x + model.y <= 80)\n",
"model.laborB = Constraint(expr = 2*model.x + model.y <= 100)\n",
"\n",
"# solve\n",
"results = SolverFactory('glpk').solve(model)\n",
"results.write()\n",
"if results.solver.status:\n",
" model.pprint()\n",
"\n",
"# display solution\n",
"print('\\nProfit = ', model.profit())\n",
"\n",
"print('\\nDecision Variables')\n",
"print('x = ', model.x())\n",
"print('y = ', model.y())\n",
"\n",
"print('\\nConstraints')\n",
"print('Demand = ', model.demand())\n",
"print('Labor A = ', model.laborA())\n",
"print('Labor B = ', model.laborB())"
]
},
{
"cell_type": "markdown",
"metadata": {
"colab_type": "text",
"id": "hLrhD08UIzw_",
"nbpages": {
"level": 2,
"link": "[6.4.5 Python Lists, Sets, Dictionaries, and Iterators](https://jckantor.github.io/CBE30338/06.04-Linear-Production-Model-in-Pyomo.html#6.4.5-Python-Lists,-Sets,-Dictionaries,-and-Iterators)",
"section": "6.4.5 Python Lists, Sets, Dictionaries, and Iterators"
}
},
"source": [
"## 6.4.5 Python Lists, Sets, Dictionaries, and Iterators\n",
"\n",
"Pyomo is integrated with the Python language, and inherits significant functionality by leveraging the basic data structures of Python. To make the best use of Pyomo, it is important to understand the basics of Python lists, sets, and dictionaries."
]
},
{
"cell_type": "markdown",
"metadata": {
"colab_type": "text",
"id": "Zy6O_EbrIzw_",
"nbpages": {
"level": 3,
"link": "[6.4.5.1 Data in Matrix/Vector Format](https://jckantor.github.io/CBE30338/06.04-Linear-Production-Model-in-Pyomo.html#6.4.5.1-Data-in-Matrix/Vector-Format)",
"section": "6.4.5.1 Data in Matrix/Vector Format"
}
},
"source": [
"### 6.4.5.1 Data in Matrix/Vector Format\n",
"\n",
"The example above used scalar modeling components, `model.x = Var()` and `model.y = Var()`, and each constraint was added as a separate line in the model. This is fine for small problems with a just a few unknowns, but becomes impractical for larger problems.\n",
"\n",
"Here we repeat the example above, this time using `numpy` arrays to enter the data. An indexed variable `model.x` represents the unknowns, and the constraints are indexed as well. The indices are represented by the Python `range()` statement."
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {
"colab": {
"base_uri": "https://localhost:8080/",
"height": 134
},
"colab_type": "code",
"id": "00tkLG2CIzxA",
"nbpages": {
"level": 3,
"link": "[6.4.5.1 Data in Matrix/Vector Format](https://jckantor.github.io/CBE30338/06.04-Linear-Production-Model-in-Pyomo.html#6.4.5.1-Data-in-Matrix/Vector-Format)",
"section": "6.4.5.1 Data in Matrix/Vector Format"
},
"outputId": "e4e4700d-5f26-4d42-f6ad-a902dd9f3a22"
},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"x[ 0 ] = 20.0\n",
"x[ 1 ] = 60.0\n",
"constraints : Size=3\n",
" Key : Lower : Body : Upper\n",
" 1 : None : 20.0 : 40.0\n",
" 2 : None : 80.0 : 80.0\n",
" 3 : None : 100.0 : 100.0\n"
]
}
],
"source": [
"from pyomo.environ import *\n",
"import numpy as np\n",
"\n",
"# enter data as numpy arrays\n",
"A = np.array([[1, 0], [1, 1],[2,1]])\n",
"b = np.array([40, 80,100])\n",
"c = np.array([40,30])\n",
"\n",
"# set of row indices\n",
"I = range(len(A))\n",
"\n",
"# set of column indices\n",
"J = range(len(A.T))\n",
"\n",
"# create a model instance\n",
"model = ConcreteModel()\n",
"\n",
"# create x and y variables in the model\n",
"model.x = Var(J)\n",
"\n",
"# add model constraints\n",
"model.constraints = ConstraintList()\n",
"for i in I:\n",
" model.constraints.add(sum(A[i,j]*model.x[j] for j in J) <= b[i])\n",
"\n",
"# add a model objective\n",
"model.objective = Objective(expr = sum(c[j]*model.x[j] for j in J), sense=maximize)\n",
"\n",
"# create a solver\n",
"solver = SolverFactory('glpk')\n",
"\n",
"# solve\n",
"solver.solve(model)\n",
"\n",
"# print solutions\n",
"for j in J:\n",
" print(\"x[\", j, \"] =\", model.x[j].value)\n",
"\n",
"model.constraints.display()"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {
"colab": {},
"colab_type": "code",
"id": "GDeRpBkRIzxD",
"nbpages": {
"level": 3,
"link": "[6.4.5.1 Data in Matrix/Vector Format](https://jckantor.github.io/CBE30338/06.04-Linear-Production-Model-in-Pyomo.html#6.4.5.1-Data-in-Matrix/Vector-Format)",
"section": "6.4.5.1 Data in Matrix/Vector Format"
}
},
"outputs": [],
"source": []
},
{
"cell_type": "markdown",
"metadata": {
"colab_type": "text",
"id": "5p2G6vl7IzxH",
"nbpages": {
"level": 3,
"link": "[6.4.5.1 Data in Matrix/Vector Format](https://jckantor.github.io/CBE30338/06.04-Linear-Production-Model-in-Pyomo.html#6.4.5.1-Data-in-Matrix/Vector-Format)",
"section": "6.4.5.1 Data in Matrix/Vector Format"
}
},
"source": [
"\n",
"< [6.3 Linear Programming](https://jckantor.github.io/CBE30338/06.03-Linear-Programming.html) | [Contents](toc.html) | [Tag Index](tag_index.html) | [6.5 Linear Programming in Pyomo](https://jckantor.github.io/CBE30338/06.05-Linear-Programming-in-Pyomo.html) >
"
]
}
],
"metadata": {
"colab": {
"name": "06.04-Linear-Production-Model-in-Pyomo.ipynb",
"provenance": []
},
"kernelspec": {
"display_name": "Python 3",
"language": "python",
"name": "python3"
},
"language_info": {
"codemirror_mode": {
"name": "ipython",
"version": 3
},
"file_extension": ".py",
"mimetype": "text/x-python",
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.7.4"
}
},
"nbformat": 4,
"nbformat_minor": 1
}