Repository navigation
Weight unit commitment startups by days each season represents - #387
SutubraResearch wants to merge 1 commit into
Conversation
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info
WalkthroughStartup costs, emissions, and inputs now include the number of days represented by each season. Tests compare these values and the objective for equivalent multi-day and one-day season representations. ChangesStartup accounting
Priority: ➖ Normal Estimated code review effort: 3 (Moderate) | ~20 minutes Change: Bug fix · Severity of issue fixed: Medium Suggested reviewers: Fixed issue severity: Merge Risk: ⚪ Minimal · up to
|
Codecov Report✅ All modified and coverable lines are covered by tests. 📢 Thoughts on this report? Let us know! |
Fixes #386.
What changed
days_in_season(model, s)=segment_fraction_per_season[s] * days_per_periodintemoa/extensions/unit_commitment/components/startup.py.uc_startup_cost_rptv,uc_startup_emissions_rpeanduc_startup_input_rpsdcmultiply starts by it. That covers the objective,limit_emission_constraint,commodity_balance_constraintandannual_commodity_balance_constraint.poll_startup_input_results,poll_emission_results, and the emission cost inpoll_startup_cost_results) does the same, sooutput_flow_in,output_emissionandoutput_costmatch the model.unit_commitment.rstandappend_startup_costs; matching lines for startup emissions and inputs; a note thatoutput_unit_commitmentdescribes one day of each season.The test
tests/test_unit_commitment_starts.pysolves an 8-day period two ways: as two seasons of 2 and 6 days, and as 8 one-day seasons. Both must give 10 MW started, startup cost 30, CO2 50, startup fuel 70 and fuel supply 190; the output costs must sum to the objective, and the two objectives must be equal. Before the fix the multi-day case fails (startup cost 9; objective 784.35 against 1390.48); the one-day case passes before and after. The full suite passes (296); mypy and ruff are clean.What doesn't change
test_weekobjective, starts and startup cost, emissions and inputs are unchanged in all three time-sequencing modes, checked with HiGHS and Gurobi.output_unit_commitment.start_capstays per represented day, alongsideonline_capandstop_cap; multiply it by the season's days for a total.One assumption to note
In
consecutive_daysmode with multi-day seasons, a start between the last hour of one season and the first hour of the next is also multiplied by the season's days. That treats each day of the season as repeated, the same assumption ordinary flows already make.Summary by CodeRabbit