SpineOpt.jl
SpineOpt.jl copied to clipboard
Invalid formulations when a pair of conneted `unit` and `node` use different stochastic/temporal structures
For a (unit, node) pair connected with a unit__node
relationship, if one assigns a dedicated stochastic structure to either of its elements in units_on__stochastic_structure
or node__stochastic_structure
, the resulted variable units_on
is stemmed to be 0 and so is the variable unit_flow
.
The problem arises from the separation of the constraints on the two variables due to the different stochastic structures. unit_flow
follows the stochastic structure of its associated node. And its capacity constraint needs units_on
with the same stochastic structure, which would otherwise bind the unit_flow
to 0. Likewise, a units_on
would be 0 unless there exists a unit_flow
with the same stochastic structure to represent the demand from a node
in the capacity constraint that links both.
What we would like to have for such a discrepancy? To allow flexibility in this regard, there needs some communication between the related variables taking different stochastic structures.
The issue could be reproduced with this database: sample_sto_structure.zip
Similar issues appear in the rolling forward mode with multiple temporal blocks, which were mentioned in issue #633.
In the case where the rolling window uses 2 or more consecutive temporal blocks to define its temporal structure, unit_flow
and 'units_onwould work only if the associated
unitand
node` share the same temporal block in each temporal section. The issue could be more complicated. Hope this database sample_temp_structure.zip could illustrate that.
The system contains a unit unitB
and a node nodeB
. The model rolls 1h per solve with a temporal span of 2h. This 2h solving window consists of a "realise" temporal block followed by a "lookahead" temporal block, with which the available temporal block option for the model is designed as:
name | span | model default |
---|---|---|
realise |
0h-1h | yes |
lookahead |
1h-2h | yes |
realise_dedicated |
0h-1h | no |
lookahead_dedicated |
1h-2h | no |
Performances of unit_flow
and units_on
for all cases are summarised in the table below. The * cases of the big trouble. The term "effective" means the variable present a value as expected.
case | model entity | 0h-1h | 1h-2h | unit_flow behaviour |
units_on behaviour |
---|---|---|---|---|---|
1 | unitB |
realise |
lookahead |
effective over full horizon | effective over full horizon |
nodeB |
realise |
lookahead |
|||
2 | unitB |
realise_dedicated |
lookahead_dedicated |
effective over full horizon | effective over full horizon |
nodeB |
realise_dedicated |
lookahead_dedicated |
|||
3 | unitB |
realise |
lookahead |
effective over full horizon | effective over full horizon |
nodeB |
realise_dedicated |
lookahead_dedicated |
|||
4 | unitB |
realise_dedicated |
lookahead_dedicated |
effective over full horizon | effective over full horizon |
nodeB |
realise |
lookahead |
|||
5* | unitB |
realise |
lookahead_dedicated |
deactivated (appears as 0 only at the last window) | deactivated (appears as 0 only at the last window) |
nodeB |
realise |
lookahead_dedicated |
|||
6 | unitB |
realise_dedicated |
lookahead |
effective but missing the last window | effective over full horizon |
nodeB |
realise_dedicated |
lookahead |
|||
7* | unitB |
realise |
lookahead_dedicated |
appears as 0 over full horizon except for the last window being effective | deactivated (appears as 0 only at the last window) |
nodeB |
realise |
lookahead |
|||
8* | unitB |
realise |
lookahead |
deactivated (appears as 0 only at the last window) | appears as 0 over full horizon |
nodeB |
realise |
lookahead_dedicated |
|||
9 | unitB |
realise_dedicated |
lookahead_dedicated |
effective but missing the last window | effective but appears as 0 at the last window |
nodeB |
realise_dedicated |
lookahead |
|||
10 | unitB |
realise_dedicated |
lookahead |
effective but appears as 0 at the last window | effective over full horizon |
nodeB |
realise_dedicated |
lookahead_dedicated |
|||
11* | unitB |
realise |
lookahead_dedicated |
same as in 7 | same as in 7 |
nodeB |
realise_dedicated |
lookahead_dedicated |
|||
12* | unitB |
realise_dedicated |
lookahead_dedicated |
same as in 8 | same as in 8 |
nodeB |
realise |
lookahead_dedicated |
|||
13 | unitB |
realise |
lookahead |
same as in 9 | same as in 9 |
nodeB |
realise_dedicated |
lookahead |
|||
14 | unitB |
realise_dedicated |
lookahead same as in 10 |
same as in 10 | |
nodeB |
realise |
lookahead |
|||
15* | unitB |
realise |
lookahead_dedicated |
appears as 0 over full horizon | deactivated (appears as 0 only at the last window) |
nodeB |
realise_dedicated |
lookahead |
|||
16* | unitB |
realise_dedicated |
lookahead |
same as in 8 | same as in 8 |
nodeB |
realise |
lookahead_dedicated |