Skip to main content

Questions tagged [pyomo]

For questions related to the Python optimization modeling package Pyomo. Pyomo is a Python-based open-source software package that supports a diverse set of optimization capabilities for formulating, solving, and analyzing optimization models. Pyomo allows users to formulate optimization problems in Python in a manner that is similar to the notation commonly used in mathematical optimization.

39 questions with no upvoted or accepted answers
Filter by
Sorted by
Tagged with
8 votes
1 answer
107 views

Is there any way to use Lazy constraints in Pyomo?

I would like to know if there is any way to implement a Lazy constraint in the Pyomo package. (As far as I know, the only way to implement such a constraint is by ...
A.Omidi's user avatar
  • 8,960
6 votes
0 answers
233 views

Provide basic solution to CLP

I'm using Pyomo to formulate an LP with approx 500,000 constraints and 200,000 decision variables. The LP is solved using CLP. Some instances fail to return even a feasible solution after many ...
dijkstraa's user avatar
5 votes
0 answers
227 views

How to use interpolation for problem parameters in Pyomo

I'm working on my first Pyomo DAE project to teach myself how to use it for trajectory optimization. I have generated an atmosphere lookup table with density and speed of sound as a function of ...
machalot's user avatar
4 votes
0 answers
1k views

Google-OR tools vs Pyomo and other commercial Solvers for solving a simple maximum flow problem

I have implemented a Pyomo model for solving maximum flow problem as a subroutine of an algorithm. However, the approach does not scale very well because Pyomo does not provide a very good way to re-...
Pia MiA's user avatar
  • 390
4 votes
0 answers
155 views

How to invoke a solution pool and access all the solutions in cplex using PYOMO ? this is the structure of my pyomo code

...
Prachi Patki's user avatar
3 votes
0 answers
135 views

Creating Disjunctions for MIP Model. Code taking too long to execute

I am currently following this guide in the hopes of building a linear programming model in python and solving using gurobi. https://towardsdatascience.com/schedule-optimisation-using-linear-...
SevenArmy's user avatar
3 votes
0 answers
184 views

Testing the pyomo optimization model

I have a resource scheduling optimization model in Pyomo with 3 constraints and an objective. The model runs well for the minimization and maximization objectives. ...
Waqas Swati's user avatar
3 votes
0 answers
198 views

Can Pyomo be linked with Google's GLOP or CP-SAT solvers?

Pyomo can be linked with several solvers Open source and commercial ones. I was wondering if Pyomo can be linked with Google's GLOP or CP-SAT solvers?
Optimization team's user avatar
3 votes
0 answers
166 views

Pyomo: Compute IIS, remove corresponding constraint and resolve

I am using pyomo together with a bunch of solvers (gurobi, cbc, etc.). I am able to compute the IIS (with gurobi, not cbc), and write it in a *.ilp file. What I ...
Meth's user avatar
  • 424
3 votes
0 answers
101 views

Automatic quadratization of constraints in pyomo for gurobi

Gurobi 9 can solve QCQPs, and QCQPs capture all of polynomial optimization by the obvious trick that e.g. a cubic term $x_1 x_2 x_3$ can be turned into a quadratic term $y x_3$ and a constraint $y = ...
Martin Koutecký's user avatar
2 votes
0 answers
49 views

Using BigM and auxiliary variable to linearise model leads to incorrect results

I am working on a Pyomo optimization model that aims to select the cheapest fuel for production at different facilities over several time periods. The model should select Mode1 for Tech1 when Fuel1 is ...
Jamie Bull's user avatar
2 votes
0 answers
252 views

Pyomo Terminal Condition: other

I have written a huge optimization code in pyomo. The code serves for any planning horizon. The variables are indexed in time (t). When I set t to have 365 days, the termination condition is feasible/...
Alex's user avatar
  • 21
2 votes
1 answer
195 views

Using networkx predecessors in Pyomo initialize method

I am working on the directed graph by using the Networkx package and what I need is to use its predecessors' method on an optimization model. Let's say, there exists a directed graph with just $12$ ...
A.Omidi's user avatar
  • 8,960
2 votes
0 answers
1k views

Add lower and upper bounds on decision variables in Pyomo

I have the following optimization model in pyomo: ...
Telso's user avatar
  • 21
2 votes
0 answers
117 views

Pyomo optimisation not working (gas plant dispatch)

background I am trying to write an pyomo script to optimally dispatch a gas plant based on perfect foresight of electricity prices. I believe I am 90% of the way there, just a few issues. Problem The ...
Bobby Heyer's user avatar
2 votes
0 answers
271 views

Pyomo + Cplex - OSError: [Errno 22] Invalid argument

I am trying to get Cplex working with pyomo. I have followed Cplex installation instructions has explained here: Downloading and setting up CPLEX for Pyomo However when calling Cplex via pyomo I get ...
Meth's user avatar
  • 424
2 votes
0 answers
149 views

Run Pyomo model with externally assigned variables

I have several (large) Pyomo models with about 20 variables and parameters (as time series). Out of these variables and parameters I have 3 decision variables. Now my question is whether I can use ...
PeterBe's user avatar
  • 1,652
2 votes
0 answers
247 views

Pyomo Trouble - Number of Constraints in Output is 0 When It Should Be > 5000

I have an MILP program written in Pyomo and I am using CBC as a solver. Below is a description of my problem: The model works fine when it is run on my local computer The output is the following in ...
Devon Elizabeth's user avatar
2 votes
0 answers
707 views

How to assign a single value to Pyomo parameter without a dictionary

I would like to assign a single value to a paramter that depends on a created set in Pyomo. I have the following code: ...
PeterBe's user avatar
  • 1,652
2 votes
0 answers
141 views

PYOMO - Optimization for the daily production of a products demand minimizing the production cost

I am trying to build an optimization model using PYOMO for the daily production of a product demand, minimizing the production cost. I have demand, production capacity (by machine by day), production ...
PAULO CRISTIANO KLEIN's user avatar
2 votes
0 answers
357 views

Find multiple solutions in Pyomo with Gurobi

I am fairly new to Pyomo and Gurobi. I'd like to find 20 sets of different solutions that meet the following constraints. ...
ssswokao's user avatar
2 votes
0 answers
180 views

Rolling Horizon in Pyomo

I am trying to figure out how one could write a rolling horizon algorithm in PYOMO to speed up the solution of a model that I am building. My understanding of the Rolling Horizon Algorithm is that you ...
GrayLiterature's user avatar
1 vote
0 answers
108 views

pyinstaller and Pyomo and also SCIP

I would like to package (using pyinstaller) my optimizer program that uses Pyomo and SCIP. I keep getting ...
mathlete42's user avatar
1 vote
0 answers
98 views

How to speed up state of charge constraint in Pyomo model

Context: I am working on a small electricity market model in Pyomo. It optimizes the capacity of different technologies and generation in at least 43800 hours. One of the technologies is a battery. ...
funkypenguin's user avatar
1 vote
0 answers
60 views

Migrates between solvers

I would like to know if there is a way to migrate the model from A to another solver. For example, lets say i have done built my model in gurobipy and would like to migrates into pyomo. Is there a way?...
overboxed's user avatar
  • 593
1 vote
0 answers
356 views

Resetting Pyomo model after computation

I am aware that the types provided by pyomo are immutable and often cause issues when we feed the same data twice in consecutive computations (e.g. when trying to solve an instance a couple of times) ...
Pia MiA's user avatar
  • 390
1 vote
0 answers
45 views

Finding the solutions using pyomo and gurobi

I have a code that uses pyomo and gurobi but when i try to run it, it doesn't give me the optimal solutions, just says that they exist. What can i do?
Joana Domingos's user avatar
1 vote
0 answers
103 views

Pyomo error about evaluating value of 'ScalarParam' parameter

I'm trying to optimize a huge model, but here is a part of it capable of creating an understanding of my question: ...
Alexandre César Barbosa's user avatar
1 vote
0 answers
304 views

CPLEX callback in pyomo

I am trying to figure out what is the correct use of cplex callbacks in pyomo. In particular I am looking for the translation of the following example from gurobi to cplex: ...
Luca's user avatar
  • 59
1 vote
0 answers
271 views

Solver issue? Xpress (slp) - Nonlinear - Python - Pyomo

I tried solving my model with xpress: pip install xpress And then in the model: ...
PM0087's user avatar
  • 111
1 vote
0 answers
254 views

How to deal with hourly and annually constraints in Pyomo?

I am wondering whether it is possible to create constraints over years and hours at the same time in Pyomo. For example, my current time variable is: ...
Snowflake's user avatar
  • 517
1 vote
0 answers
1k views

Value Error in Pyomo: Constraint rule returned None

I get an error in Pyomo that I do not understand. I habe 288 timeslots t and a binary variable y (which I call here ...
PeterBe's user avatar
  • 1,652
1 vote
0 answers
93 views

CPLEX keeps restarting in Pyomo

I tried running my model by adding the following settings to CPLEX. ...
Mike's user avatar
  • 717
0 votes
0 answers
52 views

How to initialize Pyomo Piecewise constraint aux variables

I am struggling with solving a MIP model formulated using Pyomo within a Python program. For some sets of problem parameters, CPLEX, HiGHS, and SCIP are sometimes failing to solve the problem and ...
pdb5627's user avatar
  • 186
0 votes
0 answers
27 views

R package cannot find PYOMO. How do I point to the correct location of where it's located?

As a quick note this is a re-post from the main StackOverflow. I am trying to use the PYOMO linear programming solver from within an R script. When I type ...
Abed's user avatar
  • 1
0 votes
0 answers
132 views

Pyomo + Gurobi Scheduling Tasks within Working Hours

I initially posted this on stackoverflow and got redirected here. You can view the old post with formatted tables here: StackOverflow Post I have a python schedule optimization script using pyomo and ...
Phil Franjo's user avatar
0 votes
2 answers
259 views

Gurobi founds optimal solution but it is not feasible

I'm currently solving a MIP model with pyomo using gurobi and I am facing strange results. I have one constraint that looks like this: ...
Franco's user avatar
  • 13
0 votes
0 answers
71 views

Looking for correction in pyomo constraint

I am working on two graphs having nodes and edges. Graph1: VNF Graph with node demand and bandwidth demand. Graph2: Server Graph with node capacity and bandwidth capacity. The nodes and links of ...
Waqas Swati's user avatar
-1 votes
1 answer
209 views

creating individual Variables in pyomo with different length

I am new to pyomo and I do have some smaller (or bigger) problems and hope someone can help me. How can you create this variable in pyomo? I wanted to create it with pyo.Varlist() in which I pass ...
Tamara Koch's user avatar