SpineOpt.jl
SpineOpt.jl copied to clipboard
missing history time indices for units_on variable in constraint_unit_state_transition with representative temporal structure
constraint_unit_state_transition
(and some other similar constraints) needs a units_on
variable with t_before
time slice that could go beyond the variable's time indices at the beginning of a model horizon. With ordinary temporal structures, this missing index will be generated when adding the variable. However, when a representative temporal structure is used, the t_before
at the beginning of a model is missing.
This DB test.zip would reproduce the error.
PR #1015 attempts to fix this. There seem to be 2 directions:
- cut the pair of (t_before, t_after) that contains a "history"
t_before
forconstraint_unit_state_transition
whenunits_on
uses representative temporal blocks - ensure the variable available for the corresponding "history" time indices
This issue could be generic for variables defined by "non-dynamic" time indices and used in constraints defined by "dynamic" time indices (e.g. units_invested
as to constraint_unit_investment_transition
). But fortunately, those other cases seem unlikely for representative temporal blocks.