Fix eq_rsc_INVlim infeasibility for geohydro_allkm by not applying geo_discovery to exogenous capacity - #94
Open
Yunzhi-Chen wants to merge 16 commits into
Open
Fix eq_rsc_INVlim infeasibility for geohydro_allkm by not applying geo_discovery to exogenous capacity#94Yunzhi-Chen wants to merge 16 commits into
Yunzhi-Chen wants to merge 16 commits into
Conversation
wesleyjcole
approved these changes
Jun 16, 2026
wesleyjcole
left a comment
Contributor
There was a problem hiding this comment.
This looks good. If Max says we can remove the evmc(i) piece, I think it can be removed entirely, either here or in a separate PR.
Because it has a pcat change, would you coordinate with An on her startyear PR (#12) before merging this in?
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
eq_rsc_INVlimpreviously scaled the entire supply curve byrsc_capacity_scalarbut subtracted exogenous capacity at full value:This PR revises the constraint to:
This implements Solution D from #84. Existing exogenous capacity is treated as already discovered, so the discovery rate applies only to the remaining resource available for new investment. Technologies without a capacity scalar use a multiplier of 1, making the revised formulation algebraically equivalent for those technologies.
The current
main-branch preprocessing added by @atpham88 addresses the prescribed-build infeasibility primarily through Solution C, settinggeo_discoveryto 1 when the available resource is insufficient, with Solution A as a fallback that adds resource to bin 1.This PR instead resolves the underlying supply-curve accounting through Solution D while retaining a narrower Solution A-style safeguard for prescribed builds. The safeguard adds only the positive bin-1 resource shortfall needed to keep cumulative prescribed builds feasible.
Technical details
Prescribed hydrothermal builds now retain their valid discovery trajectories rather than having
geo_discoveryoverridden to 1 when the resource falls short.The preprocessing in
reeds/core/setup/b_inputs.gmscalculates the resource required to support the year-specific cumulative prescriptions under the applicable discovery factor, net of existing capacity:Only a positive shortfall is added to bin 1. This is an A-style feasibility safeguard, but it is limited to the amount needed for prescribed builds and does not replace the discovery trajectory.
Implementation notes
reeds/core/setup/c_model.gms— subtracts first-year exogenous capacity fromm_rsc_datbefore applyingrsc_capacity_scalar, and removes the exogenous-capacity term from the investment side ofeq_rsc_INVlim.reeds/core/solve/3_solve_oneyear.gms— updates therhs_eq_rsc_INVlimpresolve calculation to match the revised equation. It also uses the genericrsc_capacity_scalarinstead of the geothermal-specificgeo_discovery; previously, the presolve RHS did not match the model equation for technologies with a non-geothermal capacity scalar.reeds/core/setup/b_inputs.gms— preserves valid geothermal discovery trajectories and calculates any prescribed-build bin-1 top-up using year-specific cumulative prescriptions and discovery factors, net of existing capacity.docs/source/model_documentation.md— documents the treatment of existing capacity and prescribed builds.Issues resolved
Closes #84.
Validation, testing, and comparison report(s)
Comparison reports against
main:The comparison results show increased geothermal capacity and generation under the revised formulation. System-cost NPV decreases slightly because the less restrictive geothermal constraint allows the model to select additional geothermal resources.
The Western Interconnection runs were capped at one iteration because a separate issue prevents the stress-period solve from converging.
Checklist for author
Details to double-check
General information to guide review
exog_rscis otherwise limited toonswindandupv, which do not have a capacity scalar and are algebraically unaffected.Did you use LLM tools (chatbot or copilot) in the preparation of this PR? If so, describe how
GitHub Copilot implemented the initial fix and drafted the original description. Codex refined the prescribed-build logic and revised the PR description. Claude Code reviewed the diff against
mainand provided feedback on the description.