Fix eq_rsc_INVlim infeasibility for geohydro_allkm by not applying geo_discovery to exogenous capacity#94
Draft
Yunzhi-Chen wants to merge 4 commits into
Draft
Fix eq_rsc_INVlim infeasibility for geohydro_allkm by not applying geo_discovery to exogenous capacity#94Yunzhi-Chen wants to merge 4 commits into
Yunzhi-Chen wants to merge 4 commits into
Conversation
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.
Summary
Fix
eq_rsc_INVliminfeasibility forgeohydro_allkm(and other techs that usersc_capacity_scalar) by reformulating the constraint so thatrsc_capacity_scalaris applied only to the undiscovered portion of the supply curve (m_rsc_dat - capacity_exog_rsc), rather than to the fullm_rsc_dat. Existing pre-start-year exogenous capacity is treated as already discovered.Previously the equation took the form:
For
geohydro_allkm,rsc_capacity_scalarequalsgeo_discovery(a fraction <1 in early years). When the exogenous (already-built) capacity in a bin happened to exceedm_rsc_dat * geo_discovery, the RHS became larger than the LHS and the constraint became infeasible together witheq_forceprescription_power. This was observed at p35023 in 2015 forgeohydro_allkm_9 bin1(RHS negative by ~0.447 MW) when running a county-level Western Interconnect case.The reformulated equation is:
The physical interpretation: the supply available for new investment is the total resource minus what is already built; of that remaining resource, only fraction
geo_discoveryis currently discovered and therefore eligible for newINV_RSC. Existing exogenous plants are "discovered by definition" and do not need a discovery factor applied to them.For non-scalar techs (
rsc_capacity_scalar_i(i) = no), the multiplier collapses to 1 and the equation is unchanged, so behavior is preserved for all non-geothermal techs.Technical details
Implementation notes
Two synchronized changes:
reeds/core/setup/c_model.gms--eq_rsc_INVlim: subtract thecapacity_exog_rscsum fromm_rsc_datinside thersc_capacity_scalargroup on the LHS, and remove the standalonecapacity_exog_rscterm from the RHS.reeds/core/solve/3_solve_oneyear.gms--rhs_eq_rsc_INVlimpre-solve calculation: mirror the equation. Use the general(1$[not rsc_capacity_scalar_i(i)] + rsc_capacity_scalar(i,r,t)$rsc_capacity_scalar_i(i))factor instead of the previousgeo_hydro-specific branch (1$[not geo_hydro(i)] + geo_discovery(i,r,t)$geo_hydro(i)). This is equivalent becausersc_capacity_scalarforgeo_hydroalready equalsgeo_discovery, and removes a special-case branch.The pre-solve RHS calculation must mirror the equation exactly so the
flag_eq_rsc_INVlimnear-zero detection logic continues to work correctly.Issues resolved
Closes #84 --
eq_rsc_INVliminfeasibility forgeohydro_allkmwhen exogenous capacity exceedsm_rsc_dat * geo_discovery.Validation, testing, and comparison report(s)
Checklist for author
Details to double-check
General information to guide review
Did you use LLM tools (chatbot or copilot) in the preparation of this PR? If so, describe how
Used GitHub Copilot to commit the fix suggested by @wesleyjcole and draft this PR description.
Tag points of contact here if you would like additional review of the relevant parts of the model