Skip to content

Follow up Geohydro Fix: Round up geo_bin1_add to avoid rounding infeasibility in eq_rsc_INVlim - #245

Merged
Yunzhi-Chen merged 3 commits into
mainfrom
yc/geohydro_debug_followup
Oct 7, 2026
Merged

Yunzhi-Chen merged 3 commits into
mainfrom
yc/geohydro_debug_followup

Conversation

@Yunzhi-Chen

Copy link
Copy Markdown
Contributor

Summary

Follow-up to #94. When prescribed geothermal builds exceed the supply curve, geo_bin1_add tops up bin 1 so it exactly matches the prescribed capacity. e_solveprep.gms then rounds m_rsc_dat to 3 decimals, which can leave bin 1 slightly short (up to 0.0005 MW) and make eq_rsc_INVlim infeasible against eq_forceprescription.

This PR rounds geo_bin1_add up to the nearest MW and adds a 1 MW margin so the rounding can no longer cause a shortfall. The change is identical to 42dbbb7 on mm/converge @mmowers .

Technical details

Issues resolved

Did you use LLM tools (chatbot or copilot) in the preparation of this PR? If so, describe how

Claude Code was used to apply the fix and draft this PR description.

@Yunzhi-Chen Yunzhi-Chen self-assigned this Oct 2, 2026
@Yunzhi-Chen
Yunzhi-Chen requested a review from bsergi October 2, 2026 21:15
@patrickbrown4

Copy link
Copy Markdown
Contributor

Cool, thanks.

Do you know why this problem only comes up for geothermal and not the other supply-curve technologies? Is there a way to handle it more generally?

@Yunzhi-Chen

Copy link
Copy Markdown
Contributor Author

Hi @patrickbrown4. Geothermal is the only RSC technology that has a "geo discovery rate" by year. Since the discovery rate is a fraction less than 1 in early years, the discovered portion of the RSC bin can sometimes be smaller than the prescribed builds and cause infeasibility. So for geohydro we have a treatment that when the prescribed builds are greater than the discovered RSC bin size, we enlarge bin1 to make it exactly match what the discovery rate requires. This causes the problem that further rounding in GAMS (e_solveprep) can cause the previously exactly matching value from b_inputs to be slightly smaller, so it causes infeasibility. This follow-up PR adds 1 MW to the bin1 size to avoid this issue.

Other technologies don't have such a geo discovery rate so they won't have this problem.

@patrickbrown4 patrickbrown4 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Thanks Yunzhi. I checked the Pacific test case and the differences are in the noise:
results-v20261007_mainM0_Pacific,v20261007_geoM0_Pacific.pptx

And the NorthernGrid_South case now works at 365-day resolution, addressing #241:
Image

@Yunzhi-Chen
Yunzhi-Chen merged commit 91f6f12 into main Oct 7, 2026
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants