Skip to content

Commit

Permalink
add-pst-range-decrease-documentation (#68)
Browse files Browse the repository at this point in the history
* add doc

* add more precise link to linear problem schema

* some corrections

---------

Co-authored-by: Peter Mitri <peter.mitri@rte-france.com>
  • Loading branch information
MartinBelthle and pet-mit authored Jun 5, 2023
1 parent 7c71ca5 commit 8ea143f
Show file tree
Hide file tree
Showing 3 changed files with 69 additions and 19 deletions.
63 changes: 45 additions & 18 deletions pages/docs/castor/linear-problem/core-problem-filler.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,30 +15,32 @@ see-also: |

## Used input data {#input-data}

| Name | Symbol | Details |
|---|---|---|
| FlowCnecs | $$c \in \mathcal{C}$$ | set of FlowCnecs. Note that FlowCnecs are all the CBCO for which we compute the flow in the MILP, either: <br> - because we are optimizing their flow (optimized flowCnec = CNEC) <br> - because we are monitoring their flow, and ensuring it does not exceed its threshold (monitored flowCnec = MNEC) <br> - or both |
| RangeActions | $$r,s \in \mathcal{RA}$$ | set of RangeActions and state on which they are applied, could be PSTs, HVDCs, or injection range actions |
| RangeActions | $$r \in \mathcal{RA(s)}$$ | set of RangeActions available on state $$s$$, could be PSTs, HVDCs, or injection range actions |
| ReferenceFlow | $$f_{n}(c)$$ | reference flow, for FlowCnec $$c$$. <br>The reference flow is the flow at the beginning of the current iteration of the MILP, around which the sensitivities are computed |
| PrePerimeterSetpoints | $$\alpha _0(r)$$ | setpoint of RangeAction $$r$$ at the beginning of the optimization |
| ReferenceSetpoints | $$\alpha _n(r)$$ | setpoint of RangeAction $$r$$ at the beginning of the current iteration of the MILP, around which the sensitivities are computed |
| Sensitivities | $$\sigma _{n}(r,c,s)$$ | sensitivity of RangeAction $$r$$ on FlowCnec $$c$$ for state $$s$$ |
| Name | Symbol | Details |
|-----------------------|---------------------------|-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| FlowCnecs | $$c \in \mathcal{C}$$ | set of FlowCnecs. Note that FlowCnecs are all the CBCO for which we compute the flow in the MILP, either: <br> - because we are optimizing their flow (optimized flowCnec = CNEC) <br> - because we are monitoring their flow, and ensuring it does not exceed its threshold (monitored flowCnec = MNEC) <br> - or both |
| RangeActions | $$r,s \in \mathcal{RA}$$ | set of RangeActions and state on which they are applied, could be PSTs, HVDCs, or injection range actions |
| RangeActions | $$r \in \mathcal{RA(s)}$$ | set of RangeActions available on state $$s$$, could be PSTs, HVDCs, or injection range actions |
| Iteration number | $$n$$ | number of current iteration |
| ReferenceFlow | $$f_{n}(c)$$ | reference flow, for FlowCnec $$c$$. <br>The reference flow is the flow at the beginning of the current iteration of the MILP, around which the sensitivities are computed |
| PrePerimeterSetpoints | $$\alpha _0(r)$$ | setpoint of RangeAction $$r$$ at the beginning of the optimization |
| ReferenceSetpoints | $$\alpha _n(r)$$ | setpoint of RangeAction $$r$$ at the beginning of the current iteration of the MILP, around which the sensitivities are computed |
| Sensitivities | $$\sigma _{n}(r,c,s)$$ | sensitivity of RangeAction $$r$$ on FlowCnec $$c$$ for state $$s$$ |
| Previous RA setpoint | $$A_{n-1}(r,s)$$ | optimal setpoint of RangeAction $$r$$ on state $$s$$ in previous iteration ($$n-1$$) |

## Used parameters {#parameters}

| Name | Symbol | Details | Source |
|---|---|---|---|
| sensitivityThreshold | | Set to zero the sensitivities of RangeActions below this threshold; thus avoiding the activation of RangeActions which have too small an impact on the flows (can also be achieved with penaltyCost). This simplifies & speeds up the resolution of the optimization problem (can be necessary when the problem contains integer variables). However, it also adds an approximation in the computation of the flows within the MILP, which can be tricky to handle when the MILP contains hard constraints on loop-flows or monitored FlowCnecs. | Equal to [pst-sensitivity-threshold](/docs/parameters#pst-sensitivity-threshold) for PSTs, [hvdc-sensitivity-threshold](/docs/parameters#hvdc-sensitivity-threshold) for HVDCs, and [injection-ra-sensitivity-threshold](/docs/parameters#injection-ra-sensitivity-threshold) for injection range actions |
| penaltyCost | $$c^{penalty}_{ra}$$ | Supposedly a small penalization, in the use of the RangeActions. When several solutions are equivalent, this favours the one with the least change in the RangeActions' setpoints (compared to the initial situation). It also avoids the activation of RangeActions which have to small an impact on the objective function. | Equal to [pst-penalty-cost](/docs/parameters#pst-penalty-cost) for PSTs, [hvdc-penalty-cost](/docs/parameters#hvdc-penalty-cost) for HVDCs, and [injection-ra-penalty-cost](/docs/parameters#injection-ra-penalty-cost) for injection range actions |
| Name | Symbol | Details | Source |
|----------------------|----------------------|--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| sensitivityThreshold | | Set to zero the sensitivities of RangeActions below this threshold; thus avoiding the activation of RangeActions which have too small an impact on the flows (can also be achieved with penaltyCost). This simplifies & speeds up the resolution of the optimization problem (can be necessary when the problem contains integer variables). However, it also adds an approximation in the computation of the flows within the MILP, which can be tricky to handle when the MILP contains hard constraints on loop-flows or monitored FlowCnecs. | Equal to [pst-sensitivity-threshold](/docs/parameters#pst-sensitivity-threshold) for PSTs, [hvdc-sensitivity-threshold](/docs/parameters#hvdc-sensitivity-threshold) for HVDCs, and [injection-ra-sensitivity-threshold](/docs/parameters#injection-ra-sensitivity-threshold) for injection range actions |
| penaltyCost | $$c^{penalty}_{ra}$$ | Supposedly a small penalization, in the use of the RangeActions. When several solutions are equivalent, this favours the one with the least change in the RangeActions' setpoints (compared to the initial situation). It also avoids the activation of RangeActions which have to small an impact on the objective function. | Equal to [pst-penalty-cost](/docs/parameters#pst-penalty-cost) for PSTs, [hvdc-penalty-cost](/docs/parameters#hvdc-penalty-cost) for HVDCs, and [injection-ra-penalty-cost](/docs/parameters#injection-ra-penalty-cost) for injection range actions |

## Defined optimization variables {#defined-variables}

| Name | Symbol | Details | Type | Index | Unit | Lower bound | Upper bound |
|---|---|---|---|---|---|---|---|
| Flow | $$F(c)$$ | flow of FlowCnec $$c$$ | Real value | One variable for every element of (FlowCnecs) | MW | $$-\infty$$ | $$+\infty$$ |
| RA setpoint | $$A(r,s)$$ | setpoint of RangeAction $$r$$ on state $$s$$| Real value | One variable for every element of (RangeActions) | Degrees for PST range actions; MW for other range actions | Range lower bound[^1] | Range upper bound[^1] |
| RA setpoint absolute variation | $$\Delta A(r,s)$$ | The absolute setpoint variation of RangeAction $$r$$ on state $$s$$, from setpoint on previous state to "RA setpoint" | Real positive value | One variable for every element of (RangeActions) | Degrees for PST range actions; MW for other range actions | 0 | $$+\infty$$ |
| Name | Symbol | Details | Type | Index | Unit | Lower bound | Upper bound |
|--------------------------------|-------------------|-----------------------------------------------------------------------------------------------------------------------|---------------------|--------------------------------------------------|-----------------------------------------------------------|-----------------------|-----------------------|
| Flow | $$F(c)$$ | flow of FlowCnec $$c$$ | Real value | One variable for every element of (FlowCnecs) | MW | $$-\infty$$ | $$+\infty$$ |
| RA setpoint | $$A(r,s)$$ | setpoint of RangeAction $$r$$ on state $$s$$ | Real value | One variable for every element of (RangeActions) | Degrees for PST range actions; MW for other range actions | Range lower bound[^1] | Range upper bound[^1] |
| RA setpoint absolute variation | $$\Delta A(r,s)$$ | The absolute setpoint variation of RangeAction $$r$$ on state $$s$$, from setpoint on previous state to "RA setpoint" | Real positive value | One variable for every element of (RangeActions) | Degrees for PST range actions; MW for other range actions | 0 | $$+\infty$$ |

[^1]: Range actions' lower & upper bounds are computed using CRAC + network + previous RAO results, depending on the
types of their ranges: ABSOLUTE, RELATIVE_TO_INITIAL_NETWORK, RELATIVE_TO_PREVIOUS_INSTANT (more information [here](/docs/input-data/crac/json#range-actions))
Expand Down Expand Up @@ -76,6 +78,31 @@ with $$A(r,s')$$ the setpoint of the last range action on the same element as $$

<br>

### Shrinking the allowed range {#ra-range-shrinking}
If parameter [ra-range-shrinking](/docs/parameters#ra-range-shrinking) is enabled, the allowed range for range actions
is shrunk after each iteration according to the following constraints:

$$
\begin{equation}
t = UB(A(r,s)) - LB(A(r,s))
\end{equation}
$$

$$
\begin{equation}
A(r,s) \geq A_{n-1}(r,s) - (\frac{2}{3})^{n}*t
\end{equation}
$$

$$
\begin{equation}
A(r,s) \leq A_{n-1}(r,s) + (\frac{2}{3})^{n}*t
\end{equation}
$$

The value $$\frac{2}{3}$$ has been chosen to force the linear problem convergence while allowing the RA to go
back to its initial solution if needed.


## Contribution to the objective function {#objective-function}

Expand Down
2 changes: 1 addition & 1 deletion pages/docs/castor/linear-problem/linear-rao.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ The main inputs of the algorithm are:

The linear RAO result is provided, containing the optimal setpoints of the range actions.

### Algorithm
### Algorithm {#algorithm}

Let’s take the example of a PST to clarify how linear remedial actions are optimised.
PST optimisation relies on 3 types of computations:
Expand Down
23 changes: 23 additions & 0 deletions pages/docs/parameters/parameters.md
Original file line number Diff line number Diff line change
Expand Up @@ -183,6 +183,29 @@ These parameters (range-actions-optimization) tune the [linear optimiser](/docs/
considered equal to zero by the linear optimisation problem.
The perks are the same as the two parameters above.

### ra-range-shrinking {#ra-range-shrinking}
- **Expected value**: one of the following:
- "DISABLED"
- "ENABLED"
- "ENABLED_IN_FIRST_PRAO_AND_CRAO"
- **Default value**: "DISABLED"
- **Usage**: CASTOR makes the approximation that range action sensitivities on CNECs are linear. However, in
active+reactive computations, this approximation may be incorrect. The linear problem can thus find a worse solution
than in its previous iteration.
- **DISABLED**: if this situation occurs, the linear problem stops and returns the previous solution,
see this schema : [Linear Remedial Actions Optimisation](/docs/engine/ra-optimisation/linear-rao#algorithm).
- **ENABLED**: this introduces two new behaviors to the iterating linear optimiser:
1. If the linear problem finds a solution worse than in its previous iteration, it continues iterating.
When stop condition is met ([max-mip-iterations](#max-mip-iterations) reached, or two successive iterations have
the same optimal RA set-points), then the problem returns the best solution it has found.
2. At each new iteration, the range action's allowed range shrinks according to equations [described here](/docs/castor/linear-optimisation-problem/core-problem-filler#ra-range-shrinking).
These equations have been chosen to force the linear problem convergence while allowing the RA to go
back to its initial solution if needed.
- **ENABLED_IN_FIRST_PRAO_AND_CRAO**:
same as **ENABLED** but only for first preventive and curative RAO. This parameter value has been introduced because
sensitivity computations in the second preventive RAO can be slow (due to the larger optimization perimeter), thus
computation time loss may outweigh the gains of RA range shrinking.

### linear-optimization-solver {#linear-optimization-solver}
These are parameters that tune the solver used to solve the MIP problem.

Expand Down

0 comments on commit 8ea143f

Please sign in to comment.