Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix/rhs hydro power constraint #2034

Open
wants to merge 10 commits into
base: develop
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 8 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
44 changes: 24 additions & 20 deletions docs/reference-guide/08-miscellaneous.md
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ of area $u$ in the definition of the monthly and daily primary hydro generation
The hydro storage energy monthly and weekly profiles of each zone $z$ do not depend at all on the local
demand and must-run generation in $z$
- $L_{z.}^+$ Time-series of "net" load for zone $z$, defined as: $L{z.}^+ = L{z.} - M{z.}$
- $L_{z.}$ Time-series of "weighted" load for zone $z$, defined as:_ $L_{z.} = A^t L_{z.}^+$
- $L_{z.}$ Time-series of "weighted" load for zone $z$, defined as: $L_{z.} = A^t L_{z.}^+$

<ins>All following parameters are related to the generic zone $z$:</ins>

Expand All @@ -103,9 +103,9 @@ of area $u$ in the definition of the monthly and daily primary hydro generation

- $S$ Reservoir size

- $\overline{S_d}$ Reservoir maximum level at the end of day d, expressed as a fraction of $S$ (rule curve)
- $\overline{S_d}$ Reservoir maximum level at the end of day d (rule curve)

- $\underline{S_d}$ Reservoir minimum level at the end of day d, expressed as a fraction of $S$ (rule curve)
- $\underline{S_d}$ Reservoir minimum level at the end of day d (rule curve)

- $S_0$ Reservoir initial level at the beginning of the first day of the "hydro-year"

Expand All @@ -130,16 +130,16 @@ of area $u$ in the definition of the monthly and daily primary hydro generation

Following variables and parameters are local to linear optimization problems $M$ &amp; $D(m)$
solved within the heuristic. For the sake of clarity, the same generic index is used for all time steps,
knowing that in $M$ there are 12 monthly time-steps, while in $D(m)t$ there are from 28 to 31 daily
knowing that in $M$ there are 12 monthly time-steps, while in $D(m)$ there are from 28 to 31 daily
time-steps. Costs $\gamma_{Var}$ given to these variables are chosen to enforce a logical hierarchy
of penalties (letting the reservoir overflow is worse than violating rule curves, which is worse than deviating
from the generation objective assessed in stage 1, etc.)

- $Y$ Generation deficit at the end of the period, as compared to the objective aimed at
- $W$ Generation deficit at the end of the period, as compared to the objective aimed at (positive varaible)

- $O_t$ Overflow from the reservoir on time step $t$
- $O_t$ Overflow from the reservoir on time step $t$ (positive varaible)

- $G_t, \overline{G_t}$ Optimal generation and maximum generation on time step $t$
- $G_t, \overline{G_t}, \underline{G_t}$ Optimal generation, maximum and minimum generation on time step $t$

- $T_t$ Generation objective assessed in the first stage, for time step t ( $W_m^1$ or $W_d^1$)

Expand All @@ -151,9 +151,9 @@ from the generation objective assessed in stage 1, etc.)

- $\Delta$ Maximum deviation throughout the period

- $V_t^+$ Amplitude of the violation of the upper rule curve at time step $t$
- $V_t^+$ Amplitude of the violation of the upper rule curve at time step $t$ (positive variable)

- $V_t^-$ Amplitude of the violation of the lower rule curve at time step $t$
- $V_t^-$ Amplitude of the violation of the lower rule curve at time step $t$ (positive variable)

- $Y$ Maximum violation of lower rule curve throughout the period

Expand All @@ -173,17 +173,20 @@ $$else: \text{for } m\in [1, 12]: \{W_m^1 \leftarrow I_m\}$$

_M2:_

$$\text{for } m\in [1, 12]: W_m^2 \leftarrow \text{Solution of linear problem M}$$
$$if (\mu) : \text{for } m\in [1, 12]: W_m^2 \leftarrow \text{Solution of linear problem M}$$

$$else : W_m^2 \leftarrow W_m^1$$

_D1:_

$$if (j): \text{for } d\in [1, 31]: W_d^1 \leftarrow \frac{L_d^{\beta}. (W_m^2)}{(\sum_{d\in m}{L_d^{\beta}})}$$

$$else: \text{for } d\in [1, 31]: W_d^1 \leftarrow \frac{I_d . (W_m^2)} {(\sum_{d\in m}{I_d})}$$
$$else: \text{for } d\in [1, 31]: W_d^1 \leftarrow I_d $$

_D2:_

$$\text{for } m \in [1, 12]: W_{d\in m}^2 \leftarrow \text{Solution of linear problem D(m)}$$
$$if(\mu) : \text{for } m \in [1, 12]: W_{d\in m}^2 \leftarrow \text{Solution of linear problem D(m)}$$
$ else : \text{for } m \in [1, 12]: W_{d\in m}^2 \leftarrow$ Solution of a simplified version of linear problem $D(m)$ without reservoir levels

_End_

Expand All @@ -202,9 +205,9 @@ $$S_t \geq 0$$

$$S_t \leq S$$

$S_t + G_t - S_{t-1} = I_t$ (see note [^monthly_allocation])
$G_t \geq \underline{G_t} $ and $G_t \leq \overline{G_t} $

$$\sum_{t}{G_t} = \sum_{t}{T_t}$$
For $t\in [1,12], S_{t} + G_{t} - S_{t-1} = I_{t}$ (see note [^monthly_allocation]) and $S_{12} = S_{0}.$

$$G_t - D_t \leq T_t$$

Expand All @@ -216,27 +219,28 @@ $$V_t^+ - S_t \geq -\overline{S_t}$$

$$Y - V_t^- \geq 0$$

$$\Delta - D_t \geq 0$$

**Optimization problems $D(m)$**

$$\min_{G_t, S_t, ...}{\gamma_{\Delta}\Delta + \gamma_Y Y + \sum_{t}{(\gamma_D D_t + \gamma_{V-} V_t^- + \gamma_{O} O_t + \gamma_S S_t)}}$$
$$\min_{G_t, S_t, ...}{\gamma_{\Delta}\Delta + \gamma_Y Y + \gamma_{W}W+ \sum_{t}{(\gamma_D D_t + \gamma_{V-} V_t^- + \gamma_{O} O_t + \gamma_S S_t)}}$$
s.t

$$S_t \geq 0$$

$$S_t \leq S$$

$$G_t \geq 0$$
$$G_t \geq \underline{G_t}$$

$$G_t \leq \overline{G_t}$$

$S_t + G_t + O_t - S_{t-1} = I_t$ (see note [^daily_allocation])
$S_t + G_t + O_t - S_{t-1} = I_t$ (see note [^daily_allocation]) (initial level of the period is either $S_0$ if $m=1$ or the final level found in solving $D(m-1)$)

$\sum_{t}{G_t + Y} = \sum_{t}{T_t} + Y_{m-1}$ (value of Y previously found in solving **$D(m-1)$**)
$\sum_{t}{G_t + W} = \sum_{t}{T_t} + W_{m-1}$ (0 if $m=1$ else value of $W$ previously found in solving **$D(m-1)$**)

$$G_t - D_t \leq T_t$$
$$G_t - D_t \leq T_t + \frac{W_{m-1}}{|d \in m|}$$

$$G_t + D_t \geq T_t$$
$$G_t + D_t \geq T_t + \frac{W_{m-1}}{|d \in m|}$$

$$\Delta - D_t \geq 0$$

Expand Down
3 changes: 1 addition & 2 deletions src/solver/hydro/management/daily.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -496,8 +496,7 @@ inline void HydroManagement::prepareDailyOptimalGenerations(Solver::Variable::St
for (uint day = firstDay; day != endDay; ++day)
{
ventilationResults.HydrauliqueModulableQuotidien[day]
= problem.Turbine[dayMonth] * reservoirCapacity;

= problem.Turbine[dayMonth] * reservoirCapacity + problem.overflows[dayMonth] * reservoirCapacity;
ventilationResults.NiveauxReservoirsFinJours[day] = problem.niveauxFinJours[dayMonth];

if (debugData)
Expand Down
7 changes: 5 additions & 2 deletions src/solver/simulation/sim_calcul_economique.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -792,8 +792,11 @@ void SIM_RenseignementProblemeHebdo(const Study& study,
marginGen = weekGenerationTarget;

if (problem.CaracteristiquesHydrauliques[k].NiveauInitialReservoir
< weekTarget_tmp)
marginGen = problem.CaracteristiquesHydrauliques[k].NiveauInitialReservoir;
< weekTarget_tmp){
marginGen = weekGenerationTarget;
}

// Je pense qu'ici, il faudrait plutôt vérifier si le niveau initial plus les apports sont suffisants pour atteindre la cible. Mais je pense aussi que cette condition est toujours remplie grâce à l'heuristique.
flomnes marked this conversation as resolved.
Show resolved Hide resolved
}

if (not problem.CaracteristiquesHydrauliques[k].TurbinageEntreBornes)
Expand Down
Loading