Skip to content

Conversation

@merfort
Copy link
Contributor

@merfort merfort commented Dec 5, 2025

Purpose of this PR

New Implementation

This PR addresses problems with our representation of 1st generation bioenergy, i.e. ethanol production from sugar/starch crops and biodiesel production from oil crops.

  1. The PE and SE quantities of these technologies need to follow exogenous trajectories that are informed by FAO and IEA data for historical time steps and future projections from the literature, because we don't model development of prices endogenously. However, since quite a while, the bounds, which would fix vm_fuExtr of PE carriers pebios and pebioil to follow these trajectories, had been deactivated for time steps pre-2030 and furthermore early retirement was activated (as these bounds led to infeasibilities). This led to the situation that the quantities were not met at all before 2030. The new implementation reintroduces the bounds with the following principles:
  • In 2005, vm_fuExtr is implicitly determined by historic capacity constraints (vm_deltaCap) on the technologies bioeths and biodiesel, which are derived in 04_PE_FE_parameters and are informed by numbers from the IEA.
  • From 2010 on, vm_fuExtr directly follows the bounds from FAO-based input data for historic years and future projections from the literature (via p30_datapebio, coming from calc1stBioDem). We use FAO data, to be consistent with MAgPIE. However, in some cases this would lead to inconsistencies (and thereby infeasibilities) with the historic IEA technology capacity constraints. To prevent that, the bound is lifted in these cases.
  • By aligning capacity and PE constraints, early retirement is not necessary any more and it is deactivated (again) for bioeths and biodiesel.
  1. Another issue concerns the conversion efficiency from PE to SE. Here, regional values pm_eta_conv had been informed by historic input and output quantities. The calcIO function assumes that input and output for the bioeths and biodiesel technologies are equal (leading to eta=1), i.e. that there is no conversion happening any more. This is actually true for bioeths. Here the assumption is that we already start with the finished product (ethanol), so a conversion efficiency would be 1 correct. However, in generisdata tech, so far a wrong conversion efficiency of 0.55 is given, so all regions will eventually converge to that wrong number (and regions without historic data already start with that wrong value). For biodiesel, we assume that the conversion step from plant oil to biodiesel still has to happen, so a (regional) conversion efficiency of 1 would be wrong (we currently assume a global value of 0.93). To fix the issues, we do the following:
  • We correct the global conversion efficiency for bioths, setting it to 1.00 (for biodiesel it is kept at 0.93).
  • We now always use global values for the efficiency of bioeths and biodiesel, bypassing the (partially) wrong values from calcIO (for bioeths it does not make a difference anyways, but to be transparent, it is better to directly use one global number, as it clearly shows that the technology, by design, does not do any real conversion)

Impact on results

You find the runs here:
/p/tmp/merfort/REMIND_bugfix_1stgen/remind_update_bounds/output
The new runs are those with fixBound_etas1 in the title.
A compare scenarios PDF is here:
/p/tmp/merfort/REMIND_bugfix_1stgen/remind_update_bounds/compScen-old_vs_new_eta1-2025-12-16_22.29.19-H12.pdf

Production of sugar and starch crops

  • Red/Green: old default runs (NPi/PkBudg650)
  • Blue/Orange: new default runs (NPi/PkBudg650)
image

As can be seen, following the FAO bounds again lifts production in basically al regions. Thus, before the model was deploying less PE from sugar/starch than it should have. T

Production of oil crops

  • Red/Green: old default runs (NPi/PkBudg650)
  • Blue/Orange: new default runs (NPi/PkBudg650)
image

Following the FAO bounds removes the spike in 2020/2025 in oil crop production.

SE Liquids from Biomass

  • Red/Green: old default runs (NPi/PkBudg650)
  • Blue/Orange: new default runs (NPi/PkBudg650)
image

The higher PE quantities and the increased conversion efficiency increase the amount of SE liquids from biomass quite a bit in some regions.

SE Liquids prices

  • Red/Green: old default runs (NPi/PkBudg650)
  • Blue/Orange: new default runs (NPi/PkBudg650)
image Forcing the model to follow historic demands leads to a price spike in liquids from biomass in `OAS` in 2020 and also to higher historic prices in `MEA`. This is related to `q_shbiofe_lo` that forces a certain share of bioenergy at FE level. We live with this for now, since quantities in `OAS` are very low anyways and neither FE prices in `OAS` nor global SE bioliquid prices are affected. This will be taken up in a follow-up task (see discussion below).

Bound relaxation works

The black dashed line shows the original bound on vm_fuExtr as it comes from p30_datapebio, i.e. from FAO/literature. For pebios the bound is now relaxed to match historic capacities, e.g. in CAZ, IND, or LAM:
vm_fuExtr_pebios

For pebioil historic capacities don't violate that bound, so there is no relaxation necessary:
vm_fuExtr_pebioil

Next steps

  • The bounds on historic values of vm_fuExtr from FAO and particularly the literature-based future projections need to be updated and re-aligned with more up-to-date projections, i.e. calc1stBioDem needs a rework.
  • The bioeths technology needs a rework. Apparently, it so far assumed that the conversion from the sugar/starch crop to ethanol still has to happen. But since we already start with the "ready to use" feedstok ethanol, probably the techno-economic assumptions are wrong. Given that quantities are fully exogenous, thought, this issue should not affect the dynamics.

Type of change

Indicate the items relevant for your PR by replacing ◻️ with ☑️.
Do not delete any lines. This makes it easier to understand which areas are affected by your changes and which are not.

Parts concerned

  • ☑️ GAMS Code
  • ◻️ R-scripts
  • ☑️ Documentation (GAMS incode documentation, comments, tutorials)
  • ◻️ Input data / CES parameters
  • ◻️ Tests, CI/CD (continuous integration/deployment)
  • ☑️ Configuration (switches in main.gms, default.cfg, and scenario_config*.csv files)
  • ◻️ Other (please give a description)

Impact

  • ☑️ Bug fix
  • ◻️ Refactoring
  • ◻️ New feature
  • ☑️ Change of parameter values or input data (including CES parameters)
  • ☑️ Minor change (default scenarios show only small differences)
  • ◻️ Fundamental change of results of default scenarios

Checklist

Do not delete any line. Leave unfinished elements unchecked so others know how far along you are.
In the end all checkboxes must be ticked before you can merge
.

  • I executed the automated model tests (make test) after my final commit and all tests pass (FAIL 0)
  • I adjusted the reporting in remind2 if and where it was needed
  • I adjusted the madrat packages (mrremind and other packages involved) for input data generation if and where it was needed
  • My code follows the coding etiquette
  • I explained my changes within the PR, particularly in hard-to-understand areas
  • I checked that the in-code documentation is up-to-date
  • I adjusted forbiddenColumnNames in readCheckScenarioConfig.R in case the PR leads to deprecated switches
  • I updated the CHANGELOG.md correctly (added, changed, fixed, removed, input data/calibration)

Further information (optional)

  • Runs with these changes are here:
  • Comparison of results (what changes by this PR?):

@merfort merfort requested a review from dklein-pik December 5, 2025 10:45
@merfort merfort self-assigned this Dec 5, 2025
@merfort
Copy link
Contributor Author

merfort commented Dec 5, 2025

@robertsalzwedel just FYI

Copy link
Contributor

@dklein-pik dklein-pik left a comment

Choose a reason for hiding this comment

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

Very cool! Thank you for digging so deep and for explaining your changes so detailed.

@robertpietzcker
Copy link
Contributor

Dear Leon @merfort , thanks a lot for this well-described PR!
Could you please add the path to the runs and the compScen, so that I can check if the SE liquids price reaction seems reasonable or not?

@merfort
Copy link
Contributor Author

merfort commented Dec 9, 2025

Dear Leon @merfort , thanks a lot for this well-described PR! Could you please add the path to the runs and the compScen, so that I can check if the SE liquids price reaction seems reasonable or not?

Ah, good point! You find the runs here (I also updated the PR description):
/p/tmp/merfort/REMIND_bugfix_1stgen/remind_update_bounds/output
The new runs are those with fixBound in the title (SSP2-NPi2025_fixBound_2025-12-04_14.07.18, SSP2-PkBudg650_fixBound_2025-12-04_17.36.16 and SSP2-NPi2025_fixBound_PO_2025-12-04_17.54.18).
A compare scenarios PDF is here:
/p/tmp/merfort/REMIND_bugfix_1stgen/remind_update_bounds/compScen-NPi_PkBudg650-original_correctedBound_correctedBound2030PO-2025-12-05_10.08.40-H12.pdf

@merfort merfort requested a review from dklein-pik December 10, 2025 15:03
Copy link
Contributor

@dklein-pik dklein-pik left a comment

Choose a reason for hiding this comment

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

Perfect, thank you!

@robertpietzcker
Copy link
Contributor

robertpietzcker commented Dec 11, 2025

Forcing the model to follow historic demands increases prices for liquids from biomass before 2025 quite a lot. Given the rather low quantities of bioliquids, the impact on FE prices is very low, though. And maybe a recalibration solves this?

I agree that the overall price impact is small, I am just wondering why these price spikes appear at all - this shouldn't be the case.
I fear that for some reason there is some small mismatch between the depreciation of existing capacities and the bounds set, that requires the model to bend in some weird way to make things match.

if I look at the /p/tmp/merfort/REMIND_bugfix_1stgen/remind_update_bounds/output/SSP2-NPi2025_fixBound_2025-12-04_14.07.18 run, I see the following:

dumpgdx fulldata.gdx vm_fuExtr "20[1,2,3][0,5],LAM,pebios"
2010  LAM  pebios  5  L   0.0185911451356046
2010  LAM  pebios  5  M   -0.131720338040421
2010  LAM  pebios  5  LO  0.0185911451356046
2010  LAM  pebios  5  UP  0.018970556260821
2015  LAM  pebios  5  L   0.020799539865573
2015  LAM  pebios  5  M   0.543226886328053
2015  LAM  pebios  5  LO  0.0203835490682615
2015  LAM  pebios  5  UP  0.020799539865573
2020  LAM  pebios  5  L   0.035560060003818
2020  LAM  pebios  5  M   0.299039008053505
2020  LAM  pebios  5  LO  0.0348488588037416
2020  LAM  pebios  5  UP  0.035560060003818
2025  LAM  pebios  5  L   0.0445786917837417
2025  LAM  pebios  5  M   -0.0374553686382938
2025  LAM  pebios  5  LO  0.0445786917837417
2025  LAM  pebios  5  UP  0.045488461003818
2030  LAM  pebios  5  L   0.0543085247637417
2030  LAM  pebios  5  M   -0.0372776780389261
2030  LAM  pebios  5  LO  0.0543085247637417
2030  LAM  pebios  5  UP  0.055416862003818
2035  LAM  pebios  5  L   0.0543085247637417
2035  LAM  pebios  5  M   -0.018589810019169
2035  LAM  pebios  5  LO  0.0543085247637417
2035  LAM  pebios  5  UP  0.055416862003818

so the model is stuck on the upper bound in 2015/2020, and then on the lower bound in the following time steps.

but there is no reason why the model would be willing to pay 70$/GJ in 2015 for liquid biomass - FE demand prices are in the range of 20-30 $/GJ.

....

ahhhh - I get it. we put a bound on shares of biomass in FE demands according to IEA. This bound has high marginals in 2015 in the new version:

dumpgdx fulldata.gdx q_shbiofe_lo "20[1,2,3][0,5],LAM,fe[p,d].*M"
2010  LAM  fepet  trans  ES     M  0.0101613231687804
2010  LAM  fedie  trans  other  M  0.00662078194551938
2010  LAM  fedie  trans  ES     M  0.0101559209097442
2015  LAM  fepet  trans  ES     M  1.0382971078868
2015  LAM  fedie  trans  other  M  1.0383945902435
2015  LAM  fedie  trans  ES     M  1.03485951105267
2020  LAM  fepet  trans  ES     M  0.726510959899241
2020  LAM  fedie  trans  other  M  0.730185647301342
2020  LAM  fedie  trans  ES     M  0.730185489239453

I guess because before, the efficiency was at 1, so even though now the fuel extraction is higher, the model is more squeezed because it produces less bioliuids with this.

@robertpietzcker
Copy link
Contributor

so unless there is an important reason why being a bit too high on the pebios/pebioil side would be problematic, I would propose to relax the upper bound by +10%-15% instead of +1% over the original FAO values. I guess I would trust the IEA FE values more than the FAO PE values :-)

I would hope in such a run the price spikes would disappear, @merfort

@merfort
Copy link
Contributor Author

merfort commented Dec 16, 2025

Ok, an unexpected turn of events: In a meeting with Kristine and Misko we realized that the input of the 1st gen bio-ethanol technology is already given in quantities of ethanol, so the vm_fuExtr quantities are not given in quantities of sugar/starch crops. I.e., we basically (have to) assume that the conversion has already happened, (MAgPIE already does that). Thus, as long as we rely on the input from calc1stBioDem in its current form, we have to set our conversion efficiency to 1 (currently it is at 0.55).

If I do this, we obviously need much lower PE quantities to generate the same amount of SE. This mitigates the impact on fuel prices quite a bit. However, particularly the 2020 spike in OAS is still there:
image

The green line, which hides behind orange, shows the results for setting eta to 1. Since orange and green have virtually the same prices, it becomes clear that relaxing the bound by 10% (as done in the orange and the blue scenarios) is not enough. I would suggest to set eta to 1 now and then merge the PR, accepting the price spike for now, given that it does neither affect global SE prices, nor regional (OAS) FE prices due to the relatively low biofuel quantities in OAS. In the meantime Kristine is working on reworking calc1stBioDem to better reflect recent updates, which will then hopefully eventually remove the spikes. @robertpietzcker ok?
Here is the latest compareScenarios:
/p/tmp/merfort/REMIND_bugfix_1stgen/remind_update_bounds/compScen-NPi2025_fixedBound-varyEta-varyBound-2025-12-16_09.13.15-H12.pdf

@robertpietzcker
Copy link
Contributor

Indeed, an interesting turn of events :-)
good that this came up when digging into it - Thanks for your efforts!

And yes, the proposal is fine with me!

@merfort
Copy link
Contributor Author

merfort commented Dec 16, 2025

@dklein-pik @robertsalzwedel FYI :)

@merfort merfort merged commit cd8d478 into remindmodel:develop Dec 17, 2025
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants