Constraints
In the following, all constraints used in AnyMOD are listed. Information includes the name used throughout the model, its dimensions and a stylized formulation of the constraint itself (see Göke (2020) for details). Within these constraints, variables are printed in bold. In addition, the parameters, variables, and the model part associated with the constraints are listed.
To increase performance, AnyMOD stores constraints within DataFrames instead of using JuMPs native containers. Each dimension is represented by a column and integers in these columns relate to nodes within the hierarchical trees of sets (see printObject
on how to export these in a readable format). An additional cns
column stores the corresponding constraint. Note that final constraints will look unintuitive, because they are scaled to increase performance and converted to standard form by JuMP.
New constraints beyond those listed here can freely be added to a model by using standard JuMP commands.
Balances
Energy balance
Constraints supply to at least exceed demand.
The energy balance can alternatively be enforced as an equality constraint (see Carriers for details). Instead of having a fixed name the constraint is always assigned the name of the carrier being balanced.
name | carrier name |
dimension | $Ts_{dis}$, $R_{dis}$, $C$ |
instances |
|
formulation | $ \scriptstyle dem \, + \, \sum\bm{use} \, + \, \sum\bm{stExt_{in}} \, + \, \sum \bm{exc_{exp}}\, + \, \sum\bm{trd_{sell}} \, + \, \bm{lss} \, \leq \, $ |
$ \scriptstyle \; \; \; \; \sum\bm{gen} \, + \, \sum\bm{stExt_{out}} \, + \, \sum (1-lossExc) \bm{exc_{imp}} \, + \, \sum\bm{trd_{buy}} \, + \, \bm{crt} $ | |
parameter | |
variables | |
part | balance |
Conversion balance
Controls the ratio between used and generated quantities.
name | convBal |
dimension | $Ts_{exp}$, $Ts_{dis}$, $R_{dis}$, $Te$, ($M$) |
instances |
|
formulation | $ \scriptstyle eff_{conv} (\sum\bm{use} \, + \, \sum\bm{stInt_{out}}) \, = \, \sum\bm{gen} \, + \, \sum\bm{stInt_{in}} $ |
parameter | |
variables | |
part | technology |
Storage Balance
Ensures storage levels comply with charged and discharged quantities.
name | stBal |
dimension | $Ts_{exp}$, $Ts_{dis}$, $R_{dis}$, $Te$, $C$, ($M$) |
instances |
|
formulation | $ \scriptstyle \bm{stLvl_{t}} \, = \, \frac{\bm{stLvl_{t-1}}}{1\,-\,stDis} \, + \, stInflow \, + \, \frac{\bm{stExt_{in}} \, + \, \bm{stInt_{in}}}{1/effSt_{in}} \, - \, \frac{\bm{stExt_{out}} \, + \, \bm{stInt_{out}}}{effSt_{out}} $ |
parameter | |
variables | |
part | technology |
Dispatch restrictions
Conversion capacity restriction
Ensures quantities converted comply with the operated conversion capacity.
The graph-based approach that allows to vary resolution by energy carrier within the same model complicates the formulation of capacity constraints for conversion technologies. What kind of constraints are necessary is specified in the capaRestr
of the technology part object
(see Göke (2020) on how this is derived). Capacity constraints are either enforced on used or generated quantities. In the latter case, quantities have to be corrected for the respective efficiency since AnyMOD always denotes capacities after efficiency.
name | inRestr | outRestr |
dimension | $Ts_{exp}$, $Ts_{dis}$, $R_{dis}$, $Te$ | |
instances |
|
|
formulation | $ \scriptstyle \frac{\bm{use} \, + \, \bm{stInt_{out}}}{ava_{conv}} \, \leq \, \bm{oprCapa_{conv}} $ | $ \scriptstyle \frac{\bm{gen} \, + \, \bm{stInt_{in}}}{eff_{conv} \, ava_{conv}} \, \leq \, \bm{oprCapa_{conv}} $ |
parameter | ||
variables | ||
part | technology |
Storage capacity restriction
Ensures quantities stored comply with the operated storage-input, storage-output, storage-size capacity.
name | stInRestr | stOutRestr | stSizeRestr |
dimension | $Ts_{exp}$, $Ts_{dis}$, $R_{dis}$, $Te$, $C$ | ||
instances |
|
||
formulation | $ \scriptstyle \frac{\bm{stExt_{in}} \, + \, \bm{stInt_{in}}}{ava_{stIn}} \, \leq \, \bm{oprCapa_{stIn}} $ | $ \scriptstyle \frac{\bm{stExt_{out}} \, + \, \bm{stInt_{out}}}{ava_{stOut}} \, \leq \, \bm{oprCapa_{stOut}} $ | $ \scriptstyle \frac{\bm{stLvl}}{ava_{stOut}} \, \leq \, \bm{oprCapa_{stSize}} $ |
parameter | |||
variables | |||
part | technology |
Energy ratio restriction
Ensures used and generated quantities comply with the specified ratios.
name | ratioEnerUse{Fix/Low/Up} | ratioEnerGen{Fix/Low/Up} |
dimension | $Ts_{exp}$, $Ts_{dis}$, $R_{dis}$, $Te$, $C$, ($M$) | |
instances |
|
|
formulation | $ \scriptstyle \bm{use} \; \begin{smallmatrix} = \\[0.5pt] \geq \\[2pt] \leq \end{smallmatrix} \; ratioEner^{use}_{fix/low/up} \sum \bm{use} $ | $ \scriptstyle \bm{gen} \; \begin{smallmatrix} = \\[0.5pt] \geq \\[2pt] \leq \end{smallmatrix} \; ratioEner^{gen}_{fix/low/up} \sum \bm{gen} $ |
parameter | ||
variables | ||
part | technology |
Exchange capacity restriction
Ensures exchanged quantities comply with the operated exchange capacity.
name | excRestr |
dimension | $Ts_{dis}$, $R_{from}$, $R_{to}$, $C$ |
instances |
|
formulation | $ \scriptstyle \sum \frac{\bm{exc}}{ava_{exc}} \, \leq \, \bm{oprCapa_{exc}} $ |
parameter | |
variables | |
part | exchange |
Trade capacity restriction
Ensures traded quantities comply with the specified trade capacity.
name | trdBuyCap | trdSellCap |
dimension | $Ts_{dis}$, $R_{dis}$, $C$, $id$ | |
instances |
|
|
formulation | $ \scriptstyle \bm{trdBuy} \, \leq \, trdBuyCap $ | $ \scriptstyle \bm{trdSell} \, \leq \, trdSellCap $ |
parameter | ||
variables | ||
part | trade |
Capacity expansion
Definition of installed capacity
Connects installed capacities to expansion variables and residual capacities.
name | capaConv | capaExc | |
dimension | $Ts_{exp}$, $R_{exp}$, $Te$ | $Ts_{exp}$, $R_{exp}$, $C$, $Te$ | $Ts_{exp}$, $R_{from}$, $R_{to}$, $C$ |
instance |
|
||
|
|
||
|
|
||
formulation | $ \scriptstyle \bm{capa_{t}} \, = \, resiCapa_{t} \, + \, \sum\limits_{t' \in (t \, + \, del, t \, +\,del \, + \, life]} \bm{exp_{t'}} $ | ||
parameter | |||
variables | |||
part | technology | exchange |
Decommissioning of operated capacitiy
Ensures operated capacities comply with installed capacities.
Decommissioning behaviour is determined by the decomm
argument of the model constructor. For none
, the equations listed here are not enforced. Instead operated and installed capacities are identical. When the argument is set to recomm
, only the first equation that limits operated capacities to installed capacities is enforced.
Lastly, for decomm
both equations apply. The second equation will then ensure, that once decommissioned capacities cannot be re-decommissioned again. The expression $\displaystyle \Delta Resi_{+}$ in the equation denotes any increase of residual capacities from $\displaystyle t-1$ to $\displaystyle t$.
name | oprCapaConv | oprCapaExc | |
dimension | $Ts_{exp}$, $R_{exp}$, $Te$ | $Ts_{exp}$, $R_{exp}$, $C$, $Te$ | $Ts_{exp}$, $R_{from}$, $R_{to}$, $C$ |
instance |
|
||
|
|
||
|
|
||
formulation | $ \scriptstyle \bm{oprCapa} \, \leq \, \bm{capa}$ | ||
$ \scriptstyle \bm{oprCapa_{t}} \, \leq \, \bm{oprCapa_{t\,-\,1}} \, + \, \bm{exp_{t}} \, + \, \Delta Resi_{+} $ | |||
parameter | |||
variables | |||
part | technology | exchange |
Cost equations
Within the cost equations the discount factor is used to discount costs to the present. The discount factor for a year $t$ is computed from the discount rates of the current and the previous years as follows:
$\scriptstyle discFac_{t} = \displaystyle \prod_{t' = t_{0}}^{t}(1 \, + \, rateDisc_{t'})^{-1}$
Expansion cost equation
Determines costs of capacity expansion.
name | costExp{Conv,StIn,StOut,StSize} | costExp{Exc} | |
dimension | $Ts_{sup}$, $R_{exp}$, $Te$ | $Ts_{sup}$, $C$ | |
formulation | $ \scriptstyle \bm{costExp\{...\}} \, = \, \sum discFac \, \cdot \, ann\{...\} \, \cdot \, \bm{exp\{...\}} $ | ||
$ \scriptstyle ann\{...\} \, = \, costExp\{...\} \, \cdot \, \frac{rateExp\{...\} \, (1\,+\,rateExp\{...\})^{lifeEco\{...\}}}{(1\,+\,rateExp\{...\})^{lifeEco\{...\}}\,-\,1}$ | |||
parameter | |||
variables | |||
part | objective |
Operating cost equation
Determines costs of operating capacity.
name | costOpr{Conv,StIn,StOut,StSize} | costOpr{Exc} | |
dimension | $Ts_{sup}$, $R_{exp}$, $Te$ | $Ts_{sup}$, $C$ | |
formulation | $ \scriptstyle \bm{costOpr\{...\}} \, = \, \sum discFac \, \cdot \, costOpr\{...\} \, \cdot \, \bm{oprCapa\{...\}} $ | ||
parameter | |||
variables | |||
part | objective |
Variable cost equation
Determines costs associated with quantities dispatched. Costs incurred by emission prices are included in costVarUse
.
name | costVar{Use,Gen} | costVar{StIn,StOut} | costVar{Exc} |
dimension | $Ts_{sup}$, $R_{exp}$, $Te$ | $Ts_{sup}$, $R_{exp}$, $Te$ | $Ts_{sup}$, $C$ |
formulation | $ \scriptstyle \bm{costVar\{...\}} \, = \, \sum discFac \, \cdot \, costVar\{...\} \, \cdot \, \{use,gen,stIn,stOut,exc\} \, \cdot \, 10^3 $ | ||
$ \scriptstyle + \, \sum emFac \, \cdot \, emPrc \, \cdot \, \bm{use} \, \cdot \, 10^3$ | |||
parameter | |||
variables | |||
part | objective |
Trade cost equation
Determines costs and revenues from buying or selling carriers on an external market.
name | costTrdBuy | costTrdSell |
dimension | $Ts_{sup}$, $R_{exp}$, $C$ | |
formulation | $ \scriptstyle \bm{costTrdBuy} \, = $ | $ \scriptstyle \bm{costTrdSell} \, = $ |
$ \scriptstyle \sum discFac \, \cdot \, trdBuyPrc \, \cdot \, \bm{trdBuy} \, \cdot \, 10^3 $ | $ \scriptstyle \sum discFac \, \cdot \, trdSellPrc \, \cdot \, \bm{trdSell} \, \cdot \, 10^3 $ | |
parameter | ||
variables | ||
part | objective |
Curtailment and loss-of-load cost equation
Determines costs of curtailment and unmet demand.
name | costCrt | costLss |
dimension | $Ts_{sup}$, $R_{exp}$, $C$ | |
formulation | $ \scriptstyle \bm{costCrt} \, = $ | $ \scriptstyle \bm{costLss} \, = $ |
$ \scriptstyle \sum discFac \, \cdot \, costCrt \, \cdot \, \bm{crt} \, \cdot \, 10^3 $ | $ \scriptstyle \sum discFac \, \cdot \, costLss \, \cdot \, \bm{lss} \, \cdot \, 10^3 $ | |
parameter | ||
variables | ||
part | objective |
Limiting constraints
Limiting constraints are largely shaped by the corresponding limit parameters on quantities dispatched, expansion and capacity, and by the emission limit.
The name of the constraint will correspond to the name of the respective parameter. Dimension and formulation depend on the way parameter data was provided, as explained here. Lastly, all constraints are stored in the limit part.