
This introductory lecture outlines turning business problems into mathematical models, coding with GAMS or Pyomo, and solving them with appropriate solvers. Focus on modeling and coding skills, not theory.
Explore the course curriculum for mathematical optimization with GAMS and Pyomo in Python. Set up coding environment—from GAMS to Google Colab—and solve three examples per section with GAMS and Python.
Discover why we select GAMS and Pyomo as modeling platforms for mathematical optimization, enabling you to model once in Python and call multiple solvers with a single line of code.
Install and configure the latest GAMS release, including choosing an OS, advanced installation options, Studio vs IDE, path setup, and licensing, to start solving optimization problems with GAMS.
Identify the three core components of optimization—objective function, decision variables, and constraints—and explore a general model for LP, NLP, MILP, and MINLP with GAMS and Pyomo.
Learn to model and solve linear programming problems using GAMS and Pyomo with Python by formulating a two-ad campaign for Dorian Auto, minimizing cost under audience constraints.
Learn to solve a first linear program in GAMS by defining x1 and x2, setting z as the objective, applying constraints, and reading the detailed .lst solution from the LP solver.
This lecture demonstrates solving a first linear program with Pyomo in Google Colab, defining a model with variables, an objective, and constraints, installing GLPK, and obtaining the optimal solution.
Minimize hires of full-time staff by modeling x_i as employees beginning on day i, enforcing five consecutive workdays and two days off, and meeting requirements with GAMS in Google Colab.
Use GAMS to model the post office workers scheduling linear programming problem, defining x1 through x7, the objective z, and non-negativity constraints, solved with CPLEX to yield the optimal value.
Demonstrate solving the post office workers scheduling problem in Pyomo, defining x1 through x7, minimizing total workers, and applying daily constraints with GLPK, then enforce non-negativity.
Define sets i, c, and a to compress a mathematical optimization model; organize items, customers, and ads with theta_a, alpha_c, mu_a_c, and set a cost objective with viewership constraints.
Use GAMS to solve a third LP example by defining sets c and a, specifying theta and mu, and solving with cplex LP to obtain optimal objective and x values.
Solve the third lp problem in Pyomo by defining sets, parameters, and variables, and use glpk to obtain optimal cost 320 and ads 3.6 and 1.4.
Learn to manage Pyomo code on Google Colab by saving notebooks to Drive or GitHub, uploading or renaming, and downloading as ipynb or py files for single or multiple models.
Explore the general structure of linear programming problems, extract and organize problem data, assemble optimization models, and use set definitions for compact coding with GAMS and Pyomo.
Introduce nonlinear programming with GAMS and Pyomo, review NLP concepts, and illustrate nonlinear regression via linear and exponential models, showing how to minimize squared errors and choose starting solutions.
Define the set m and datapoints in GAMS, build linear and nonlinear regression models with obj_linear_regress and obj_nonlinear_regress, and solve using CONOPT for comparison. Proceed to the Pyomo environment next.
Learn to solve linear and nonlinear Pyomo models in Google Colab using IPOPT, by defining concrete models, sets, variables, initial solutions, and bounds in variable declarations.
illustrate how initial guesses influence nlp solutions, contrasting linear and nonlinear models with coefficients a1, a2, b1, b2, b3, and note Gams sensitivity versus Pyomo robustness.
This lecture presents a geometric optimization problem that packs five identically sized circles inside a unit circle, maximizes their radius, and enforces nonoverlap and boundary constraints using GAMS.
Solve five-circle packing inside a unit circle with GAMS, defining r, x(i), and y(i) and maximizing the radius under containment constraints. Then proceed to the Pyomo environment to solve it.
Solve the second NLP example in Pyomo on Google Colab by constructing and solving a circle packing model with sets, variables, constraints, and IPOPT, and interpreting results.
Explore the importance of solvers for NLP problems, showing how IPOPT, SNOPT, and KNITRO can yield multiple locally optimal solutions and how results differ between GAMS and Pyomo.
Resource allocation optimization: assign weapons to twenty targets to maximize damage under constraints. Model with GAMS and Pyomo using sets w, t, t_spec and a probabilistic hitting model.
Apply GAMS to solve the third NLP example, allocating weapons to targets to maximize damage. Define x(w,t) as positive, load phi via a $include data file, and solve with IPOPT.
Learn to build a Pyomo NLP model on Google Colab for example 3, with sets, parameters, variables, constraints, and an Ipopt solver.
Explore the nonlinear optimization structure, set variable bounds, initialize variables, define constraints with conditional statements, create subsets, and code NLP problems in GAMS and Pyomo.
Learn to model and solve mixed-integer linear programs in GAMS and Pyomo, using big-M and either-or constraints across three examples: automobile manufacturing, power scheduling, and flowshop scheduling.
Solve the Dorian auto manufacturing milp in GAMS by defining sets, x_a, y_a, phi, mu_a, alpha, sigma, gamma, and M, then maximize z using cplex.
Learn how to build and solve a mixed-integer linear problem in Pyomo on Google Colab, defining a ConcreteModel, sets, variables, big-M bounds, and GLPK-powered optimization, with result export.
Schedule three generator types across five time periods to meet demand while enabling a 15 percent load increase, minimizing cost with startup and operating costs in a GAMS Pyomo model.
This lecture demonstrates solving a GAMS MILP power scheduling example, defining time periods and generators, with x, n, s, to minimize cost using CPLEX and preparing export for Pyomo.
solve the second milp power scheduling problem with pyomo in google colab, building a concrete model, defining sets and variables, and solving with glpk.
Explore a three-machine flowshop scheduling problem with six workpieces, optimizing sequencing through bending, soldering, and assembly by ranking jobs and minimizing total completion time.
Define the six items and three machines in a GAMS flowshop MILP, declare R, S, C, and T, and minimize total completion time.
Solve a flowshop MILP with Pyomo in Google Colab by building a concrete model, defining sets i, m, k, binary and real variables, and exporting results to xlsx.
Visualize the optimal flowshop scheduling problem's solution from example 3 using Gantt charts, organizing R, S, and C in Excel; show that multiple optimal solutions share 35 minutes.
Master the structure of mixed-integer linear programming and code MILP models in GAMS and Pyomo (Python), use the big-M method for either-or constraints, and submit to the NEOS Server.
Formulate and solve mixed integer nonlinear programming problems in GAMS and Pyomo, illustrated by a power scheduling example with binary and continuous variables and a nonlinear fuel consumption curve.
Define a three-period MINLP power scheduling model in GAMS, with binary b(t) and storage volume v(t) variables. Lecture shows bounds, objective, and constraints, solving example_1 and preparing a Pyomo transition.
Learn to model and solve a mixed integer nonlinear program using Pyomo on Google Colab, including data import, constraints, and NEOS minlp solver for a power scheduling problem.
Presents an integer nonlinear programming model for dairy pricing in the Netherlands, maximizing revenue under fat and dry matter constraints with a nonlinear x times c objective influenced by cross-elasticity.
Explore solving an agricultural pricing MINLP with GAMS by building a dairy product model, importing data, and comparing DICOPT and BARON solvers for global versus local optima.
Solve a MINLP in Pyomo on Google Colab for the agricultural pricing problem, building a concrete model with constraints and a revenue-maximizing objective, using JSON data.
Explore a MINLP yield management problem for airline pricing, modeling multiweek demand scenarios and stochastic optimization to maximize expected revenue while hiring planes.
Explore solving a yield management MINLP in GAMS for example 3, including Excel data import, sets and variables, and solving with BONMIN and BARON, then moving to Pyomo.
solve a final minlp yield management problem with pyomo on google colab, building a concrete model and importing data, then compare neos minlp and bonmin against baron.
Identify the general structure of MINLP problems, model discontinuous variables and functions in GAMS and Pyomo, import data from text and Excel, and review solver choices for stochastic optimization.
Consolidate your learning by extracting business problems, formulating mathematical optimization models, and solving them with GAMS or Pyomo to obtain optimal decisions.
This introductory course to optimization in GAMS and Pyomo (Python) contains 4 modules, namely,
Linear programming
Nonlinear programming
Mixed Integer Linear Programming, and
Mixed-Integer Nonlinear Programming
In each module, we aim to teach you the basics of each type of optimization through 3 different illustrative examples and 1 assingment from different areas of science, engineering, and management. Using these examples, we aim to gently introduce you to coding in two environments commonly used for optimization, GAMS and Pyomo. GAMS is a licensed software, for which we use a demo license in this course. Pyomo is an open-source package in Python, which we use Google Colaboratory to run. As we proceed through the different examples in each module, we also introduce different functionalities in GAMS and Python, including data import and export.
At the end of this course, you will be able to,
Read a problem statement and build an optimization model
Be able to identify the objective function, decision variables, constraints, and parameters
Code an optimization model in GAMS
Define sets, variables, parameters, scalars, equations
Use different solvers in GAMS
Leverage the NEOS server for optimization
Import data from text, gdx, and spreadsheet files
Export data to text, gdx, and spreadsheet files
Impose different variable ranges, and bounds
Code an optimization model in Pyomo
Define models, sets, variables, parameters, constraints, and objective function
Use different solvers in Pyomo
Leverage the NEOS server for optimization
Import data from text, gdx, and spreadsheet files
Export data to text, gdx, and spreadsheet files
Impose different variable ranges, and bounds