Questions tagged [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.

1504 questions
3
votes
1 answer

How to get `nl` file from `pyomo` from inside `pyomo` script solver?

I am building many models using pyomo, and from what I understand, pyomo reformulates models before solving them. I want to know exactly what the model looks like when it gets passed to the solver files ipopt and couenne. From what I see here it…
makansij
  • 9,303
  • 37
  • 105
  • 183
3
votes
1 answer

advantages of cplex in pyomo versus cplex in python

I've been using GAMS for a long time, but I cannot use all the functionality of CPLEX under GAMS. Can you do that using Pyomo? or using CPLEX directly in Python? Thanks!
Salva
  • 109
  • 1
  • 9
3
votes
1 answer

Set initial primal and dual values for variables pyomo

I wan't to set initial primal and dual values in a program's variables. Is there a specific way to do this. I can see there is a initialize option in the Var object but i'm not sure how to use it in this manner
iriniapid
  • 65
  • 1
  • 8
3
votes
3 answers

Python doesn't find Pyomo

I'm stumped on why Python won't import pyomo. I can find the directory and see it is installed: 234:pyomo user$ pip show pyomo Name: Pyomo Version: 5.1.1 Summary: Pyomo: Python Optimization Modeling Objects Home-page: http://pyomo.org Author:…
Tim
  • 171
  • 2
  • 12
3
votes
1 answer

How to warm-start pyomo with cplex?

I am currently using cplex with pyomo from the command line using pyomo -solver=cplex model.py data.dat the results are saved in the file results.json. How can I start cplex again using the previous results as a starting solution?
algor207
  • 131
  • 3
3
votes
1 answer

Double summation in Pyomo

I'm just starting to use Pyomo and I've been unable to figure out how to code a double summation. Something like this. Can someone give me a hint? Thanks for your help guys!!
ascub
  • 95
  • 1
  • 11
3
votes
1 answer

Suggesting a lower bound for an ILP solver

I have an integer linear programming problem that takes very long to solve by the solvers I've tried (CPLEX, CBC), even though they find the optimal solution early on. They just take forever to fully prove it. It's easy to calculate a trivial lower…
3
votes
2 answers

How to define an Integral as an objective function in pyomo?

I want to be able to define an integral in pyomo as part of an objective function. I cannot figure out what kind of expression is needed for the integral. Here's my best guess: model = ConcreteModel() model.t = ContinuousSet(bounds = (0,1)) model.y…
makansij
  • 9,303
  • 37
  • 105
  • 183
3
votes
1 answer

How to use multi-level indexing in pyomo with a set and a rangeset?

I have multiple levels of indices in my model in pyomo, and I need to be able to index variables like this: model.b['a',1] But this doesn't seem possible for some reason. I can use multilevel indexing like this: model = ConcreteModel() model.W =…
makansij
  • 9,303
  • 37
  • 105
  • 183
3
votes
2 answers

PyOmo/Ipopt fails with "can't evaluate pow"

I am using PyOmo to generate a nonlinear model which will ultimately be solved with Ipopt. The model is as follows: from pyomo.environ import * from pyomo.dae import * m = ConcreteModel() m.t = ContinuousSet(bounds=(0,100)) m.T =…
Richard
  • 56,349
  • 34
  • 180
  • 251
2
votes
1 answer

using HiGHS solver with highspy and pyomo

I'm attempting to run several models using the HiGHS solver with python/pyomo. At some point a few months back, I had a few things running, but now it seems I'm at a standstill trying to get things working. I'm running an older mac with macOS…
AirSquid
  • 10,214
  • 2
  • 7
  • 31
2
votes
0 answers

Is there a difference between modelling variable limits as bounds or constraints?

What is the difference between specifying bounds in Var(..., bounds=()) versus creating explicit constraints from the solver perspective? Original documentation doesn't say anything about it. Here is simple model with 2 variables each with 2…
mihsamusev
  • 21
  • 1
2
votes
1 answer

How to solve integer optimization problem with Python?

I have a system of linear equations Ax=b, A - matrix (m x n), x - (n x 1), b - (m x 1). The matrix A is almost all 0 and contains only ~ n*m^(1/2) non-zero elements. m and n can be quite large, such as n=28680, m=22500 or n=28680, m=62500. It is…
Alex
  • 23
  • 4
2
votes
1 answer

Pyomo and Gekko pricing values differs from Excel

I am trying to get the same result than Excel using 2 python solvers : Gekko and Pyomo. This is a non linear pricing model from the Practical_Management Science (Christian Albright)book, page 350. The solution provided by Excel is to sell my item…
2
votes
0 answers

Use Modelica FMU derivatives in constraint formulation for Pyomo

As per object, I have several models developed in Modelica that I would like to use for optimal control purposes. So, I was wondering if there is any intention of coupling Pyomo with the FMI/FMU standard (in particular with Modelica generated FMU)…