You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hello,
I'm learning how to use Pypsa and I am not very experienced in python. My current goal is to understand how the optimization problem works (using Cplex solver) and I was trying to add a new variable and constraints with the compact module, but any variable I add to the model with new names get the same error:
The optimization find the solution. As far as I understand, in the components.py file the value for the new variable cannot be stored as the list of pypsa names do not have the new variable I am adding. There must be a problem as the example from the documentation declare a new name for a new variable... so I gues it works.
At the moment, my solution was to use an existing name and instead add a new attr like this: pypsa.optimization.compat.define_variables(n, lb, ub, name="Generator", attr='new_attr', axes=[n.snapshots, n.generators.index])
I hope someone can help me figuring out what I am doing wrong. This is also my first time using Github, apologise for any mistake in posting the question.
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
Hello,
I'm learning how to use Pypsa and I am not very experienced in python. My current goal is to understand how the optimization problem works (using Cplex solver) and I was trying to add a new variable and constraints with the compact module, but any variable I add to the model with new names get the same error:
The optimization find the solution. As far as I understand, in the components.py file the value for the new variable cannot be stored as the list of pypsa names do not have the new variable I am adding. There must be a problem as the example from the documentation declare a new name for a new variable... so I gues it works.
At the moment, my solution was to use an existing name and instead add a new attr like this:
pypsa.optimization.compat.define_variables(n, lb, ub, name="Generator", attr='new_attr', axes=[n.snapshots, n.generators.index])
I hope someone can help me figuring out what I am doing wrong. This is also my first time using Github, apologise for any mistake in posting the question.
Beta Was this translation helpful? Give feedback.
All reactions