SpineOpt.jl icon indicating copy to clipboard operation
SpineOpt.jl copied to clipboard

missing history time indices for units_on variable in constraint_unit_state_transition with representative temporal structure

Open nnhjy opened this issue 9 months ago • 1 comments

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:

  1. cut the pair of (t_before, t_after) that contains a "history" t_before for constraint_unit_state_transition when units_on uses representative temporal blocks
  2. 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.

nnhjy avatar May 22 '24 16:05 nnhjy