-
Notifications
You must be signed in to change notification settings - Fork 124
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
GenericStorage not creating InvestmentFlows when used with invest_relation_input_output #1013
Comments
Shouldn't the |
That might work (have to try it tomorrow) but it isn't shown like that in any of the examples. And then the |
Maybe, it makes sense to rewrite this thing anyway. I'd consider replacing the fixed relations between the investments by a limit to the c-rate. It would be an internal property that exists independent from the nominal values of the flows. |
Yeah, you are right about locating this to the
|
I see multiple problems with the current implementation. First of all, we create unexpected investment variables. (If the Flows do not have to have one, they are silently created.) Secondly, you can do confusing things. The electric_storage = cmp.GenericStorage(
label="electric_storage",
inputs={el_bus: solph.Flow(max=10)}, # will be charged in 1 hour
outputs={el_bus: solph.Flow()},
nominal_storage_capacity=solph.Investment(
ep_costs=elstor_epc, existing=1200, maximum=2100
),
invest_relation_input_capacity=0.1,
invest_relation_input_output=0.1,
) |
When using the GenericStorage with an investment optimization approach like this:
I get
KeyError: 'Index \'("<oemof.solph.components._generic_storage.GenericStorage: \'electric_storage\'>", "<oemof.solph.buses._bus.Bus: \'el_bus\'>", 0)\' is not valid for indexed component \'InvestmentFlowBlock.total\''
I assume that the error might be in the internal function
_set_flows
. I defined theself.invest_relation_input_capacity
andself.invest_relation_input_output
, but the_set_flows
function only considersself.invest_relation_output_capacity
for the output flows, meaning that my output flows don't get converted intoInvestmentFlow
objects.If I use
invest_relation_output_capacity=0.9375
instead of theinvest_relation_input_output
, the model starts to solve.The text was updated successfully, but these errors were encountered: