ArticleslgStudy

computer science

Pyomo

Pyomo is a computer science topic covered in the lgStudy science library. This page brings together a partial reference excerpt, illustrations, worked examples, real-world applications and a short study plan, so you can understand Pyomo rather than just read about it. In short: Pyomo is a collection of Python software packages for formulating optimization models. Pyomo was developed by William Hart and Jean-Paul Watson at Sandia National Laboratories and David Woodruff at University of California, Davis.

Pyomo — main illustration
Pyomo — illustration

Key takeaways

  • Pyomo belongs to computer science; place it in that map before memorising details.
  • Learn the definition first, then one example that makes the definition concrete.
  • Connect Pyomo to a quantity you can measure, compute or draw — that is where exam questions come from.
  • Reproduce the core statement of Pyomo from memory before moving on to harder problems.

Reference excerpt

Pyomo is a collection of Python software packages for formulating optimization models. Pyomo was developed by William Hart and Jean-Paul Watson at Sandia National Laboratories and David Woodruff at University of California, Davis. Significant extensions to Pyomo were developed by Bethany Nicholson and John Siirola at Sandia National Laboratories, Carl Laird at Purdue University, and Gabriel Hackebeil. Pyomo is an open-source project that is freely available, and it is licensed with the BSD license. Pyomo is developed as part of the COIN-OR project. Pyomo is a popular open-source software package that is used by a variety of government agencies and academic institutions.

Features Pyomo allows users to formulate optimization problems in Python in a manner that is similar to the notation commonly used in mathematical optimization. Pyomo supports an object-oriented style of formulating optimization models, which are defined with a variety of modeling components: sets, scalar and multidimensional parameters, decision variables, objectives, constraints, equations, disjunctions and more. Optimization models can be initialized with python data, and external data sources can be defined using spreadsheets, databases, various formats of text files. Pyomo supports both abstract models, which are defined without data, and concrete models, which are defined with data. In both cases, Pyomo allows for the separation of model and data. Pyomo supports dozens of solvers, both open source and commercial, including many solvers supported by AMPL, PICO, CBC, CPLEX, IPOPT, and GLPK. Pyomo can either invoke the solver directly or asynchronously with a solver manager. Solver managers support remote, asynchronous execution of solvers, which supports parallel execution of Pyomo scripts. Solver interaction is performed with a variety of solver interfaces, depending on the solver being used. A very generic solver interface is supported with AMPL's nl (format).

Related software The following software packages integrate Pyomo as a library to support optimization modeling and analysis:

SolverStudio lets you use Excel to edit, save and solve optimisation models built using a variety of modeling languages, including Pyomo. Pyomo is bundled with the SolverStudio software. TEMOA (Tools for Energy Model Optimization and Assessment) is an open source modeling framework for conducting energy system analysis. The core component of TEMOA is an energy economy optimization model. This model is formulated and optimized using Pyomo. MinPower is an open source toolkit for students and researchers in power systems. It is designed to make working with standard power system models simple and intuitive. MinPower uses Pyomo to formulate and optimize these power system models. linopy project, offering similar functionality to Pyomo.

See also Algebraic modeling language

References

External links Articles from IBM's developerWorks: Gift, Noah (5 February 2013). "Linear optimization in Python, Part 1: Solve complex problems in the cloud with Pyomo". Linear optimization in Python, Part 2: Build a scalable architecture in the cloud "Pyomo Meets Fantasy Football". 2015-01-27. APOPT Solver for LP, QP, MILP, NLP, and MINLP solutions in Pyomo

Worked examples

Example 1 — a first encounter with Pyomo

Start with the simplest possible case. Write down what Pyomo claims or describes in one sentence, then invent the smallest concrete situation in which that sentence is true. In computer science, the smallest case is usually a single object, a single equation or a single measurement. Check that every symbol or term in your sentence has a meaning in that case.

Example 2 — changing one variable

Take the situation from Example 1 and change exactly one quantity: double it, halve it, or set it to zero. Predict what should happen to Pyomo before you calculate. Comparing your prediction with the result is the fastest way to find out whether you understand the idea or only the words.

Example 3 — an exam-style question

Typical questions about Pyomo ask you to (a) state it precisely, (b) apply it to given data, and (c) explain a limitation. Practise writing all three answers in under five minutes; the third part is what separates a full-mark answer from an average one.

Applications of Pyomo

In research
Pyomo appears in computer science research whenever the underlying quantities have to be modelled precisely. Papers usually cite it as a starting assumption and then explore where it breaks down.
In technology and industry
Engineering practice reuses Pyomo in design rules, simulations and safety margins. Knowing the idea lets you read a specification sheet and understand why the numbers look the way they do.
In the classroom
Pyomo is common in secondary-school and first-year university syllabi. It links to neighbouring topics Mathematical optimization software, Software programmed in Python, Software using the BSD license, so understanding it makes those chapters shorter.
In everyday life
Look for Pyomo outside the textbook — in sport, cooking, traffic, electronics or the sky above you. An example you found yourself is remembered far longer than one you were given.

Affiliate

Preply — study more efficiently by working with a personal tutor. 50% off.

How to study Pyomo in 20 minutes

  1. Read the reference excerpt below once, without taking notes.
  2. Close the page and write down what Pyomo means in your own words.
  3. Compare your version with the excerpt and mark what you missed.
  4. Work through the three examples above with pen and paper.
  5. Explain Pyomo out loud to somebody else — or to Teacher Smith in the lgStudy chat.

Frequently asked questions

What is Pyomo in simple terms?

Pyomo is a collection of Python software packages for formulating optimization models. Pyomo was developed by William Hart and Jean-Paul Watson at Sandia National Laboratories and David Woodruff at University of California, Davis.

Why does Pyomo matter?

Because it connects several computer science ideas at once: it gives you a definition you can apply, a quantity you can calculate, and a way to check whether a result is plausible.

How should I study Pyomo?

Read the excerpt, restate it from memory, then work through the examples and applications listed on this page. The five-step study plan above takes about twenty minutes.

What does this page cover?

It gives you a compact reference excerpt plus original lgStudy explanations, examples, applications and study material on Pyomo.

Tags

  • Mathematical optimization software
  • Software programmed in Python
  • Software using the BSD license

Keep exploring