shqu
shqu

Reputation: 11

Gurobi - Infeasible Constraint

start_time = time.time()
hours = 5
for i in range(hours):
print('---Running hour, ', i)
fsthr = i+35
lsthr = i + 1+ 35
network.lopf(network.snapshots[fsthr:lsthr], solver_name='gurobi', pyomo=False)                                                                                             
n=gp.Model('snapshot')

I am running an OPF model for the US for the year 2022. I had used 2022 actual data to get an idea. When i try to run the model, i get

WARNING:pypsa.linopf:Optimization failed with status warning and termination condition infeasible or unbounded.

How can i check what the constraint is?

Upvotes: 1

Views: 234

Answers (2)

Fabian Neumann
Fabian Neumann

Reputation: 126

With gurobi, you can also run

n.model.compute_set_of_infeasible_constraints()

after solving.

(This only works with the new solver interface n.optimize(), not n.lopf())

Upvotes: 2

francoua
francoua

Reputation: 13

You can check the constraints of the network created by calling network.model.constraints and if you want the objective function you can call network.model.objective.

Upvotes: 0

Related Questions