Adapt equity constraint to sector-coupled networks#659
Open
koen-vg wants to merge 8 commits intoPyPSA:masterfrom
Open
Adapt equity constraint to sector-coupled networks#659koen-vg wants to merge 8 commits intoPyPSA:masterfrom
koen-vg wants to merge 8 commits intoPyPSA:masterfrom
Conversation
added 4 commits
May 8, 2023 17:30
For more details, see the new docstring and comments for `add_EQ_constraints`.
6 tasks
Contributor
Author
|
Hi! Any updates on when this might be merged, or what might need to be done in order to get it merged? Do you need me to write tests first? |
Contributor
Author
|
Maybe after I resolve the merge conflicts, this could also be a candidate for v0.12, @fneum? I can do the necessary work to document this a little bit better and also add a configuration option to make this compatible with the new way of handling wildcards, scenarios etc. I still believe this is a valuable feature even if a bit complex; potential caveats will be documented. |
6 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This pull requests updates the equity constraint to include all energy carriers in sector-coupled models. For details on how this is done and which modelling and implementation choices were made, see the docstring and comments in the relevant function.
For example, here are two networks solved with a 30% and 95% country-level equity constraint, respectively:


Note the significant shift of solar investment to Germany, the Netherlands and Belgium in the higher equity network (the lower picture), as well as some smaller regional differences (e.g. Finland/Estonia). (However, these results were produced with a weekly time resolution in order to test quickly, so don't take them too seriously!)
From my testing, the constraint starts to have a significant effect from an equity level of around 70-80%. All in all the results seem reasonable and I think having some level of equity can even be a good "default" or "baseline" for most modelling.
Unfortunately, since there are so many different components in the sector-coupled network, the implementation is on the long side, and I don't think it can be made much smaller. There is also potential for bugs or leaks where some new component is added in future versions and it's forgotten to take it into account in the equity constraint. Even for the current implementation, I tried quite hard to make sure that I caught everything but it would be great if something else could also have a look through it just to have a second pair of eyes.
Maybe it would also be an idea to add an automated test to make sure that this implementation at least keeps running? Checking that the constraint actually works is unfortunately quite a bit of work; about as much as writing the constraint in the first place in fact. But it would also be useful to write a post-processing step which calculates equity levels after the fact and checks that they are within bounds.
I think the only obvious problems with the current implementation are:
I would document this better in the wildcards documentation, but whole sector-coupled network wildcards section of the documentation seems to be under construction. Anyway it's not so clear how to document options that can appear both in
{opts}and{sector_opts}(such as EQ) but might have slightly different behaviour in the different cases.Checklist
envs/environment.yaml.config.default.yaml.doc/configtables/*.csv.doc/release_notes.rstis added.