-
Notifications
You must be signed in to change notification settings - Fork 130
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
avoiding infeasibilities for years defined at c_H2InBuildOnlyAfter #1860
avoiding infeasibilities for years defined at c_H2InBuildOnlyAfter #1860
Conversation
I don't really get the original problem
the way I understand it, so I don't see what you mean with
to my understanding this is exactly the situation we have before the PR? |
apart from this "I don't understand it" - if it makes your runs converge faster, I am totally happy with merging it as the H2-use in buildings is anyway turned off by default at the moment could you add a path to the runs with the new version to the PR? |
I haven’t done the full mathematical derivation to verify this, but my reasoning is that small runtime changes, such as a slight variation in total gas demand, could proportionally affect If this is true, a proportional change in a numerically significant value of In over simplistic terms,
That said, I could be wrong, as I haven't fully checked the math behind this and that this proportionality assumption holds. All of this only makes sense if the real intent behind using the switch
Unfortunately, I haven’t organized these runs because I am jumping back and forth trying to deal with other challenges on the calibration in different folders. Some of the runs should be here: |
Purpose of this PR
Issue:
For years defined at
c_H2InBuildOnlyAfter
, H2 was being forced to be exact zero. However at calibration time,pm_cesdata(t,regi,"feh2b","quantity")
is being set to a value different from zero.This causes infeasibilities in the model, that can be small enough for certain gdxs to be ignored, but in others not. From my runs this is specially hard for the
IND
region in my current tests.Work around:
In this pull request:
pm_cesdata(t,regi,"feh2b","quantity")
at calibration time to a small value for years that `c_H2InBuildOnlyAfter´ is active, so the model is calibrated considering values for H2 in buildings, and at the same time I define an offset exactly equal to the quantity value so the model ignores this "calibration" only value in the final energy production balance.core/bounds.gms
file. @robinhasse This should be adjusted to a lower value if 1e-6 is considered yet too big still for H2 use.Moreover, the entire code block in
Additional hydrogen phase in cost at low H2 penetration levels
has no function at all if H2 is always forced to be zero as it is in the default configuration used right now, and the CES tree branch from hydrogen should be removed if this is the case. To avoid issues with case where historical data is zero for H2 build use, I set theq36_H2Share
equation to be only calculated from 2020 onward.PS: Fixing things to exact zero in the model should be avoided unless you want to completely remove a variable from the solver. In this case you would need to remove also the above mentioned equations and CES tree branch.
Type of change
(Make sure to delete from the Type-of-change list the items not relevant to your PR)
Checklist:
FAIL 0
in the output ofmake test
)