Aggregate LCOE and NPV over timeslices for objectives#635
Merged
Conversation
8 tasks
dalonsoa
approved these changes
Jan 22, 2025
Collaborator
dalonsoa
left a comment
There was a problem hiding this comment.
Well, it is a bit convoluted, but I don't feel it is a big bottleneck. The key thing is a question of documentation - possibly a separate PR: when LCOE is timeslice-dependent, when it is not and why that is the case.
Collaborator
Author
|
I've added similar changes to NPV/NPC/EAC |
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.
Description
Previously, LCOE was calculated at the timeslice-level for the objectives, and then a max operation was taken over the timeslices, and this was the value taken as the cost of installing one unit of capacity.
It seems nonsensical to take the max, and could prevent a technology from being invested in just because it's expensive in a single timeslice.
Really, we should be calculating the average LCOE across the whole year and using this as the cost metric.
To do this, I've added an
aggregate_timeslicesargument to the LCOE function, which sums timeslice-level costs and production whenTrue, returning a single value for the year (no "timeslice" dimension). This is then what's used for the objectives.Ultimately, this then gets broadcast over the timeslices here, and the same max operation is taken, which gives you back a single value proportional to the original LCOE for the year as a whole.
It's all a bit convoluted, but this seemed like the easiest way to introduce these changes quickly. I think there are bigger changes required to the solver in the future which will require larger refactoring, so there's no point over-optimizing things right now.
Surprisingly, none of the results change at all. Don't know what to make of this, but it still seems like the right thing to do
Fixes #288
Type of change
Key checklist
$ python -m pytest$ python -m sphinx -b html docs docs/buildFurther checks