Skip to content
Advertisement

Tag: pyomo

Formulating the constraint x[i+1]<= x[i] in Pyomo

I have my decision variable x which is indexed on the list N. I want the constraint that x[i+1] <= x[i] or x[i] <= x[i-1]. But how do I do this in Pyomo without going out of range with my index? This thus doesn’t work. Anyone an idea how to do this? Answer You could use Constraint.Skip to avoid accessing

Pyomo find minimal sum of list values

I want to have an indexed binary variable so pyomo optimises it to minimise the total sum of the list while picking at least 2 elements. When I remove the (imo redundant) model.q I receive: ValueError: No variables appear in the Pyomo model constraints or objective. This is not supported by the NL file interface and the solution pyomo gives

`SolverResults Error` When Parallelising Pyomo Optimisations

I’m trying to optimise multiple linear programming problems in parallel using Pyomo and the standard Python multiprocessing library. When switching to using multi-processing I keep running into the error: ValueError: Cannot load a SolverResults object with bad status: error. A similar issue was reported in this question, where their problem seemed to be that the solver (n.b. they used cbc

Using NEOS as a Pyomo solver

I have recently started in doing some OR, and have been trying to use Pyomo and NEOS to do some optimation problems. I have been following along with one of the UT Austin Pyomo lectures, and when my GLPT was being difficult to be installed, I moved on to NEOS. I am having some difficulty in now receiving a solved

Switching to Pyomo – Syntax issue with sets

I have used the algebraic modelling language AMPL but I’m now making the switch to python and Pyomo. I’m struggling a bit with its syntax though. In AMPL I would have something like this: How can I implement the last line in Pyomo? Any help is much appreciated, thank you! Best regards, Johannes Answer Welcome to the site. Below is

Pyomo: Minimize for Max Value in Vector

I am optimizing the behavior of battery storage combined with solar PV to generate the highest possible revenue stream. I now want to add one more revenue stream: Peak Shaving (or Demand Charge Reduction) My approach is as follows: Next to the price per kWh, an industrial customer pays for the maximal amount of power (kW) he was drawing from

Advertisement