Skip to content
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

connection_capacity constraint linked to temporal resolution of invest temporal_block #715

Closed
kTelaar opened this issue Jul 24, 2023 · 5 comments

Comments

@kTelaar
Copy link

kTelaar commented Jul 24, 2023

Hi everyone,

I noticed an issue when investing in connection capacity with varying temporal resolutions present, e.g. 2 different temporal_blocks:

  1. "hourly" resolution of 1h, model__default_temporal_block
  2. "invest" resolution of 1M, model__default_investment_temporal_block

While the resulting connection flow through the invested connection is shown in a resolution of 1h in the outputs, the constraint of invested_connections * connection_capacity =< maximum flow seems to be applied to the resolution of 1M (or in the case where model_end is shorter than the 1M "invest" resolution: the complete modeled duration).

For example

  • input config of connection_capacity: 1000.0
  • output variable connections_invested: 1.0

resulting in (shown in plot below)

  • connection_flow maximum 10319.8126 (peak per hour)
  • connection_flow average 1000.0 (average per hour, during 336h)

SA-BRA-CN_SA-BRA-NE

A comparison to established connections that are not investment candidates showed the expected behaviour of connection_capacity correctly limiting the maximum flow per hour, while the invested connection seems to limit the maximum flow per month (or in this case to the average through the modeled 336h).

I've included the input config and output results of the mentioned connection and a different one with 644 MW invested capacity in an Excel File as well.
20230724 input and output bug report connection invest.xlsx

Many thanks,
Konrad

  • SpineOpt:
    [0cda1612] SpineInterface v0.11.1
    [0d8fc150] SpineOpt v0.6.13
  • Toolbox:
    spinetoolbox 0.6.15
    spinedb_api 0.24.0
    spine_engine 0.19.0
    spine_items 0.17.0
    Python 3.8.1 (default, Mar 2 2020, 13:06:26) [MSC v.1916 64 bit (AMD64)]
  • Win10 Pro
@kTelaar
Copy link
Author

kTelaar commented Jul 26, 2023

adding to this: in the "constraint_connection_flow_capacity.jl" you commented on the here observed behaviour

"for situations where the same connection handles connection_flows to multiple nodes with different temporal resolutions, the constraint is only generated for the lowest resolution, and only the average of the higher resolution connection_flow is constrained."

I don't think it should apply in this context though because the investable (candidate_connections = 1.0) connection connects the same exact nodes that the established connection (candidate_connections = None) connects as well. The only difference seems to be that the connection_flow is constrained in the first case by the resolution of model__default_investment_temporal_block and in the second case by the resolution of model__default_temporal_block.

@kTelaar
Copy link
Author

kTelaar commented Sep 27, 2023

after a bit of experimenting:
a resolution of 1h for the "invest" temporal_block resolves this issue.

Unfortunately this also means, that investments are possible at each modeled hour while the intent for the "invest" temporal block was to allow investments only in the first modeled hour of each month or year. Cutting the temporal block via "block_start" and "block_end" to cover only the first modeled hour makes the model infeasible.
Is there a reason why:

  • units have units_on__temporal_block & unit__investment_temporal_block
  • nodes have node__temporal_block & node__investment_temporal_block
    grafik grafik
    while
  • connections only have the connection__investment_temporal_block relationship?
    grafik

@DillonJ
Copy link
Collaborator

DillonJ commented Nov 3, 2023

I confirm that this is an issue, thanks @tokorte - @manuelma could you please take a look

@manuelma
Copy link
Collaborator

manuelma commented Nov 6, 2023

This seems related to #763 and should be fixed via the latter. I am working on that now and should have a fix relatively soon.

manuelma added a commit that referenced this issue Nov 6, 2023
@manuelma
Copy link
Collaborator

manuelma commented Nov 6, 2023

I have fixed #763 which should also have fixed this.

A little bit of context: So our unit-test for contraint_connection_flow_capacity wasn't updated when we introduced investments in connections which means I was able to break the constraint in a further commit. Sorry about that! Now I have improved the test to check that the constraint is correctly generated for the case where the investments resolution is lower than the operations' resolution. Please reopen if the problem persists.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants