Questions tagged [linear-optimization]

38 questions
0
votes
1 answer

Is there a way to have a formula or script pick an amount of pre-set lengths to cover an area

Apologies if the title isn't very clear. What I am trying to do is get a google sheet to automatically calculate how many lengths of a material I will need to cover an area, hopefully to include a mix if needed. There are three different lengths of…
0
votes
1 answer

SCIP constraint not satisfied

I am new to using SCIP, and I can't figure out why SCIP is not satisfying the constraints of my ILP. I have specified my ILP in the .lp format as described by IBM. For example, consider the following constraints: X0 - X1 - 5z_0_1_0 < 0 X1 - X0 -…
0
votes
1 answer

Converting a simple conditional statement constraint into linear equation

I am using PuLP method to optimize a problem. I have a simple conditional statement as: If A = 0, x = 0 Else if A>0, x = 1 How can I change it into mathematical equation (or a list of equations) if I want to use it as a constraint in…
0
votes
1 answer

How to extract variables that equal a certain value in pyomo?

I am building a linear optimization model and trying to extract key information from my decision variable values. instance.x.display() displays the following sample x : Size=121, Index=x_index Key : Lower : Value : Upper : Fixed : Stale :…
Berbatov
  • 11
  • 2
0
votes
1 answer

Python PulP linear optimisation for off-grid PV and battery system

I'm trying to use linear optimisation to minimise the size of solar PV and battery for an off-grid property. I have solar irradiance data and household energy consumption data - I have created a year's worth (8760 data points) of the data below. I…
0
votes
2 answers

model.update performance in the model

I have a question about performance of the model.update in the gurobipy library. Let's say I have a list of objects which I want to add as a variable to the model, also I want to add a constraint to each of this object, to do that I have a for loop…
0
votes
0 answers

Example for SimplexSolver in Apache Commons Maths 3.6.1

I am new to linear optimization and currently trying to use the SimplexSolver.class from org.apache.commons.math3.optim.linear. So I looked up some examples on how to use it, to understand it and also to recall what the Simplex Algorithm exactly…
0
votes
1 answer

Gurobi says the model is infeasible, yet I can come up with a solution by hand. Python implementation

Here is my model. Gurobi says its infeasible. My apologies if its hard to follow. from gurobipy import Model, GRB f = Model() num_steps = 3 steps = [*range(num_steps)] steps_for_C = [*range(num_steps + 1)] A = f.addVar(0, float('inf'), name =…
midav
  • 91
  • 2
  • 7
1 2
3