Identify fossil generation by emission rate, not by operating cost - #167
Merged
Conversation
erikfilias
force-pushed
the
fix/fossil-share-by-emission-rate
branch
from
August 30, 2026 11:35
7700503 to
6f72c22
Compare
The fossil-fuel share summed generation over mTEPES.tr, which collects every unit with a non-zero rated operating cost. That is a fair proxy for dispatchable but not a test for fuel: any unit carrying variable O&M falls into it. On a European case with 1,716 units, 1,524 of them qualify, including wind, solar, nuclear, hydro, biomass, geothermal, batteries and demand-side management, which overstates the ratio several fold. The set structure has no notion of fuel. It classifies by cost, storage and rated power. But the model already has a test for whether a unit emits, and uses it in two places: the area emission cap in eMaxSystemEmission, and pIndEmissionArea in the objective, both keyed on pEmissionRate. This makes the KPI consistent with them rather than introducing a new idea. The comparison is against zero rather than truthiness because pEmissionRate is declared over the reals, so a unit with negative emissions would otherwise be counted as fossil. A case may leave CO2EmissionRate unpopulated. Four of the shipped cases do, and three of those have coal, gas and oil units, so a bare emission-rate test would report them as zero per cent fossil, which reads as a decarbonised system rather than as missing data. Where no unit carries a positive rate the ratio is reported as NaN and a warning names the column to populate. Closes #163.
erikfilias
force-pushed
the
fix/fossil-share-by-emission-rate
branch
from
August 30, 2026 11:57
6f72c22 to
c327d3e
Compare
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.
Fixes #163.
Change
Ratio Fossil Fuel Generation/Total Generation [%]summed generation overmTEPES.tr, which isevery unit with a non-zero rated operating cost — a fair proxy for dispatchable, but not a test for
fuel. This sums over units with a positive CO2 emission rate instead.
Choice of test
The generator taxonomy classifies by operating cost, storage and rated power, and has no notion of
fuel. The model does already have a test for whether a unit emits, used by
eMaxSystemEmissionandby
pIndEmissionAreain the objective, both keyed onpEmissionRate. This makes the KPI consistentwith them rather than adding a fourth way to classify a unit.
The comparison is
> 0.0rather than truthiness becausepEmissionRateis declaredwithin=Reals,so a unit with negative emissions would otherwise count as fossil.
Cases with no emission data
CO2EmissionRateis optional and four of the ten shipped cases leave it blank, three of them withCoal, Gas and Oil units. A bare emission-rate test reports 0 % fossil there, which reads as a
decarbonised system rather than as missing data. Where no unit carries a positive rate the ratio is
reported as
NaN, with a warning naming the column to populate.Operating cost is the original behaviour and misclassifies wind, solar, nuclear, hydro and storage.
The technology label is unreliable across datasets — the same plant appears as
Gas,CCGTandGas_CCGT_w/o CCSin three shipped cases.Effect
On a 1,716-unit European case,
trcontains 1,524 units, and the reported ratio was 36.41 %where the technology balance from the same solve gives roughly 7 %. After the change the
numerator matches the coal, gas and oil total from
oT_Result_BalanceEnergyPerTechexactly. Fulltest suite passes, 106 tests including the solve cases.
psntrappears once in the file; the only other uses oftrareeMinUpTimeandeMinDownTime,where "carries a variable cost" is a defensible stand-in for a committable unit. Separately, and not
addressed here, the denominator includes storage discharge — energy already counted when generated,
about 2.5 % of the denominator on that case.