Update docs

m2m
Alinson S. Xavier 2 years ago
parent 12cf9d4b7b
commit 4e8c281713

@ -1,40 +1,103 @@
# Problem definition # Problem definition
The **Security-Constrained Unit Commitment Problem** (SCUC) is a two-stage stochastic mixed-integer linear optimization problem that aims to find the minimum-cost schedule for electricity generation while satisfying various physical, operational and economic constraints. In its most basic form, the problem is composed by: The **Security-Constrained Unit Commitment Problem** (SCUC) is formulated in
UC.jl as a two-stage stochastic mixed-integer linear optimization problem that
aims to find the minimum-cost schedule for electricity generation while
satisfying various physical, operational and economic constraints. In its most
basic form, the problem is composed by:
- A set of generators, which produce power, at a given cost; - A set of generators, which produce power, at a given cost;
- A set of loads, which consume power; - A set of loads, which consume power;
- A transmission network, which delivers power from generators to the loads. - A transmission network, which delivers power from generators to the loads.
In addition to the basic components above, modern versions of SCUC also include a wide variety of additional components, such as _energy storage devices_, _reserves_ and _network interfaces_, to name a few. On this page, we present a complete definition of the problem as it is formulated in UC.jl. Please note that various souces in the literature may have different definitions and assumptions. In addition to the basic components above, SCUC also include a wide variety of
additional components, such as _energy storage devices_, _reserves_ and _network
interfaces_, to name a few. On this page, we present a complete definition of
the problem, as modeled in UC.jl. Please note that different sources in the
literature may have significantly different definitions and assumptions.
!!! note
UC.jl treats deterministic SCUC instances as a special case of the stochastic problem in which there is only one scenario, named `"s1"` by default. To access second-stage decisions, therefore, you must provide this scenario name as the value for `s`. For example, `model[:prod_above]["s1", g, t]`.
!!! warning !!! warning
The problem definition presented below is mathematically equivalent to the one solved by UC.jl, but the actual constraints enforced in the JuMP optimization model may be different, for performance reasons. For example, in this page we show only simplified ramping constraints, whereas the default UC.jl formulation uses a complex set of inequalities which better describes the convex hull, leading to better performance. For the actual constraints enforced in the model, we refer to the source code and references. The problem definition presented in this page is mathematically equivalent to the one solved by UC.jl. However, some constraints (ramping, piecewise-linear costs and start-up costs) have been simplified in this page for clarity. The set of constraints actually enforced by UC.jl better describes the convex hull of the problem and leads to better computational performance, but it is much more complex to describe. For further details, we refer to the package's source code and associated references.
## 1. General modeling assumptions ## 1. General modeling assumptions
- **Time discretization:** SCUC is a multi-period problem, with decisions typically covering a 24-hour or 36-hour time window. UC.jl assumes that this time window is discretized into time steps of fixed length. The number of time steps, as well as the duration of each time step, are configurable. In the equations below, the set of time steps is denoted by $T=\{1,2,\ldots,|T|\}$. - **Time discretization:** SCUC is a multi-period problem, with decisions
typically covering a 24-hour or 36-hour time window. UC.jl assumes that this
time window is discretized into time steps of fixed length. The number of time
steps, as well as the duration of each time step, are configurable. In the
equations below, the set of time steps is denoted by $T=\{1,2,\ldots,|T|\}$.
- **Decision under uncertainty:** SCUC is a two-stage stochastic problem. In the first stage, we must decide the _commitment status_ of all thermal generators. In the second stage, we determine the remaining decision variables, such power output of all generators, the operation of energy storage devices and load shedding. Stochasticity is modeled through a discrete number of scenarios $s \in S$, each with given probability $p(S)$. The goal is to minimize the minimum expected cost. The deterministic version of SCUC can be modeled by assuming a single scenario with probability 1. - **Decision under uncertainty:** SCUC is a two-stage stochastic problem. In the
first stage, we must decide the _commitment status_ of all thermal generators.
In the second stage, we determine the remaining decision variables, such power
output of all generators, the operation of energy storage devices and load
shedding. Stochasticity is modeled through a discrete number of scenarios
$s \in S$, each with given probability $p(S)$. The goal is to minimize the
minimum expected cost.
## 2. Thermal generators ## 2. Thermal generators
A _thermal generator_ is a power generation unit that converts thermal energy, typically from the combustion of coal, natural gas or oil, into electrical energy. Scheduling thermal generators is particularly complex due to their operational characteristics, including minimum up and down times, ramping rates, and start-up and shutdown limits. A _thermal generator_ is a power generation unit that converts thermal energy,
typically from the combustion of coal, natural gas or oil, into electrical
energy. Scheduling thermal generators is particularly complex due to their
operational characteristics, including minimum up and down times, ramping rates,
and start-up and shutdown limits.
### Important concepts ### Important concepts
- **Commitment, power output and startup costs:** Thermal generators can either be operational (on) or offline (off). When a thermal generator is on, it can produce between a minimum and a maximum amount of power; when it is off, it cannot produce any power. Switching a generator on incurs a startup cost, which depends on how long the unit has been offline. More precisely, each thermal generator $g$ has a number $K^{start}_g$ of startup categories (e.g., cold, warm and hot). Each category $k$ has a corresponding startup cost $Z^{\text{start}}_{gk}$, and is available only if the unit has spent at most $M^{\text{delay}}_{gk}$ time steps offline. - **Commitment, power output and startup costs:** Thermal generators can either
be online (on) or offline (off). When a thermal generator is on, it can
- **Piecewise-linear production cost curve:** Besides startup costs, thermal generators also incur production costs based on their power output. The relationship between production cost and power output is not a linear, but a convex curve, which is simplified using a piecewise-linear approximation. For this purpose, each thermal generator $g$ has a number $K^{\text{cost}}_g$ of piecewise-linear segments and its power output $y^{\text{prod-above}}_{gts}$ are broken down into $\sum_{k=1}^{K^{\text{cost}}_g} y^{\text{seg-prod}}_{gtks}$, so that production costs can be more easily calculated. produce between a minimum and a maximum amount of power; when it is off, it
cannot produce any power. Switching a generator on incurs a startup cost,
- **Ramping, minimum up/down:** Due to physical and operational limits, such as thermal inertia and mechanical stress, thermal generators cannot vary their power output too dramatically from one time period to the next. Similarly, thermal generators cannot switch on and off too frequently; after switching on or off, units must remain at that state for a minimum specified number of time steps. which depends on how long the unit has been offline. More precisely, each
thermal generator $g$ has a number $K^{start}_g$ of startup categories (e.g.,
- **Startup and shutdown limit:** A thermal generator cannot shut off if its output power level in the imediately preceeding time step is very high (above a specified value); the unit must first ramp down, over potentially multiple time steps, and only then shut off. Similarly, the unit cannot produce a very large amount of power (above a specified limit) imediately after starting up; it must ramp up over potentially multiple time steps. cold, warm and hot). Each category $k$ has a corresponding startup cost
$Z^{\text{start}}_{gk}$, and is available only if the unit has spent at most
- **Initial status:** The optimization process finds optimal commitment status and power output level for all thermal generators starting at time period 1. Many constraints, however, require knowledge of previous time periods (0, -1, -2, ...) which are not part of the optimization model. For this reason, part of the input data is the initial power output $M^{\text{init-power}}_{g}$ of unit $g$ (that is, the output at time 0) and the initial status $M^{\text{init-status}}_{g}$ of unit g (how many time steps has it been online/offline at time time 0). If $M^{\text{init-status}}_{g}$ is positive, its magnitude indicates how many time periods has the unit been online; and if negative, how has it been offline. $M^{\text{delay}}_{gk}$ time steps offline.
- **Must-run:** Due to various factors, including reliability considerations, some units must remain operational regardless of whether it is economical for them to do so. Must-run constraints are used to enforce such requirements. - **Piecewise-linear production cost curve:** Besides startup costs, thermal
generators also incur production costs based on their power output. The
relationship between production cost and power output is not a linear, but a
convex curve, which is simplified using a piecewise-linear approximation. For
this purpose, each thermal generator $g$ has a number $K^{\text{cost}}_g$ of
piecewise-linear segments and its power output $y^{\text{prod-above}}_{gts}$
are broken down into
$\sum_{k=1}^{K^{\text{cost}}_g} y^{\text{seg-prod}}_{gtks}$, so that
production costs can be more easily calculated.
- **Ramping, minimum up/down:** Due to physical and operational limits, such as
thermal inertia and mechanical stress, thermal generators cannot vary their
power output too dramatically from one time period to the next. Similarly,
thermal generators cannot switch on and off too frequently; after switching on
or off, units must remain at that state for a minimum specified number of time
steps.
- **Startup and shutdown limit:** A thermal generator cannot shut off if its
output power level in the immediately preceding time step is very high (above
a specified value); the unit must first ramp down, over potentially multiple
time steps, and only then shut off. Similarly, the unit cannot produce a very
large amount of power (above a specified limit) immediately after starting up;
it must ramp up over potentially multiple time steps.
- **Initial status:** The optimization process finds optimal commitment status
and power output level for all thermal generators starting at time period 1.
Many constraints, however, require knowledge of previous time periods (0, -1,
-2, ...) which are not part of the optimization model. For this reason, part
of the input data is the initial power output $M^{\text{init-power}}_{g}$ of
unit $g$ (that is, the output at time 0) and the initial status
$M^{\text{init-status}}_{g}$ of unit g (how many time steps has it been
online/offline at time time 0). If $M^{\text{init-status}}_{g}$ is positive,
its magnitude indicates how many time periods has the unit been online; and if
negative, how has it been offline.
- **Must-run:** Due to various factors, including reliability considerations,
some units must remain operational regardless of whether it is economical for
them to do so. Must-run constraints are used to enforce such requirements.
### Sets and constants ### Sets and constants
@ -58,6 +121,7 @@ A _thermal generator_ is a power generation unit that converts thermal energy, t
| $Z^{\text{pmin}}_{gt}$ | \$ | Cost to keep $g$ operational at time $t$ generating at minimum power. | | $Z^{\text{pmin}}_{gt}$ | \$ | Cost to keep $g$ operational at time $t$ generating at minimum power. |
| $Z^{\text{pvar}}_{gtks}$ | \$/MW | Cost for unit $g$ to produce 1 MW of power under piecewise-linear segment $k$ at time $t$. | | $Z^{\text{pvar}}_{gtks}$ | \$/MW | Cost for unit $g$ to produce 1 MW of power under piecewise-linear segment $k$ at time $t$. |
| $Z^{\text{start}}_{gk}$ | \$ | Cost to start unit $g$ at startup category $k$. | | $Z^{\text{start}}_{gk}$ | \$ | Cost to start unit $g$ at startup category $k$. |
| $G^\text{therm}$ | | Set of thermal generators. |
### Decision variables ### Decision variables
@ -76,9 +140,9 @@ A _thermal generator_ is a power generation unit that converts thermal energy, t
- Production costs: - Production costs:
```math ```math
\sum_{g \in G} \sum_{t \in T} x^{\text{is-on}}_{gt} Z^{\text{pmin}}_{gt} \sum_{g \in G^\text{therm}} \sum_{t \in T} x^{\text{is-on}}_{gt} Z^{\text{pmin}}_{gt}
+ \sum_{s \in S} p(s) \left[ + \sum_{s \in S} p(s) \left[
\sum_{g \in G} \sum_{t \in T} \sum_{k=1}^{K^{cost}_g} \sum_{g \in G^\text{therm}} \sum_{t \in T} \sum_{k=1}^{K^{cost}_g}
y^{\text{seg-prod}}_{gtks} Z^{\text{pvar}}_{gtks} y^{\text{seg-prod}}_{gtks} Z^{\text{pvar}}_{gtks}
\right] \right]
``` ```
@ -97,7 +161,8 @@ A _thermal generator_ is a power generation unit that converts thermal energy, t
x^{\text{is-on}}_{gt} \geq M^{\text{must-run}}_{gt} x^{\text{is-on}}_{gt} \geq M^{\text{must-run}}_{gt}
``` ```
- After switching on, unit must remain on for some amount of time (`eq_min_uptime[g,t]`): - After switching on, unit must remain on for some amount of time
(`eq_min_uptime[g,t]`):
```math ```math
\sum_{i=max(1,t-M^{\text{min-up}}_{g}+1)}^t x^{\text{switch-on}}_{gi} \leq x^{\text{is-on}}_{gt} \sum_{i=max(1,t-M^{\text{min-up}}_{g}+1)}^t x^{\text{switch-on}}_{gi} \leq x^{\text{is-on}}_{gt}
@ -109,7 +174,8 @@ x^{\text{is-on}}_{gt} \geq M^{\text{must-run}}_{gt}
\sum_{i=1}^{min(T,M^{\text{min-up}}_{g}-M^{\text{init-status}}_{g})} x^{\text{switch-off}}_{gi} = 0 \; \text{ if } \; M^{\text{init-status}}_{g} > 0 \sum_{i=1}^{min(T,M^{\text{min-up}}_{g}-M^{\text{init-status}}_{g})} x^{\text{switch-off}}_{gi} = 0 \; \text{ if } \; M^{\text{init-status}}_{g} > 0
``` ```
- After switching off, unit must remain offline for some amount of time (`eq_min_downtime[g,t]`): - After switching off, unit must remain offline for some amount of time
(`eq_min_downtime[g,t]`):
```math ```math
\sum_{i=max(1,t-M^{\text{min-down}}_{g}+1)}^t x^{\text{switch-off}}_{gi} \leq 1 - x^{\text{is-on}}_{gt} \sum_{i=max(1,t-M^{\text{min-down}}_{g}+1)}^t x^{\text{switch-off}}_{gi} \leq 1 - x^{\text{is-on}}_{gt}
@ -121,15 +187,17 @@ x^{\text{is-on}}_{gt} \geq M^{\text{must-run}}_{gt}
\sum_{i=1}^{min(T,M^{\text{min-down}}_{g}+M^{\text{init-status}}_{g})} x^{\text{switch-on}}_{gi} = 0 \; \text{ if } \; M^{\text{init-status}}_{g} < 0 \sum_{i=1}^{min(T,M^{\text{min-down}}_{g}+M^{\text{init-status}}_{g})} x^{\text{switch-on}}_{gi} = 0 \; \text{ if } \; M^{\text{init-status}}_{g} < 0
``` ```
- If the unit switches on, it must choose exactly one startup category (`eq_startup_choose[g,t]`): - If the unit switches on, it must choose exactly one startup category
(`eq_startup_choose[g,t]`):
```math ```math
x^{\text{switch-on}}_{gt} = \sum_{k=1}^{K^{start}_g} x^{\text{start}}_{gtk} x^{\text{switch-on}}_{gt} = \sum_{k=1}^{K^{start}_g} x^{\text{start}}_{gtk}
``` ```
- If unit has not switched off in the last "delay" time periods, then startup category is forbidden (`eq_startup_restrict[g,t,s]`). - If unit has not switched off in the last "delay" time periods, then startup
The last startup category is always allowed. category is forbidden (`eq_startup_restrict[g,t,s]`). The last startup
In the equation below, $L^{\text{start}}_{gtk}=1$ if category should be allowed based on initial status. category is always allowed. In the equation below, $L^{\text{start}}_{gtk}=1$
if category should be allowed based on initial status.
```math ```math
x^{\text{start}}_{gtk} \leq L^{\text{start}}_{gtk} + \sum_{i=min\left(1,t - M^{\text{delay}}_{g,k+1} + 1\right)}^{t - M^{\text{delay}}_{kg}} x^{\text{switch-off}}_{gi} x^{\text{start}}_{gtk} \leq L^{\text{start}}_{gtk} + \sum_{i=min\left(1,t - M^{\text{delay}}_{g,k+1} + 1\right)}^{t - M^{\text{delay}}_{kg}} x^{\text{switch-off}}_{gi}
@ -149,20 +217,23 @@ x^{\text{start}}_{gtk} \leq L^{\text{start}}_{gtk} + \sum_{i=min\left(1,t - M^{\
x^{\text{switch-on}}_{gt} + x^{\text{switch-off}}_{gt} \leq 1 x^{\text{switch-on}}_{gt} + x^{\text{switch-off}}_{gt} \leq 1
``` ```
- If the unit is off, it cannot produce power or provide reserves. If it is on, it must to so within the specified production limits (`eq_prod_limit[s,g,t]`): - If the unit is off, it cannot produce power or provide reserves. If it is on,
it must to so within the specified production limits (`eq_prod_limit[s,g,t]`):
```math ```math
y^{\text{prod-above}}_{gts} + \sum_{r \in R_g} y^{\text{res}}_{grts} \leq y^{\text{prod-above}}_{gts} + \sum_{r \in R_g} y^{\text{res}}_{grts} \leq
(M^{\text{pmax}}_{gt} - M^{\text{pmin}}_{gt}) x^{\text{is-on}}_{gt} (M^{\text{pmax}}_{gt} - M^{\text{pmin}}_{gt}) x^{\text{is-on}}_{gt}
``` ```
- Break down the "production above" variable into smaller "segment production" variables, to simplify the objective function (`eq_prod_above_def[s,g,t]`): - Break down the "production above" variable into smaller "segment production"
variables, to simplify the objective function (`eq_prod_above_def[s,g,t]`):
```math ```math
y^{\text{prod-above}}_{gts} = \sum_{k=1}^{K^{cost}_g} y^{\text{seg-prod}}_{gtks} y^{\text{prod-above}}_{gts} = \sum_{k=1}^{K^{cost}_g} y^{\text{seg-prod}}_{gtks}
``` ```
- Impose upper limit on segment production variables (`eq_segprod_limit[s,g,t,k]`): - Impose upper limit on segment production variables
(`eq_segprod_limit[s,g,t,k]`):
```math ```math
0 \leq y^{\text{seg-prod}}_{gtks} \leq M^{\text{seg-pmax}}_{gtks} 0 \leq y^{\text{seg-prod}}_{gtks} \leq M^{\text{seg-pmax}}_{gtks}
@ -196,7 +267,8 @@ y^{\text{prod-above}}_{g,1,s} \geq
\left(M^{\text{init-power}}_{g} - M^{\text{pmin}}_{gt}\right) - M^{\text{ramp-down}}_{g} \left(M^{\text{init-power}}_{g} - M^{\text{pmin}}_{gt}\right) - M^{\text{ramp-down}}_{g}
``` ```
- Unit cannot produce excessive amount of power immediately after starting up (`eq_startup_limit[s,g,t]`): - Unit cannot produce excessive amount of power immediately after starting up
(`eq_startup_limit[s,g,t]`):
```math ```math
y^{\text{prod-above}}_{gts} + \sum_{r \in R_g} y^{\text{res}}_{grts} \leq y^{\text{prod-above}}_{gts} + \sum_{r \in R_g} y^{\text{res}}_{grts} \leq
@ -205,7 +277,8 @@ max\left\{0,M^{\text{pmax}}_{gt} - M^{\text{startup-limit}}_{g}\right\}
x^{\text{switch-on}}_{gt} x^{\text{switch-on}}_{gt}
``` ```
- Unit cannot shutoff it it's producing too much power (`eq_shutdown_limit[s,g,t]`): - Unit cannot shutoff it it's producing too much power
(`eq_shutdown_limit[s,g,t]`):
```math ```math
y^{\text{prod-above}}_{gts} \leq y^{\text{prod-above}}_{gts} \leq
@ -216,7 +289,13 @@ x^{\text{switch-off}}_{g,t+1}
## 3. Profiled generators ## 3. Profiled generators
A _profiled generator_ is a simplified generator model that can be used to represent renewable energy resources, including wind, solar and hydro. Unlike thermal generators, which can be either on or off, profiled generators do not have status variables; the only optimization decision is on their power output level, which must remain between minimum and maximum time-varying amounts. Production cost curves for profiled generators are linear, making them again much simpler than thermal units. A _profiled generator_ is a simplified generator model that can be used to
represent renewable energy resources, including wind, solar and hydro. Unlike
thermal generators, which can be either on or off, profiled generators do not
have status variables; the only optimization decision is on their power output
level, which must remain between minimum and maximum time-varying amounts.
Production cost curves for profiled generators are linear, making them again
much simpler than thermal units.
### Constants ### Constants
@ -228,9 +307,9 @@ A _profiled generator_ is a simplified generator model that can be used to repre
### Decision variables ### Decision variables
| Symbol | JuMP name | Unit | Description | Stage | | Symbol | JuMP name | Unit | Description | Stage |
| :-------------------- | :--------------------- | :--- | :----------------------------------------------------------- | :---- | | :-------------------- | :--------------------- | :--- | :------------------------------------------------------------ | :---- |
| $y^\text{prod}_{sgt}$ | `prod_profiled[s,g,t]` | MW | Amount of power produced by $g$ in time $t$ and scenario $s$ | 2 | | $y^\text{prod}_{sgt}$ | `prod_profiled[s,g,t]` | MW | Amount of power produced by $g$ in time $t$ and scenario $s$. | 2 |
### Objective function terms ### Objective function terms
@ -252,14 +331,20 @@ M^{\text{pmin}}_{sgt} \leq y^\text{prod}_{sgt} \leq M^{\text{pmax}}_{sgt}
## 4. Conventional loads ## 4. Conventional loads
Loads represent the demand for electrical power by consumers and devices connected to the system. This section describes conventional (or inelastic) loads, which are not sensitive to changes in electricity prices, and must always be served. Each bus in the transmission network has exactly one load; multiple loads in the same bus can be modelled by aggregating them. If there is not enough production or transmission capacity to serve all loads, some load can be shed at a penalty. Loads represent the demand for electrical power by consumers and devices
connected to the system. This section describes _conventional_ (or inelastic)
loads, which are not sensitive to changes in electricity prices, and must always
be served. Each bus in the transmission network has exactly one load; multiple
loads in the same bus can be modelled by aggregating them. If there is not
enough production or transmission capacity to serve all loads, some load can be
curtailed, at a penalty.
### Constants ### Constants
| Symbol | Unit | Description | | Symbol | Unit | Description |
| :---------------------- | :---- | :-------------------------------------------------------- | | :---------------------- | :---- | :--------------------------------------------------------- |
| $M^\text{load}_{sbt}$ | MW | Conventional load on bus $b$ at time $s$ and scenario $s$ | | $M^\text{load}_{sbt}$ | MW | Conventional load on bus $b$ at time $s$ and scenario $s$. |
| $Z^\text{curtail}_{st}$ | \$/MW | Load curtailment penalty at time $t$ in scenario $s$ | | $Z^\text{curtail}_{st}$ | \$/MW | Load curtailment penalty at time $t$ in scenario $s$. |
### Decision variables ### Decision variables
@ -287,15 +372,25 @@ Loads represent the demand for electrical power by consumers and devices connect
## 5. Price-sensitive loads ## 5. Price-sensitive loads
Price-sensitive loads refer to components in the system which may increase or reduce their power consumption according to energy prices. Unlike convential loads, described above, price-sensitive loads are only served if it is economical to do so. More specifically, there are no constraints forcing these loads to be served; instead, there is a term in the objective function rewarding each MW served. There may be multiple price-sensitive loads per bus. _Price-sensitive loads_ refer to components in the system which may increase or
reduce their power consumption according to energy prices. Unlike conventional
loads, described above, price-sensitive loads are only served if it is
economical to do so. More specifically, there are no constraints forcing these
loads to be served; instead, there is a term in the objective function rewarding
each MW served. Unlike conventional loads, there may be multiple price-sensitive
loads per bus.
!!! note
Some unit commitment models allow price-sensitive loads to have a piecewise-linear convex revenue curves, similar to thermal generators. This can be achieved in UC.jl by adding multiple price-sensitive loads to the bus, one for each piecewise-linear segment.
### Sets and constants ### Sets and constants
| Symbol | Unit | Description | | Symbol | Unit | Description |
| :--------------------------- | :---- | :-------------------------------------------------------------- | | :--------------------------- | :---- | :--------------------------------------------------------------- |
| $M^\text{psl-demand}_{spt}$ | MW | Demand of price-sensitive load $p$ at time $t$ and scenario $s$ | | $M^\text{psl-demand}_{spt}$ | MW | Demand of price-sensitive load $p$ at time $t$ and scenario $s$. |
| $Z^\text{psl-revenue}_{spt}$ | \$/MW | Revenue from serving load $p$ at $t$ in scenario $s$ | | $Z^\text{psl-revenue}_{spt}$ | \$/MW | Revenue from serving load $p$ at $t$ in scenario $s$. |
| $\text{PSL}$ | | Set of price-sensitive loads | | $\text{PSL}$ | | Set of price-sensitive loads. |
### Decision variables ### Decision variables
@ -323,12 +418,139 @@ Price-sensitive loads refer to components in the system which may increase or re
## 6. Buses and transmission lines ## 6. Buses and transmission lines
So far, we have described generators, which produce power, and loads, which consume power. A third important element is the transmission network, which delivers the power produced by the generators to the loads. Mathematically, the network is represented as a graph $(B,L)$ where $B$ is the set of **buses** and $L$ is the set of **transmission lines**. Each generator and each bus in the network is located at a bus. The **net injection** at the bus is the sum of all power injected minus withdrawn at the bus. To balance production and consumption, we must enforce that the sum of all net injections over the network equal to zero. So far, we have described generators, which produce power, and loads, which
consume power. A third important element is the transmission network, which
delivers the power produced by the generators to the loads. Mathematically, the
network is represented as a graph $(B,L)$ where $B$ is the set of **buses** and
$L$ is the set of **transmission lines**. Each generator, load and energy
storage device is located at a bus. The **net injection** at the bus is the sum
of all power injected minus withdrawn at the bus. To balance production and
consumption, we must enforce that the sum of all net injections over the entire
network equal to zero.
Besides the net balance equations, we must also enforce flow limits on the
transmission lines. Unlike flows in other optimization problems, power flows are
directly determined by net injections and transmission line parameters, and must
follow physical laws. UC.jl uses the DC linearization of AC power flow
equations. Under this linearization, the flow $f_l$ in transmission line $l$ is
given by $\sum_{b \in B} \delta_{bl} n_b$, where $\delta_{bl}$ is a constant
known as _injection shift factor_ (also commonly called _power transfer
distribution factor_), computed from the line parameters, and $n_b$ is the net
injection at bus $b$.
!!! warning
To improve computational performance, power flow variables and constraints are generated on-the-fly, during `UnitCommitment.optimize!`; they are **not** added by `UnitCommitment.build_model`.
### Sets and constants
| Symbol | Unit | Description |
| :------------------------ | :---- | :---------------------------------------------------------- |
| $M^\text{limit}_{slt}$ | MW | Flow limit for line $l$ at time $t$ and scenario $s$. |
| $Z^\text{overflow}_{slt}$ | \$/MW | Overflow penalty for line $l$ at time $t$ and scenario $s$. |
| $L$ | | Set of transmission lines. |
| $B$ | | Set of buses. |
### Decision variables
| Symbol | JuMP name | Unit | Description | Stage |
| :------------------------ | :--------------------- | :--- | :-------------------------------------------------------------------- | :---- |
| $y^\text{flow}_{slt}$ | _(added on-the-fly)_ | MW | Flow in line $l$ at time $t$ and scenario $s$. | 2 |
| $y^\text{inj}_{sbt}$ | `net_injection[s,b,t]` | MW | Total net injection at bus $b$, time $t$ and scenario $s$. | 2 |
| $y^\text{overflow}_{slt}$ | `overflow[s,l,t]` | MW | Amount of flow above limit for line $l$ at time $t$ and scenario $s$. | 2 |
Besides the net balance equations, we must also enforce flow limits on the transmission lines. Unlike flows in other optimization problems, power flows are directly determined by net injections and transmission line parameters, and must follow physical laws. UC.jl uses the DC linearization of AC power flow equations, which are derived the assumptions that (i) line losses are negligible; (ii) voltage magnitudes are constant; and (iii) phase angle differences are small. Under these assumptions, the flow $f_l$ in transmission line $l$ is given by $\sum_{b \in B} \delta_{bl} n_b$, where $\delta_{bl}$ is a constant known as _injection shift factor_, computed from the line parameters, and $n_b$ is the net injection at bus $b$. ### Objective function terms
- Penalty for exceeding line limits:
```math
- \sum_{s \in S} p(s) \left[
\sum_{l \in L} \sum_{t \in T} y^\text{overflow}_{slt} Z^\text{overflow}_{slt}
\right]
```
### Constraints
- Power produced equal power consumed (`eq_power_balance[s,t]`):
```math
\sum_{b \in B} \sum_{t \in T} y^\text{inj}_{sbt} = 0
```
- Definition of flow (_enforced on-the-fly_):
```math
y^\text{flow}_{slt} = \sum_{b \in B} \delta_{sbl} y^\text{inj}_{sbt}
```
- Flow limits (_enforced on-the-fly_):
```math
\begin{align*}
y^\text{flow}_{slt} & \leq M^\text{limit}_{slt} + y^\text{overflow}_{slt} \\
-y^\text{flow}_{slt} & \leq M^\text{limit}_{slt} + y^\text{overflow}_{slt}
\end{align*}
```
## 7. Transmission interfaces ## 7. Transmission interfaces
In some applications, such as energy exchange studies, it is important to
enforce flow limits not only on individual lines, but also on groups of
transmission lines. These groups are known as _interfaces_. More precisely, an
interface is composed by two sets of lines: the _inbound_ and the _outbound
lines_. The flow across the interface is defined as the sum of the flow in all
inbound lines minus the sum of the flow in all outbound lines. An upper and a
lower limit may be imposed on the flow across the interface, and a penalty is
imposed if the limit is exceeded.
### Sets and constants
| Symbol | Unit | Description |
| :-------------------------- | :---- | :----------------------------------------------------------------------------------------- |
| $L^\text{inbound}_{si}$ | | Set of inbound lines for interface $i$ in scenario $s$. |
| $L^\text{outbound}_{si}$ | | Set of outbound lines for interface $i$ in scenario $s$. |
| $M^\text{limit-down}_{sit}$ | MW | Lower flow limit for interface $i$ at time at time $t$ and scenario $s$ (negative number). |
| $M^\text{limit-up}_{sit}$ | MW | Upper flow limit for interface $i$ at time at time $t$ and scenario $s$ (positive number). |
| $Z^\text{overflow}_{sit}$ | \$/MW | Overflow penalty for interface $l$ at time $t$ and scenario $s$. |
| $\text{IF}$ | | Set of transmission interfaces. |
### Decision variables
| Symbol | JuMP name | Unit | Description | Stage |
| :-------------------------- | :-------------------------- | :--- | :--------------------------------------------------------------- | :---- |
| $y^\text{i-flow}_{sit}$ | `interface_flow[s,i,t]` | MW | Flow across interface $i$ at time $t$ and scenario $s$. | 2 |
| $y^\text{i-overflow}_{sit}$ | `interface_overflow[s,i,t]` | MW | Flow above limit for interface $i$ at time $t$ and scenario $s$. | 2 |
### Objective function terms
- Penalty for exceeding interface limits:
```math
- \sum_{s \in S} p(s) \left[
\sum_{i \in \text{IF}} \sum_{t \in T} y^\text{i-overflow}_{sit} Z^\text{overflow}_{sit}
\right]
```
### Constraints
- Definition of interface flow (`eq_if_flow`):
```math
y^\text{i-flow}_{sit} = \sum_{b \in B} y^\text{inj}_{sbt} \left[
\sum_{l \in L^\text{outbound}_{si}} \delta_{sbl} -
\sum_{l \in L^\text{inbound}_{si}} \delta_{sbl}
\right]
```
- Interface flow limits (`eq_if_limit_up` and `eq_if_limit_up`)
```math
\begin{align*}
y^\text{i-flow}_{sit} & \leq M^\text{limit-up}_{sit} + y^\text{i-overflow}_{sit} \\
-y^\text{i-flow}_{sit} & \leq -M^\text{limit-down}_{sit} + y^\text{i-overflow}_{sit}
\end{align*}
```
## 7. Energy storage devices ## 7. Energy storage devices
## 8. Contingencies ## 8. Contingencies

Loading…
Cancel
Save