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.

Filter by
Sorted by
Tagged with
25 votes
3 answers
10k views

What is the purpose of libraries like Pyomo and Google OR tools?

I'm new to the OR world, and trying to learn the various tools available. I originally thought that Pyomo and Google OR tools were open source alternatives to commercial solvers like Gurobi or CPLEX. ...
Skander H.'s user avatar
  • 2,139
9 votes
1 answer
2k views

Pyomo: Looping Over A Variable Method

I am trying to extract my variable values into unique lists so that I can pass them to a panadas dataframe and eventually export the dataframe to Excel after I solve my model. The idea is to have the ...
GrayLiterature's user avatar
3 votes
2 answers
2k views

How to generate multiple solutions to linear program in Python?

I recently posted a question here where I had written some Pyomo code to solve a simple linear program, however I feel the Operations Research platform is perhaps a better fit for this question. My ...
Jwem93's user avatar
  • 333
19 votes
4 answers
9k views

NLP solvers in pyomo other than ipopt?

I am solving a highly constrained (large number of constraints and large number of variables, but small degree of freedom) NLP problem, and for start, I was using Matlab's ...
Stanny_boy's user avatar
10 votes
2 answers
827 views

Modeling and solvers

I have just started to dive into OR world on my work. Currently we are using GAMS with Gurobi but some of us have strong programming background and would like to have more programmatic approach to OR. ...
aurelije's user avatar
  • 203
8 votes
2 answers
760 views

knapsack problem with non-linear constraint

I have a basic knapsack problem where I need to fit the most weight possible in a bin: ...
Cesar Canassa's user avatar
5 votes
3 answers
3k views

How to install Ipopt on Google Colab for Pyomo?

I need to use Pyomo with Ipopt solver on Google-Colab. In order to install it I did as follows: Now I need to use it , I get the following error ? ApplicationError: No executable found for solver '...
Optimization team's user avatar
5 votes
3 answers
826 views

how to "calm down" optimizer

I want to optimize a charging schedule for Battery Electric Vehicles (BEV) along a grid line, taking into account customer wishes (when to be done with charging with what State of Charge (SOC)) and ...
Andre's user avatar
  • 303
3 votes
1 answer
120 views

How to maximise a function with non-differentiable constraints while integrating over a time series data series with linear programming?

In this problem, I need to pick the optimal charging and discharging times and durations of an electric car-sharing battery to maximize income - not just for a single (dis)charging cycle, but a whole ...
Andreas Schuldei's user avatar
3 votes
1 answer
215 views

Modelling a decision variable as an index of a (fixed) set

I'm trying to model the following MINLP problem in Pyomo. We are trying to minimize a nonlinear objective function $f$ in $x_i \in \lbrace{0, 1, 2\rbrace}$ for $i= 1, 2, \dots, N$ and subject to a ...
Steven01123581321's user avatar
3 votes
1 answer
371 views

How to collect solutions within CPLEX and retrieve them from PYOMO?

I am currently to invoke solvers, CPLEX, in particular. As I am solving my problem sequentially, i.e., the top-level subproblem results are being used to generate the model of the next subproblem. To ...
Mike's user avatar
  • 717
3 votes
1 answer
4k views

How to find out which constraint causes problems in Pyomo

I have a Pyomo model with many constraints and variables. When solving it with Gurobi, I get the message "Model is infeasible or unbounded". Now I would like to find out which constraints ...
PeterBe's user avatar
  • 1,652
2 votes
1 answer
142 views

Fixing a complex linear constraint in pyomo

My directed graph f with any node u has a set of outgoing and incoming links as uv ∈ O(u) and vu ∈ I(u) respectively. I am trying to write this constraint here ϕ refers to a binary decision variable ...
Waqas Swati's user avatar
2 votes
2 answers
8k views

Downloading and setting up CPLEX for Pyomo

I have just installed Anaconda and am intending to use Spyder as it is able to display variable, parameter values for debugging. After which, I am planning to use Pyomo to code my MIP model and invoke ...
Mike's user avatar
  • 717
1 vote
1 answer
4k views

How to display results of Pyomo variables in a pandas dataframe

I would like to display all the results of Pyomo variables in a pandas dataframe. I had a look at this question Pyomo: Looping Over A Variable Method and tried to adjust it to my case without success. ...
PeterBe's user avatar
  • 1,652