Dispatch Limits
Each Generator has a dispatch variable where labels the bus, labels the particular generator at the bus and labels the snapshot. Each Link has a dispatch variable where labels the link and labels the snapshot. Each Process has an internal dispatch variable where labels the process and labels the snapshot. Each Line and Transformer has a dispatch variable where labels the line/transformer and 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:
| Constraint | Dual Variable | Name | |
|---|---|---|---|
n.generators_t.mu_lower | Generator-fix-p-lower | ||
n.generators_t.mu_upper | Generator-fix-p-upper | ||
n.links_t.mu_lower | Link-fix-p-lower | ||
n.links_t.mu_upper | Link-fix-p-upper | ||
n.processes_t.mu_lower | Process-fix-p-lower | ||
n.processes_t.mu_upper | Process-fix-p-upper | ||
n.{lines,transformers}_t.mu_lower | Line-fix-p-lower | ||
n.{lines,transformers}_t.mu_upper | Line-fix-p-upper |
where , , , and are the nominal capacities; , , , , , and 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:
| Constraint | Dual Variable | Name | |
|---|---|---|---|
n.generators_t.mu_lower | Generator-ext-p-lower | ||
n.generators_t.mu_upper | Generator-ext-p-upper | ||
n.links_t.mu_lower | Link-ext-p-lower | ||
n.links_t.mu_upper | Link-ext-p-upper | ||
n.processes_t.mu_lower | Process-ext-p-lower | ||
n.processes_t.mu_upper | Process-ext-p-upper | ||
n.{lines,transformers}_t.mu_lower | Line-ext-p-lower | ||
n.{lines,transformers}_t.mu_upper | Line-ext-p-upper |
where , , , and 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 for generators, for links and for processes. In this case, the dispatch is given by:
| Constraint | Dual Variable | Name | |
|---|---|---|---|
n.generators_t.mu_p_set | Generator-p_set | ||
n.links_t.mu_p_set | Link-p_set | ||
n.processes_t.mu_p_set | Process-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_sum_min) or below a maximum (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.
| Constraint | Dual Variable | Name |
|---|---|---|
only in n.model | Generator-e_sum_min | |
only in n.model | Generator-e_sum_max | |
only in n.model | Link-e_sum_min | |
only in n.model | Link-e_sum_max | |
only in n.model | Process-e_sum_min | |
only in n.model | Process-e_sum_max | |
only in n.model | Store-e_sum_min | |
only in n.model | Store-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 ). All volume limits use the generator snapshot weightings , 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 () or must at least () 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 (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 , and is only added for branches with a finite v_ang_max. Unlike a manual conversion into s_max_pu, this formulation contains no 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 . For a transformer it additionally includes the phase shift (either the fixed phase_shift or, when phase_shift_min < phase_shift_max, the optimised phase-shift variable), so .
| Constraint | Name |
|---|---|
Line-v_ang-lower | |
Line-v_ang-upper | |
Transformer-v_ang-lower | |
Transformer-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
| Symbol | Attribute | Type |
|---|---|---|
n.generators_t.p | Decision variable | |
n.generators.p_nom_opt | Decision variable | |
n.generators.p_nom | Parameter | |
n.generators_t.p_min_pu | Parameter | |
n.generators_t.p_max_pu | Parameter | |
n.generators_t.p_set | Parameter | |
n.generators.e_sum_min | Parameter | |
n.generators.e_sum_max | Parameter | |
n.snapshots.weightings.generators | Parameter | |
n.snapshots.weightings.objective | Parameter |
| Symbol | Attribute | Type |
|---|---|---|
n.links_t.p | Decision variable | |
n.links.p_nom_opt | Decision variable | |
n.links.p_nom | Parameter | |
n.links_t.p_min_pu | Parameter | |
n.links_t.p_max_pu | Parameter | |
n.links_t.p_set | Parameter | |
n.links.e_sum_min | Parameter | |
n.links.e_sum_max | Parameter | |
n.snapshots.weightings.generators | Parameter | |
n.snapshots.weightings.objective | Parameter |
| Symbol | Attribute | Type |
|---|---|---|
n.processes_t.p | Decision variable | |
n.processes.p_nom_opt | Decision variable | |
n.processes.p_nom | Parameter | |
n.processes_t.p_min_pu | Parameter | |
n.processes_t.p_max_pu | Parameter | |
n.processes_t.p_set | Parameter | |
n.processes.e_sum_min | Parameter | |
n.processes.e_sum_max | Parameter | |
n.snapshots.weightings.generators | Parameter | |
n.snapshots.weightings.objective | Parameter |
| Symbol | Attribute | Type |
|---|---|---|
n.stores_t.p | Decision variable | |
n.stores.e_sum_min | Parameter | |
n.stores.e_sum_max | Parameter | |
n.snapshots.weightings.generators | Parameter |
| Symbol | Attribute | Type |
|---|---|---|
n.{lines,transformers}_t.p0 | Decision variable | |
n.{lines,transformers}.s_nom_opt | Decision variable | |
n.{lines,transformers}.s_nom | Parameter | |
n.{lines,transformers}_t.s_max_pu | Parameter | |
n.snapshots.weightings.generators | Parameter | |
n.snapshots.weightings.objective | Parameter |
2026-10-30
2025-10-09