Post · 9 min read· pp. 251–257

Dispatch Limits

Each Generator has a dispatch variable gn,s,tg_{n,s,t} where nn labels the bus, ss labels the particular generator at the bus and tt labels the snapshot. Each Link has a dispatch variable fl,tf_{l,t} where ll labels the link and tt labels the snapshot. Each Process has an internal dispatch variable rm,tr_{m,t} where mm labels the process and tt labels the snapshot. Each Line and Transformer has a dispatch variable pl,tp_{l,t} where ll labels the line/transformer and tt labels the snapshot.

Dispatch limits of Store and StorageUnit

Dispatch limits of stores and storage units are described together with their storage consistency equations in the Storage section.

Non-extendable Components

For non-extendable components ({p,s}_nom_extendable=False), the dispatch is limited by:

ConstraintDual VariableName
gn,s,t≥g‾n,s,t⋅g^n,sg_{n,s,t} \geq \underline{g}_{n,s,t} \cdot \hat{g}_{n,s}wtoμ‾n,s,tw_t^o \underline{\mu}_{n,s,t}n.generators_t.mu_lowerGenerator-fix-p-lower
gn,s,t≤gˉn,s,t⋅g^n,sg_{n,s,t} \leq \bar{g}_{n,s,t} \cdot \hat{g}_{n,s}wtoμˉn,s,tw_t^o \bar{\mu}_{n,s,t}n.generators_t.mu_upperGenerator-fix-p-upper
fl,t≥f‾l,t⋅f^lf_{l,t} \geq \underline{f}_{l,t} \cdot \hat{f}_{l}wtoμ‾l,tw_t^o \underline{\mu}_{l,t}n.links_t.mu_lowerLink-fix-p-lower
fl,t≤fˉl,t⋅f^lf_{l,t} \leq \bar{f}_{l,t} \cdot \hat{f}_{l}wtoμˉl,tw_t^o \bar{\mu}_{l,t}n.links_t.mu_upperLink-fix-p-upper
rm,t≥r‾m,t⋅r^mr_{m,t} \geq \underline{r}_{m,t} \cdot \hat{r}_{m}wtoμ‾m,tw_t^o \underline{\mu}_{m,t}n.processes_t.mu_lowerProcess-fix-p-lower
rm,t≤rˉm,t⋅r^mr_{m,t} \leq \bar{r}_{m,t} \cdot \hat{r}_{m}wtoμˉm,tw_t^o \bar{\mu}_{m,t}n.processes_t.mu_upperProcess-fix-p-upper
pl,t≥−pˉl,t⋅p^lp_{l,t} \geq - \bar{p}_{l,t} \cdot \hat{p}_{l}wtoμ‾l,tw_t^o \underline{\mu}_{l,t}n.{lines,transformers}_t.mu_lowerLine-fix-p-lower
pl,t≤pˉl,t⋅p^lp_{l,t} \leq \bar{p}_{l,t} \cdot \hat{p}_{l}wtoμˉl,tw_t^o \bar{\mu}_{l,t}n.{lines,transformers}_t.mu_upperLine-fix-p-upper

where g^n,s\hat{g}_{n,s}, f^l\hat{f}_{l}, r^m\hat{r}_{m}, and p^l\hat{p}_{l} are the nominal capacities; g‾n,s,t\underline{g}_{n,s,t}, f‾l,t\underline{f}_{l,t}, r‾m,t\underline{r}_{m,t}, gˉn,s,t\bar{g}_{n,s,t}, fˉl,t\bar{f}_{l,t}, rˉm,t\bar{r}_{m,t} and pˉl,t\bar{p}_{l,t} are time-dependent restrictions on the dispatch given per unit of nominal capacity (e.g. due to wind availability for generators or dynamic line rating and security margins for lines).

These constraints are set in the function define_operational_constraints_for_non_extendables().

Extendable Components

For extendable components ({p,s}_nom_extendable=True), the dispatch is limited by:

ConstraintDual VariableName
gn,s,t≥g‾n,s,t⋅Gn,sg_{n,s,t} \geq \underline{g}_{n,s,t} \cdot G_{n,s}wtoμ‾n,s,tw_t^o \underline{\mu}_{n,s,t}n.generators_t.mu_lowerGenerator-ext-p-lower
gn,s,t≤gˉn,s,t⋅Gn,sg_{n,s,t} \leq \bar{g}_{n,s,t} \cdot G_{n,s}wtoμˉn,s,tw_t^o \bar{\mu}_{n,s,t}n.generators_t.mu_upperGenerator-ext-p-upper
fl,t≥f‾l,t⋅Flf_{l,t} \geq \underline{f}_{l,t} \cdot F_{l}wtoμ‾l,tw_t^o \underline{\mu}_{l,t}n.links_t.mu_lowerLink-ext-p-lower
fl,t≤fˉl,t⋅Flf_{l,t} \leq \bar{f}_{l,t} \cdot F_{l}wtoμˉl,tw_t^o \bar{\mu}_{l,t}n.links_t.mu_upperLink-ext-p-upper
rm,t≥r‾m,t⋅Rmr_{m,t} \geq \underline{r}_{m,t} \cdot R_{m}wtoμ‾m,tw_t^o \underline{\mu}_{m,t}n.processes_t.mu_lowerProcess-ext-p-lower
rm,t≤rˉm,t⋅Rmr_{m,t} \leq \bar{r}_{m,t} \cdot R_{m}wtoμˉm,tw_t^o \bar{\mu}_{m,t}n.processes_t.mu_upperProcess-ext-p-upper
pl,t≥−pˉl,t⋅Plp_{l,t} \geq - \bar{p}_{l,t} \cdot P_{l}wtoμ‾l,tw_t^o \underline{\mu}_{l,t}n.{lines,transformers}_t.mu_lowerLine-ext-p-lower
pl,t≤pˉl,t⋅Plp_{l,t} \leq \bar{p}_{l,t} \cdot P_{l}wtoμˉl,tw_t^o \bar{\mu}_{l,t}n.{lines,transformers}_t.mu_upperLine-ext-p-upper

where Gn,sG_{n,s}, FlF_{l}, RmR_{m}, and PlP_{l} are the nominal capacities to be optimised.

These constraints are set in the function define_operational_constraints_for_extendables().

Fixed Dispatch

Additionally, the dispatch can be fixed to a certain value g~n,s,t\tilde{g}_{n,s,t} for generators, f~l,t\tilde{f}_{l,t} for links and r~m,t\tilde{r}_{m,t} for processes. In this case, the dispatch is given by:

ConstraintDual VariableName
gn,s,t=g~n,s,tg_{n,s,t} = \tilde{g}_{n,s,t}wtoμ~n,s,tw_t^o \tilde{\mu}_{n,s,t}n.generators_t.mu_p_setGenerator-p_set
fl,t=f~l,tf_{l,t} = \tilde{f}_{l,t}wtoμ~l,tw_t^o \tilde{\mu}_{l,t}n.links_t.mu_p_setLink-p_set
rm,t=r~m,tr_{m,t} = \tilde{r}_{m,t}wtoμ~m,tw_t^o \tilde{\mu}_{m,t}n.processes_t.mu_p_setProcess-p_set

These constraints are set in the function define_fixed_operation_constraints().

Volume Limits

Generators, links, processes and stores can also have volume limits, i.e. the weighted sum of their power over all snapshots must be above a minimum e‾∗\underline{e}_{*} (e_sum_min) or below a maximum eˉ∗\bar{e}_{*} (e_sum_max). The limits apply once over all snapshots. With multiple investment periods, they apply to the total over all periods, and the energy of each period is multiplied by its investment period weighting years, as for operational_limit global constraints.

ConstraintDual VariableName
∑twtggn,s,t≥e‾n,s∀n,s\sum_t w_t^g g_{n,s,t} \geq \underline{e}_{n,s} \quad \forall n,sonly in n.modelGenerator-e_sum_min
∑twtggn,s,t≤eˉn,s∀n,s\sum_t w_t^g g_{n,s,t} \leq \bar{e}_{n,s} \quad \forall n,sonly in n.modelGenerator-e_sum_max
∑twtgfl,t≥e‾l∀l\sum_t w_t^g f_{l,t} \geq \underline{e}_{l} \quad \forall lonly in n.modelLink-e_sum_min
∑twtgfl,t≤eˉl∀l\sum_t w_t^g f_{l,t} \leq \bar{e}_{l} \quad \forall lonly in n.modelLink-e_sum_max
∑twtgrm,t≥e‾m∀m\sum_t w_t^g r_{m,t} \geq \underline{e}_{m} \quad \forall monly in n.modelProcess-e_sum_min
∑twtgrm,t≤eˉm∀m\sum_t w_t^g r_{m,t} \leq \bar{e}_{m} \quad \forall monly in n.modelProcess-e_sum_max
∑twtghn,s,t≥e‾n,s∀n,s\sum_t w_t^g h_{n,s,t} \geq \underline{e}_{n,s} \quad \forall n,sonly in n.modelStore-e_sum_min
∑twtghn,s,t≤eˉn,s∀n,s\sum_t w_t^g h_{n,s,t} \leq \bar{e}_{n,s} \quad \forall n,sonly in n.modelStore-e_sum_max

The limited power has the sign convention of p. For links it is the withdrawal at bus0, and for processes the internal power p. For stores it is the net power, i.e. discharge minus charge (see Storage for the symbol hh). All volume limits use the generator snapshot weightings wtgw_t^g, as n.statistics.energy_balance().

These constraints are set in the function define_total_supply_constraints().

Rolling horizon

In n.optimize.optimize_with_rolling_horizon() the volume limits apply to all snapshots of the rolling horizon. Each window gets the part of the limit left open by previous windows and by what later windows can at most (eˉ\bar{e}) or must at least (e‾\underline{e}) produce given their capacity, p_min_pu and p_max_pu. Committable and maintainable components may produce nothing in later windows, inactive components produce nothing. Without foresight, a maximum is depleted by the earliest windows and a minimum is filled by the latest windows, which may turn the last window infeasible.

Voltage Angle Limits

AC lines and transformers can limit the magnitude of their linearised voltage angle difference to θˉ\bar{\theta} (attribute v_ang_max in degrees). The limit applies symmetrically to both flow directions; the attribute v_ang_min is deprecated and ignored. The limit is imposed as a bound on the flow by dividing through the strictly positive xpu,effx^\text{pu,eff}, and is only added for branches with a finite v_ang_max. Unlike a manual conversion into s_max_pu, this formulation contains no snoms^\text{nom} and therefore stays linear for extendable branches, although the reactance is a fixed parameter in the optimisation (see n.optimize.optimize_transmission_expansion_iteratively()).

For a line the angle difference is θl,t=xlpu,eff pl,t\theta_{l,t} = x^\text{pu,eff}_l \, p_{l,t}. For a transformer it additionally includes the phase shift ϕt,t\phi_{t,t} (either the fixed phase_shift or, when phase_shift_min < phase_shift_max, the optimised phase-shift variable), so θt,t=xtpu,eff pt,t+ϕt,t\theta_{t,t} = x^\text{pu,eff}_t \, p_{t,t} + \phi_{t,t}.

ConstraintName
pl,t≥−θˉl/xlpu,effp_{l,t} \geq -\bar{\theta}_l / x^\text{pu,eff}_lLine-v_ang-lower
pl,t≤θˉl/xlpu,effp_{l,t} \leq \bar{\theta}_l / x^\text{pu,eff}_lLine-v_ang-upper
pt,t+ϕt,t/xtpu,eff≥−θˉt/xtpu,effp_{t,t} + \phi_{t,t} / x^\text{pu,eff}_t \geq -\bar{\theta}_t / x^\text{pu,eff}_tTransformer-v_ang-lower
pt,t+ϕt,t/xtpu,eff≤θˉt/xtpu,effp_{t,t} + \phi_{t,t} / x^\text{pu,eff}_t \leq \bar{\theta}_t / x^\text{pu,eff}_tTransformer-v_ang-upper

These constraints are set in the function define_voltage_angle_constraints(). For background on voltage angle difference limits, see the MATPOWER manual, pages 76-77.

Mapping of symbols to attributes

GeneratorLinkProcessStoreLine

SymbolAttributeType
gn,s,tg_{n,s,t}n.generators_t.pDecision variable
Gn,sG_{n,s}n.generators.p_nom_optDecision variable
g^n,s\hat{g}_{n,s}n.generators.p_nomParameter
g‾n,s,t\underline{g}_{n,s,t}n.generators_t.p_min_puParameter
gˉn,s,t\bar{g}_{n,s,t}n.generators_t.p_max_puParameter
g~n,s,t\tilde{g}_{n,s,t}n.generators_t.p_setParameter
e‾n,s\underline{e}_{n,s}n.generators.e_sum_minParameter
eˉn,s\bar{e}_{n,s}n.generators.e_sum_maxParameter
wtgw_t^gn.snapshots.weightings.generatorsParameter
wtow_t^on.snapshots.weightings.objectiveParameter
SymbolAttributeType
fl,tf_{l,t}n.links_t.pDecision variable
FlF_{l}n.links.p_nom_optDecision variable
f^l\hat{f}_{l}n.links.p_nomParameter
f‾l,t\underline{f}_{l,t}n.links_t.p_min_puParameter
fˉl,t\bar{f}_{l,t}n.links_t.p_max_puParameter
f~l,t\tilde{f}_{l,t}n.links_t.p_setParameter
e‾l\underline{e}_{l}n.links.e_sum_minParameter
eˉl\bar{e}_{l}n.links.e_sum_maxParameter
wtgw_t^gn.snapshots.weightings.generatorsParameter
wtow_t^on.snapshots.weightings.objectiveParameter
SymbolAttributeType
rm,tr_{m,t}n.processes_t.pDecision variable
RmR_{m}n.processes.p_nom_optDecision variable
r^m\hat{r}_{m}n.processes.p_nomParameter
r‾m,t\underline{r}_{m,t}n.processes_t.p_min_puParameter
rˉm,t\bar{r}_{m,t}n.processes_t.p_max_puParameter
r~m,t\tilde{r}_{m,t}n.processes_t.p_setParameter
e‾m\underline{e}_{m}n.processes.e_sum_minParameter
eˉm\bar{e}_{m}n.processes.e_sum_maxParameter
wtgw_t^gn.snapshots.weightings.generatorsParameter
wtow_t^on.snapshots.weightings.objectiveParameter
SymbolAttributeType
hn,s,th_{n,s,t}n.stores_t.pDecision variable
e‾n,s\underline{e}_{n,s}n.stores.e_sum_minParameter
eˉn,s\bar{e}_{n,s}n.stores.e_sum_maxParameter
wtgw_t^gn.snapshots.weightings.generatorsParameter
SymbolAttributeType
pl,tp_{l,t}n.{lines,transformers}_t.p0Decision variable
PlP_{l}n.{lines,transformers}.s_nom_optDecision variable
p^l\hat{p}_ln.{lines,transformers}.s_nomParameter
pˉl,t\bar{p}_{l,t}n.{lines,transformers}_t.s_max_puParameter
wtgw_t^gn.snapshots.weightings.generatorsParameter
wtow_t^on.snapshots.weightings.objectiveParameter

diagram 2026-10-30

diagram 2025-10-09