Conversation
There was a problem hiding this comment.
Pull Request Overview
This PR ensures that emission penalties are no longer applied (or subsidized) when EmissionActivityRatio is negative, preventing a double dividend for negative-emission technologies.
- Constrain
EmissionsPenaltyto be non-negative - Update E5 (and E3) constraints to sum only positive
EmissionActivityRatioentries - Remove non-negativity on emission variables to allow tracking negative emissions
Reviewed Changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
| tests/test_negative_emissions.txt | New test scenario data for negative emissions subsidy behavior |
| src/osemosys_short.txt | Add EmissionsPenalty >=0 and filter E5 sum to >0 ratios |
| src/osemosys_fast.txt | Filter E5 sum to only positive ratios in fast model |
| src/osemosys.txt | Add non-negativity on EmissionsPenalty, allow negative vars, update E5 & E3 sums, clean positivity constraints |
Comments suppressed due to low confidence (5)
src/osemosys.txt:1061
- This filter excludes negative emissions from the AnnualEmissionsResults table; change the condition to 'AnnualEmissions[r, e, y] <> 0' to include negative emission entries.
AnnualEmissions[r, e, y] > 0
src/osemosys.txt:1076
- This filter omits negative emission values in the AnnualTechnologyEmissionResults table; use '<> 0' instead of '> 0' to capture negative emissions.
AnnualTechnologyEmission[r, t, e, y] > 0
src/osemosys.txt:1083
- The table filter here drops negative emission entries; consider using 'AnnualTechnologyEmissionByMode[r, t, e, m, y] <> 0' to include negative values.
AnnualTechnologyEmissionByMode[r, t, e, m, y] > 0
src/osemosys.txt:309
- [nitpick] Consider adding a comment to explain that this variable can be negative to represent negative emissions, improving clarity for future maintainers.
var AnnualTechnologyEmissionByMode{r in REGION, t in TECHNOLOGY, e in EMISSION, m in MODE_OF_OPERATION, y in YEAR};
tests/test_negative_emissions.txt:42
- Add an explicit assertion or expected outcome in this test to verify that DiscountedTechnologyEmissionsPenalty is zero for technologies with negative EmissionActivityRatio.
BB gas_plant CO2 1 2016 -0.516
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 resolves the issue identified in issue #99 by @Timon-R, where an EmissionPenalty acts as a subsidy for negative emission technologies, providing a double-dividend. E.g. the technology receives a benefit once for avoiding positive emissions, and then receives a subsidy for the negative emissions.
Closes #99.