flexmeasures
flexmeasures copied to clipboard
Support extra validation rules in `validate_storage_constraints`
Following up PR #680, It would be interesting to support extra validation rules in the function validate_storage_constraints
(here), that expand case C from covering 1 step towards covering 1, 2, 3, ..., x, ..., n steps, where n is the number of steps in the scheduling horizon. For example, C.1) for x=2 would become something like:
"equals(t) - equals(t-2) <= (derivative_max(t) + derivative_max(t-1)) * factor_w_wh(t)"
And generally, for x (but this probably still needs some love to get correctly parsed):
"equals(t) - equals(t-x) <= sum(derivative_max(t-k) for k in range(x)) * factor_w_wh(t)"
Perhaps, it would be convenient to have create a difference operator to $diff_{x}[f(t)]$ = $f(t) - f(t-x)$ (syntax TBD).
Continuing from https://github.com/FlexMeasures/flexmeasures/pull/680#discussion_r1209424770:
When $e(t)$ and $e(t-2)$ are given, but no $e(t-1)$ is given, then the validation for $e(t) - e(t-2)$ is not already covered by the joint validation for $e(t) - e(t-1)$ and $e(t-1) - e(t-2)$.
We'll also need to update the SoC constraint validation by accounting for storage efficiency, since #679.