The Constraint: additional investment flow limit not working with InvestNonConvexFlow

Hello there,

I am trying to set up a model where transformers have min and maxload attributes thus using the new InvestNonConvexFlow Class. However I realize I cannot use a constraint on my investment flow anymore. Is that correct or have I missed something when setting up my model?

Vice versa, I cannot connect the investmentFlow with the Active_Flow_Count constraint? I stumbled accross by trying out the new functionalities.

Thanks in advance for your help!
Fred

Hello Fred,

I am not sure we tested the InvestNonConvexFlow with constraints at the time. Could you post a simple usecase with which one could test InvestNonConvexFlow with constraints ? (as well as which oemof version you use?)

Best Regards,
Pierre-Francois

Hi @Fred,

If you are using limit_active_flow_count_by_keyword, I just checked that it looks at model.NonConvexFlowBlock.NONCONVEX_FLOWS (line 133 in flow_count_limit.py). I am currently not sure if the flows of the type InvestNonConvexFlow are in that set. (If not, that would be a bug or at least improper naming.) If you have a dev version at hand, would you check if iterating over INVEST_NON_CONVEX_FLOWS + NONCONVEX_FLOWS fixes your problem?

Cheers,
Patrik

Hello Patrik, hello Pierre-Francois,

as an example, I want to implement three gas CHPs where each of them have min, max_load constraints to simulate partload-abilities. As another constraint I want them to have a combined investment flow constraint (e.g. space on a plot) or I only want to use one of two of modules to simulate real life behaviour.
I checked the oemof-functions and altered them:
limit_active_flow_count_by_keyword iterates over

model.NonConvexFlowBlock.NONCONVEX_FLOWS and I changed it to odel.InvestNonConvexFlowBlock.INVEST_NON_CONVEX_FLOWS because it seems the constraint would only be used on InvestNonConvexFlows.

The function additional_investment_flow_limit iterates over model.InvestmentFlowBlock.invest[inflow, outflow], which in my case is only applicable for transformers not using the InvestNonConvexFlows, so I changed that function to either iterate over those or model.InvestNonConvexFlowBlock.invest[inflow, outflow] depending on a parameter that is passed down to the function (Nonconvex = True/False) as I thought you wouldn’t want to mix convex and nonconvex flows in a constraint, due to different behaviour.

Edit:

If you have a dev version at hand, would you check if iterating over INVEST_NON_CONVEX_FLOWS + NONCONVEX_FLOWS fixes your problem?

Yes, I use the dev Version, and yes this fixed my problem. I still dont know, if Iterating over different types of flows is a good thing?

Best regards,
Fred

Thank you for bringing that up. I do not think it’s the solution but you helped to locate a bug. I just opened a bug report at GitHub.