constraint on the dual Variable
AnsweredHello evryone:
I am doing an economic optimization and I need to put a cap on the spot price which is the dual variable of one of the constraints. I receive the this error '''raise KeyError("Component with id '%s': %s"
KeyError: "Component with id '2459030992256': adequacy_constraint[0]"'
the constraint I have defined is :
def lost_load_rule(model, h):
return model.dual[model.adequacy_constraint[h]]<= 1e9
model.voll_constraint = \
pyo.Constraint(model.h, rule=lost_load_rule)
anybody can help me?
Thanks,
0
-
Official comment
This post is more than three years old. Some information may not be up to date. For current information, please check the Gurobi Documentation or Knowledge Base. If you need more help, please create a new post in the community forum, or try Gurobot, our chatbot interface offering instant, expert-level support. -
Hi,
It looks like one of your indices runs out of bound and attains a very huge value (it is possibly not initialized correctly) resulting in a KeyError.
It is hard to provide further help with the code snippet you posted. Please post a minimal working example to reproduce the issue.
Best regards,
Jaromił0
Post is closed for comments.
Comments
2 comments