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

WIP: sketch of 2 variants to add commodity flow of capacity variables #387

Closed
wants to merge 34 commits into from

Conversation

volker-krey
Copy link
Contributor

@volker-krey volker-krey commented Aug 19, 2020

The PR sketches two alternative variants that allow connecting a commodity flow to capacity addition and retirement.

  • variant 1: commodity input and output strictly associated with construction and retirement of capacity (commodity flow is strictly triggered in periods when new capacity comes online or is retired, in case of new periods being added, no user action is required)
  • variant 2: commodity input and output associated with operation of capacity at any period (more flexible as commodity flows can also be triggered before construction or after retirement, but requires adjustments by user in case new periods are being added to a model)

Comments on the two variants of adding commodity flow of capacity variables are appreciated.

@GamzeUnlu95
Copy link
Contributor

For variant 2, for the case of retirement, the output value in the year (vintage + lifetime) will specify the material that is released upon retirement. I was wondering with the current formulation, isn't it the case that if the capacity is retired earlier than its lifetime, the material is still going to be released at the end of its lifetime even though it is retired earlier?

@volker-krey
Copy link
Contributor Author

@GamzeUnlu95 good point. The implications of premature retirement for continuous commodity flow could be addressed in variant 2 by switching from the CAP_NEW to the CAP variable (equivalent to fix_cost), but to ensure that end-of-life release of commodities is treated correctly, we either have treat commodity flow beyond the lifetime in a special way or switch to variant 1.

…d of lifetime

- limited variant 2 to inv_tec technologies
- capacity-related commodity flows during lifetime are treated like fix_cost (via CAP variable)
- capacity-related commodity flows prior to or after end of technical lifetime are triggered regardless of premature retirement (via CAP_NEW variable)
- ATTENTION: commodity flows will only be triggered once the technical lifetime is reached, independent of the actual lifetime due to premature retirement
@volker-krey
Copy link
Contributor Author

@GamzeUnlu95 please have a look at the revised formulation of variant 2. This now consistently deals with commodity flows during lifetime, but the issue of commodity flows after end-of-life remains unsolved. The question is whether this is an acceptable error.

@volker-krey
Copy link
Contributor Author

One issue that still needs attention are commodity flows upon capacity retirement if the vintage period (when the capacity was built) has a different length than the retirement period (period after last available of capacity). Since the CAP variables are normalized to annual construction, in such a case, the flow triggered upon retirement can be larger or smaller than intended. For the global model this is relevant in the transition from 5- to 10-year steps after 2060. A rescaling will need to be introduced.

- scaling factor adjusts for difference in length of construction and retirement periods of capacities in related commodity flows
- added missing closing parenthesis to sums in commodity flow
@khaeru
Copy link
Member

khaeru commented Aug 26, 2020

In today's MESSAGE meeting, regarding the new items (sets, variables, equations, and parameters) please look at #190, in particular the additions to message_ix.models.MESSAGE_ITEMS:

# Common indices for some parameters in MESSAGE_ITEMS
_idx_common = ['node', 'technology', 'level', 'commodity', 'year', 'time']
# NB only a partial list; see https://github.com/iiasa/message_ix/issues/254
#: List of ixmp items for MESSAGE.
MESSAGE_ITEMS = {
# Index sets
# Storage level
'level_storage': dict(ix_type='set'),
# Storage reservoir technology
'storage_tec': dict(ix_type='set'),
# Mapping set: mapping of storage reservoir to charger/discharger
'map_tec_storage': dict(ix_type='set',
idx_sets=['node', 'technology', 'storage_tec',
'level', 'commodity']),
# Parameters
# Order of sub-annual time steps
'time_order': dict(ix_type='par', idx_sets=['lvl_temporal', 'time']),
# Initial amount of storage
'storage_initial': dict(ix_type='par', idx_sets=_idx_common),
# Storage losses as a percentage of installed capacity
'storage_self_discharge': dict(ix_type='par', idx_sets=_idx_common),
}

New additions due to this PR should be handled in the same way.

…d of lifetime

- limited variant 2 to inv_tec technologies
- capacity-related commodity flows during lifetime are treated like fix_cost (via CAP variable)
- capacity-related commodity flows prior to or after end of technical lifetime are triggered regardless of premature retirement (via CAP_NEW variable)
- ATTENTION: commodity flows will only be triggered once the technical lifetime is reached, independent of the actual lifetime due to premature retirement
…e retirement

- restricted variant 1 equations to technologies with capacity
- scaling factor adjusts for difference in length of construction and retirement periods of capacities in related commodity flows
- added missing closing parenthesis to sums in commodity flow
volker-krey and others added 14 commits March 16, 2021 16:52
…d of lifetime

- limited variant 2 to inv_tec technologies
- capacity-related commodity flows during lifetime are treated like fix_cost (via CAP variable)
- capacity-related commodity flows prior to or after end of technical lifetime are triggered regardless of premature retirement (via CAP_NEW variable)
- ATTENTION: commodity flows will only be triggered once the technical lifetime is reached, independent of the actual lifetime due to premature retirement
…e retirement

- restricted variant 1 equations to technologies with capacity
- scaling factor adjusts for difference in length of construction and retirement periods of capacities in related commodity flows
- added missing closing parenthesis to sums in commodity flow
- scaling factor adjusts for difference in length of construction and retirement periods of capacities in related commodity flows
- added missing closing parenthesis to sums in commodity flow
@volker-krey volker-krey self-assigned this Mar 22, 2021
@volker-krey volker-krey added the enh New features & functionality label Mar 22, 2021
Copy link
Contributor

@Jihoon Jihoon left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I've tested the functionality of this branch with the main MESSAGEix-Materials model, and it is working as it is expected without generating additional issues.

@Jihoon
Copy link
Contributor

Jihoon commented Mar 31, 2021

This one is now superseded by #451.

@Jihoon Jihoon closed this Mar 31, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enh New features & functionality
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants