# Mathematical formulation (core model)¶

This page is generated from the auto-documentation mark-up in MESSAGE/model_core.gms.

The MESSAGEix systems-optimization model minimizes total costs while satisfying given demand levels for commodities/services and considering a broad range of technical/engineering constraints and societal restrictions (e.g. bounds on greenhouse gas emissions, pollutants). Demand levels are static (i.e. non-elastic), but the demand response can be integrated by linking MESSAGEix to the single sector general-economy MACRO model included in this framework.

For the complete list of sets, mappings and parameters, refer to the auto-documentation pages Sets and mappings definition and Parameter definition.

## Notation declaration¶

The following short notation is used in the mathematical description relative to the GAMS code:

### Mathematical notation of sets¶

Math notation GAMS set & index notation
$$n \in N$$ node (across spatial hierarchy levels)
$$y \in Y$$ year (all periods including historical and model horizon)
$$y \in Y^M \subset Y$$ time periods included in model horizon
$$y \in Y^H \subset Y$$ historical time periods (prior to first model period)
$$c \in C$$ commodity
$$l \in L$$ level
$$g \in G$$ grade
$$t \in T$$ technology (a.k.a tec)
$$h \in H$$ time (subannual time periods)
$$m \in M$$ mode
$$e \in E$$ emission, pollutants
$$s \in S$$ scenarios of land use (for land-use model emulator)
$$u \in U$$ land-use types
$$r \in R$$ set of generic relations (linear constraints)
$$t \in T^{INV} \subseteq T$$ all technologies with investment decisions and capacity constraints
$$t \in T^{REN} \subseteq T$$ all technologies which draw their input from the renewable level
$$n \in N(\widehat{n})$$ all nodes that are subnodes of node $$\widehat{n}$$
$$y \in Y(\widehat{y})$$ all years mapped to the category type_year $$\widehat{y}$$
$$t \in T(\widehat{t})$$ all technologies mapped to the category type_tec $$\widehat{t}$$
$$e \in E(\widehat{e})$$ all emissions mapped to the category type_emission $$\widehat{e}$$

### Decision variables¶

Variable Explanatory text
$$OBJ \in \mathbb{R}$$ Objective value of the optimization program
$$EXT_{n,c,g,y} \in \mathbb{R}_+$$ Extraction of non-renewable/exhaustible resources from reserves
$$STOCK_{n,c,l,y} \in \mathbb{R}_+$$ Quantity in stock (storage) at start of period $$y$$
$$STOCK\_CHG_{n,c,l,y,h} \in \mathbb{R}$$ Input or output quantity into intertemporal commodity stock (storage)
$$REN_{n,t,c,g,y,h}$$ Activity of renewable technologies per grade
$$CAP\_NEW_{n,t,y} \in \mathbb{R}_+$$ New installed capacity (yearly average over period duration
$$CAP_{n,t,y^V,y} \in \mathbb{R}_+$$ Maintained capacity in year $$y$$ of vintage $$y^V$$
$$ACT_{n,t,y^V,y,m,h} \in \mathbb{R}$$ Activity of a technology (by vintage, mode, subannual time)
$$CAP\_NEW\_UP_{n,t,y} \in \mathbb{R}_+$$ Relaxation of upper dynamic constraint on new capacity
$$CAP\_NEW\_LO_{n,t,y} \in \mathbb{R}_+$$ Relaxation of lower dynamic constraint on new capacity
$$CAP\_FIRM_{n,t,c,l,y,q}$$ Dispatchable capacity of renewable technologies per grade
$$ACT\_UP_{n,t,y,h} \in \mathbb{R}_+$$ Relaxation of upper dynamic constraint on activity [1]
$$ACT\_LO_{n,t,y,h} \in \mathbb{R}_+$$ Relaxation of lower dynamic constraint on activity [1]
$$LAND_{n,s,y} \in [0,1]$$ Relative share of land-use scenario (for land-use model emulator)
$$EMISS_{n,e,\widehat{t},y}$$ Auxiliary variable for aggregate emissions by technology type
$$REL_{r,n,y} \in \mathbb{R}$$ Auxiliary variable for left-hand side of relations (linear constraints)
$$COMMODITY\_USE_{n,c,l,y}$$ Auxiliary variable for amount of commodity used at specific level

The index $$y^V$$ is the year of construction (vintage) wherever it is necessary to clearly distinguish between year of construction and the year of operation.

All decision variables are by year, not by (multi-year) period, except $$STOCK_{n,c,l,y}$$. In particular, the new capacity variable $$CAP\_NEW_{n,t,y}$$ has to be multiplied by the number of years in a period $$|y| = duration\_period_{y}$$ to determine the available capacity in subsequent periods. This formulation gives more flexibility when it comes to using periods of different duration (more intuitive comparison across different periods).

The current model framework allows both input or output normalized formulation. This will affect the parametrization, see Section Efficiency - output- vs. input defined technologies for more details.

 [1] (1, 2) The dynamic activity constraints are implemented as summed over all modes; therefore, the variables for the relaxation are not indexed over the set mode.

### Auxiliary variables¶

Variable Explanatory text
$$DEMAND_{n,c,l,y,h} \in \mathbb{R}$$ Demand level (in equilibrium with MACRO integration)
$$PRICE\_COMMODITY_{n,c,l,y,h}$$ Commodity price (undiscounted marginals of COMMODITY_BALANCE constraint)
$$PRICE\_EMISSION_{n,e,\widehat{t},y}$$ Emission price (undiscounted marginals of EMISSION_BOUND constraint)
$$COST\_NODAL\_NET_{n,y} \in \mathbb{R}$$ System costs at the node level net of energy trade revenues/cost
$$GDP_{n,y} \in \mathbb{R}$$ gross domestic product (GDP) in market exchange rates for MACRO reporting

## Objective function¶

### The objective function of the MESSAGEix core model¶

#### Equation OBJECTIVE¶

The objective function (of the core model) minimizes total discounted systems costs including costs for emissions, relaxations of dynamic constraints

$OBJ = \sum_{n,y \in Y^{M}} discountfactor_{y} \cdot COST\_NODAL_{n,y}$

## Regional system cost accounting function¶

### Accounting of regional system costs over time¶

#### Equation COST_ACCOUNTING_NODAL¶

Accounting of regional systems costs over time as well as costs for emissions (taxes), land use (from the model land-use model emulator), relaxations of dynamic constraints, and linear relations.

$\begin{split}COST\_NODAL_{n,y} & = \sum_{c,g} \ resource\_cost_{n,c,g,y} \cdot EXT_{n,c,g,y} \\ & + \sum_{t} \ \bigg( inv\_cost_{n,t,y} \cdot construction\_time\_factor_{n,t,y} \\ & \quad \quad \quad \cdot end\_of\_horizon\_factor_{n,t,y} \cdot CAP\_NEW_{n,t,y} \\[4 pt] & \quad \quad + \sum_{y^V \leq y} \ fix\_cost_{n,t,y^V,y} \cdot CAP_{n,t,y^V,y} \\ & \quad \quad + \sum_{\substack{y^V \leq y \\ m,h}} \ var\_cost_{n,t,y^V,y,m,h} \cdot ACT_{n,t,y^V,y,m,h} \\ & \quad \quad + \Big( abs\_cost\_new\_capacity\_soft\_up_{n,t,y} \\ & \quad \quad \quad + level\_cost\_new\_capacity\_soft\_up_{n,t,y} \cdot\ inv\_cost_{n,t,y} \Big) \cdot CAP\_NEW\_UP_{n,t,y} \\[4pt] & \quad \quad + \Big( abs\_cost\_new\_capacity\_soft\_lo_{n,t,y} \\ & \quad \quad \quad + level\_cost\_new\_capacity\_soft\_lo_{n,t,y} \cdot\ inv\_cost_{n,t,y} \Big) \cdot CAP\_NEW\_LO_{n,t,y} \\[4pt] & \quad \quad + \sum_{m,h} \ \Big( abs\_cost\_activity\_soft\_up_{n,t,y,m,h} \\ & \quad \quad \quad + level\_cost\_activity\_soft\_up_{n,t,y,m,h} \cdot\ levelized\_cost_{n,t,y,m,h} \Big) \cdot ACT\_UP_{n,t,y,h} \\ & \quad \quad + \sum_{m,h} \ \Big( abs\_cost\_activity\_soft\_lo_{n,t,y,m,h} \\ & \quad \quad \quad + level\_cost\_activity\_soft\_lo_{n,t,y,m,h} \cdot\ levelized\_cost_{n,t,y,m,h} \Big) \cdot ACT\_LO_{n,t,y,h} \bigg) \\ & + \sum_{\substack{\widehat{e},\widehat{t} \\ e \in E(\widehat{e})}} emission\_scaling_{\widehat{e},e} \cdot \ emission\_tax_{n,\widehat{e},\widehat{t},y} \cdot EMISS_{n,e,\widehat{t},y} \\ & + \sum_{s} land\_cost_{n,s,y} \cdot LAND_{n,s,y} \\ & + \sum_{r} relation\_cost_{r,n,y} \cdot REL_{r,n,y}\end{split}$

Here, $$n^L \in N(n)$$ are all nodes $$n^L$$ that are sub-nodes of node $$n$$. The subset of technologies $$t \in T(\widehat{t})$$ are all tecs that belong to category $$\widehat{t}$$, and similar notation is used for emissions $$e \in E$$.

## Resource and commodity section¶

### Constraints on resource extraction¶

#### Equation EXTRACTION_EQUIVALENCE¶

This constraint translates the quantity of resources extracted (summed over all grades) to the input used by all technologies (drawing from that node). It is introduced to simplify subsequent notation in input/output relations and nodal balance constraints.

$\begin{split}\sum_{g} EXT_{n,c,g,y} = \sum_{\substack{n^L,t,m,h,h^{OD} \\ y^V \leq y \\ \ l \in L^{RES} \subseteq L }} input_{n^L,t,y^V,y,m,n,c,l,h,h^{OD}} \cdot ACT_{n^L,t,m,y,h}\end{split}$

The set $$L^{RES} \subseteq L$$ denotes all levels for which the detailed representation of resources applies.

#### Equation EXTRACTION_BOUND_UP¶

This constraint specifies an upper bound on resource extraction by grade.

$EXT_{n,c,g,y} \leq bound\_extraction\_up_{n,c,g,y}$

#### Equation RESOURCE_CONSTRAINT¶

This constraint restricts that resource extraction in a year guarantees the “remaining resources” constraint, i.e., only a given fraction of remaining resources can be extracted per year.

$\begin{split}EXT_{n,c,g,y} \leq resource\_remaining_{n,c,g,y} \cdot \Big( & resource\_volume_{n,c,g} \\ & - \sum_{y' < y} duration\_period_{y'} \cdot EXT_{n,c,g,y'} \Big)\end{split}$

#### Equation RESOURCE_HORIZON¶

This constraint ensures that total resource extraction over the model horizon does not exceed the available resources.

$\sum_{y} duration\_period_{y} \cdot EXT_{n,c,g,y} \leq resource\_volume_{n,c,g}$

### Constraints on commodities and stocks¶

#### Equation COMMODITY_BALANCE¶

This constraint ensures the nodal and temporal balance of outputs/imports and inputs/exports for all commodities.

$\begin{split}\sum_{\substack{n^L,t,m,h^A \\ y^V \leq y}} output_{n^L,t,y^V,y,m,n,c,l,h^A,h} \cdot duration\_time\_rel_{h,h^A} \cdot & ACT_{n^L,t,y^V,y,m,h^A} \\ - \sum_{\substack{n^L,t,m,h^A \\ y^V \leq y}} input_{n^L,t,y^V,y,m,n,c,l,h^A,h} \cdot duration\_time\_rel_{h,h^A} \cdot & ACT_{n^L,t,m,y,h^A} \\ + \ STOCK\_CHG_{n,c,l,y,h} & \\[4pt] + \ \sum_s \Big( land\_output_{n,s,y,c,l,h} - land\_input_{n,s,y,c,l,h} \Big) \cdot & LAND_{n,s,y} \\[4pt] - \ demand\_fixed_{n,c,l,y,h} & \geq 0 \quad \forall \ l \notin L^{RES} \subseteq L\end{split}$

The commodity balance constraint at the resource level is included in the Equation RESOURCE_CONSTRAINT, while at the renewable level, it is included in the Equation RENEWABLES_EQUIVALENCE.

#### Equation STOCKS_BALANCE¶

This constraint ensures the inter-temporal balance of commodity stocks. The parameter $$commodity\_stocks_{n,c,l}$$ can be used to model exogenous additions to the stock

$\begin{split}STOCK_{n,c,l,y} + commodity\_stock_{n,c,l,y} = duration\_period_{y} \cdot & \sum_{h} STOCK\_CHG_{n,c,l,y,h} \\ & + STOCK_{n,c,l,y+1}\end{split}$

## Technology section¶

### Technical and engineering constraints¶

#### Equation CAPACITY_CONSTRAINT¶

This constraint ensures that the actual activity of a technology at a node/time cannot exceed available (maintained) capacity summed over all vintages, including the technology capacity factor $$capacity\_factor_{n,t,y,t}$$.

$\sum_{m} ACT_{n,t,y^V,y,m,h} \leq duration\_time_{h} \cdot capacity\_factor_{n,t,y^V,y,h} \cdot CAP_{n,t,y^V,y} \quad t \ \in \ T^{INV}$

where $$T^{INV} \subseteq T$$ is the set of all technologies for which investment decisions and capacity constraints are relevant.

#### Equation CAPACITY_MAINTENANCE¶

This constraint deals with fixed costs for operation and maintainance (O&M) of technology capacity_maintainance. Capacity must be maintained over time until decommissioning (no mothballing), and fixed O&M costs must be paid immediately after commissioning.

$\begin{split}CAP_{n,t,y^V,y} \leq remaining\_capacity_{n,t,y^V,y} \cdot \left\{ \begin{array}{ll} duration\_period_{y^V} \cdot historical\_new\_capacity_{n,t,y^V} \quad & \text{if } y \ \text{is first model period} \\ duration\_period_{y^V} \cdot CAP\_NEW_{n,t,y^V} \quad & \text{if } y = y^V \\ CAP_{n,t,y^V,y-1} & \text{if } y > y^V \text{ and } |y| - |y^V| < technical\_lifetime_{n,t,y^V} \end{array} \right\} \quad \forall \ t \in T^{INV}\end{split}$

The current formulation does not account for construction time in the constraints, but only adds a mark-up to the investment costs in the objective function.

#### Equation OPERATION_CONSTRAINT¶

This constraint provides an upper bound on the total operation of installed capacity over a year.

$\sum_{m,h} ACT_{n,t,y^V,y,m,h} \leq operation\_factor_{n,t,y^V,y} \cdot capacity\_factor_{n,t,y^V,y,m,\text{'year'}} \cdot CAP_{n,t,y^V,y}$

This constraint is only active if $$operation\_factor_{n,t,y^V,y} < 1$$.

#### Equation MIN_UTILIZATION_CONSTRAINT¶

This constraint provides a lower bound on the total utilization of installed capacity over a year.

$\sum_{m,h} ACT_{n,t,y^V,y,m,h} \geq min\_utilization\_factor_{n,t,y^V,y} \cdot CAP_{n,t,y^V,y}$

This constraint is only active if $$min\_utilization\_factor_{n,t,y^V,y}$$ is defined.

### Constraints representing renewable integration¶

#### Equation RENEWABLES_EQUIVALENCE¶

This constraint defines the auxiliary variables $$REN$$ to be equal to the output of renewable technologies (summed over grades).

$\begin{split}\sum_{g} REN_{n,t,c,g,y,h} \leq \sum_{\substack{n,t,m,l,h,h^{OD} \\ y^V \leq y \\ \ l \in L^{REN} \subseteq L }} input_{n^L,t,y^V,y,m,n,c,l,h,h^{OD}} \cdot ACT_{n^L,t,m,y,h}\end{split}$

The set $$L^{REN} \subseteq L$$ denotes all levels for which the detailed representation of renewables applies.

#### Equation RENEWABLES_POTENTIAL_CONSTRAINT¶

This constraint sets the potential potential by grade as the upper bound for the auxiliary variable $$REN$$.

$\begin{split}\sum_{\substack{t,h \\ \ t \in T^{R} \subseteq t }} REN_{n,t,c,g,y,h} \leq \sum_{\substack{l \\ l \in L^{R} \subseteq L }} renewable\_potential_{n,c,g,l,y}\end{split}$

#### Equation RENEWABLES_CAPACITY_REQUIREMENT¶

This constraint connects the capacity factor of a renewable grade to the installed capacity of a technology. It sets the lower limit for the capacity of a renewable technology to the summed activity over all grades (REN) devided by the capactiy factor of this grade. It represents the fact that different renewable grades require different installed capacities to provide their full potential.

$\begin{split}\sum_{y^V, h} CAP_{n,t,y^V,y} \cdot operation\_factor_{n,t,y^V,y} \cdot \\ capacity\_factor_{n,t,y^V,y,h} \geq \sum_{g,h,l} REN_{n,t,c,g,y,h} / \\ renewable\_capacity\_factor_{n,c,g,l,y}\end{split}$

This constraint is only active if $$renewable\_capacity\_factor_{n,c,g,l,y}$$ is defined.

### Constraints representing the firm capacity requirement¶

The following constraint ensures that there is sufficient firm (dispatchable) capacity in each period. The formulation is based on Sullivan et al., 2013 [6].

The firm capacity a technology provides depends on their reliability factor per rating. The rating are defined depending on the share the single technology provides to the system. The reliablitiy factor of conventional powerplants is equal to 1. Therefore they provide their nameplate capacity as firm capacity. The reliability factor of wind and solar dependens on the share they have in the energy system. Therefore their reliability factor depend on the rating.

#### Equation COMMODITY_USE_LEVEL¶

This constraint defines the COMMODITY_USE_LEVEL as summed consumption of a commodity at a certain level during one year.

$\begin{split}COMMODITY\_USE_{n,c,l,y} = \sum_{n,t,y^V,m,h} input_{n,t,y^V,y,m,n,c,l,h,h} \cdot \\ duration\_time\_rel_{h,h} \cdot ACT_{n,t,y^V,y,m,h}\end{split}$

This constraint is only active if $$peak\_load\_factor_{n,c,l,y,h}$$ is defined. The auxiliary variable $$COMMODITY\_USE_{n,c,l,y}$$ is only required for the equations $$FIRM\_CAPACITY\_CONSTRAINT$$ and $$FIRM\_CAPACITY\_SHARE$$.

#### Equation FIRM_CAPACITY_CONSTRAINT¶

This constraint ensures that there is sufficient firm (dispatchable) capacity in each period. The formulation is based on Sullivan et al., 2013 [6].

$\begin{split}\sum_{t, q \substack{t \in T^{INV} \\ y^V \leq y} } reliability\_factor_{n,t,y,c,l,h,q} \cdot CAP\_FIRM_{n,t,c,l,y,q} \geq \\ peak\_load\_factor_{n,c,l,y,h} \cdot COMMODITY\_USE_{n,c,l,y}\end{split}$

This constraint is only active if $$peak\_load\_factor_{n,c,l,y,h}$$ is defined.

#### Equation FIRM_CAPACITY_SHARE¶

Limits the firm capacity per rating to the size of the penetration bin of this rating.

$CAP\_FIRM_{n,t,c,l,y,q} \leq rating\_bin_{n,t,y,c,l,h,q} \cdot COMMODITY\_USE_{n,c,l,y}$

This constraint is only active if $$reliability\_bin_{n,t,y,c,l,t,q}$$ is defined.

#### Equation FIRM_CAPACITY_PROVISION¶

Limits the firm capacity of the renewables technologies to the total installed capacity of each technology.

$\sum_{r,h} CAP\_FIRM_{n,t,c,l,y,q} \leq \sum_{y^V \leq y} CAP_{n,t,y^Y,y} \quad \forall t \in T^{INV}$

This constraint is only active if $$reliability\_factor_{n,t,y,c,l,h,q}$$ is defined.

#### Equation OPERATING_RESERVE_CONSTRAINT¶

This constraint ensures that, in each sub-annual time slice, there is a sufficient share of flexible technologies in the power generation mix. This heading is a placeholder for a new formulation using the extended index set structure.

### Bounds on capacity and activity¶

#### Equation NEW_CAPACITY_BOUND_UP¶

This constraint provides upper bounds on new capacity installation.

$CAP\_NEW_{n,t,y} \leq bound\_new\_capacity\_up_{n,t,y} \quad \forall \ t \ \in \ T^{INV}$

#### Equation NEW_CAPACITY_BOUND_LO¶

This constraint provides lower bounds on new capacity installation.

$CAP\_NEW_{n,t,y} \geq bound\_new\_capacity\_lo_{n,t,y} \quad \forall \ t \ \in \ T^{INV}$

#### Equation TOTAL_CAPACITY_BOUND_UP¶

This constraint gives upper bounds on the total installed capacity of a technology in a specific year of operation summed over all vintages.

$\sum_{y^V \leq y} CAP_{n,t,y,y^V} \leq bound\_total\_capacity\_up_{n,t,y} \quad \forall \ t \ \in \ T^{INV}$

#### Equation TOTAL_CAPACITY_BOUND_LO¶

This constraint gives lower bounds on the total installed capacity of a technology.

$\sum_{y^V \leq y} CAP_{n,t,y,y^V} \geq bound\_total\_capacity\_lo_{n,t,y} \quad \forall \ t \ \in \ T^{INV}$

#### Equation ACTIVITY_BOUND_UP¶

This constraint provides lower bounds of a technology activity by mode, summed over all vintages.

$\sum_{y^V \leq y} ACT_{n,t,y^V,y,m,h} \leq bound\_activity\_up_{n,t,m,y,h}$

#### Equation ACTIVITY_BOUND_LO¶

This constraint provides lower bounds of a technology activity by mode summed over all vintages.

$\sum_{y^V \leq y} ACT_{n,t,y^V,y,m,h} \geq bound\_activity\_lo_{n,t,y,m,h}$

We assume that $$bound\_activity\_lo_{n,t,y,m,h} = 0$$ unless explicitly stated otherwise.

### Dynamic constraints on market penetration¶

The constraints in this section specify dynamic upper and lower bounds on new capacity and activity, i.e., constraints on market penetration and rate of expansion or phase-out of a technology.

The formulation directly includes the option for ‘soft’ relaxations of dynamic constraints (cf. Keppo and Strubegger, 2010 [3]).

#### Equation NEW_CAPACITY_CONSTRAINT_UP¶

The level of new capacity additions cannot be greater than an initial value (compounded over the period duration), annual growth of the existing ‘capital stock’, and a “soft” relaxation of the upper bound.

$\begin{split}CAP\_NEW_{n,t,y} \leq & ~ initial\_new\_capacity\_up_{n,t,y} \cdot \frac{ \Big( 1 + growth\_new\_capacity\_up_{n,t,y} \Big)^{|y|} - 1 } { growth\_new\_capacity\_up_{n,t,y} } \\ & + \Big( CAP\_NEW_{n,t,y-1} + historical\_new\_capacity_{n,t,y-1} \Big) \\ & \hspace{2 cm} \cdot \Big( 1 + growth\_new\_capacity\_up_{n,t,y} \Big)^{|y|} \\ & + CAP\_NEW\_UP_{n,t,y} \cdot \Bigg( \Big( 1 + soft\_new\_capacity\_up_{n,t,y}\Big)^{|y|} - 1 \Bigg) \\ & \quad \forall \ t \ \in \ T^{INV}\end{split}$

Here, $$|y|$$ is the number of years in period $$y$$, i.e., $$duration\_period_{y}$$.

#### Equation NEW_CAPACITY_SOFT_CONSTRAINT_UP¶

This constraint ensures that the relaxation of the dynamic constraint on new capacity (investment) does not exceed the level of the investment in the same period (cf. Keppo and Strubegger, 2010 [3]).

$CAP\_NEW\_UP_{n,t,y} \leq CAP\_NEW_{n,t,y} \quad \forall \ t \ \in \ T^{INV}$

#### Equation NEW_CAPACITY_CONSTRAINT_LO¶

This constraint gives dynamic lower bounds on new capacity.

$\begin{split}CAP\_NEW_{n,t,y} \geq & - initial\_new\_capacity\_lo_{n,t,y} \cdot \frac{ \Big( 1 + growth\_new\_capacity\_lo_{n,t,y} \Big)^{|y|} } { growth\_new\_capacity\_lo_{n,t,y} } \\ & + \Big( CAP\_NEW_{n,t,y-1} + historical\_new\_capacity_{n,t,y-1} \Big) \\ & \hspace{2 cm} \cdot \Big( 1 + growth\_new\_capacity\_lo_{n,t,y} \Big)^{|y|} \\ & - CAP\_NEW\_LO_{n,t,y} \cdot \Bigg( \Big( 1 + soft\_new\_capacity\_lo_{n,t,y}\Big)^{|y|} - 1 \Bigg) \\ & \quad \forall \ t \ \in \ T^{INV}\end{split}$

#### Equation NEW_CAPACITY_SOFT_CONSTRAINT_LO¶

This constraint ensures that the relaxation of the dynamic constraint on new capacity does not exceed level of the investment in the same year.

$CAP\_NEW\_LO_{n,t,y} \leq CAP\_NEW_{n,t,y} \quad \forall \ t \ \in \ T^{INV}$

#### Equation ACTIVITY_CONSTRAINT_UP¶

This constraint gives dynamic upper bounds on the market penetration of a technology activity.

$\begin{split}\sum_{y^V \leq y,m} ACT_{n,t,y^V,y,m,h} \leq & ~ initial\_activity\_up_{n,t,y,h} \cdot \frac{ \Big( 1 + growth\_activity\_up_{n,t,y,h} \Big)^{|y|} - 1 } { growth\_activity\_up_{n,t,y,h} } \\ & + \bigg( \sum_{y^V \leq y-1,m} ACT_{n,t,y^V,y-1,m,h} + \sum_{m} historical\_activity_{n,t,y-1,m,h} \bigg) \\ & \hspace{2 cm} \cdot \Big( 1 + growth\_activity\_up_{n,t,y,h} \Big)^{|y|} \\ & + ACT\_UP_{n,t,y,h} \cdot \Bigg( \Big( 1 + soft\_activity\_up_{n,t,y,h} \Big)^{|y|} - 1 \Bigg)\end{split}$

#### Equation ACTIVITY_SOFT_CONSTRAINT_UP¶

This constraint ensures that the relaxation of the dynamic activity constraint does not exceed the level of the activity.

$ACT\_UP_{n,t,y,h} \leq \sum_{y^V \leq y,m} ACT_{n^L,t,y^V,y,m,h}$

#### Equation ACTIVITY_CONSTRAINT_LO¶

This constraint gives dynamic lower bounds on the market penetration of a technology activity.

$\begin{split}\sum_{y^V \leq y,m} ACT_{n,t,y^V,y,m,h} \geq & - initial\_activity\_lo_{n,t,y,h} \cdot \frac{ \Big( 1 + growth\_activity\_lo_{n,t,y,h} \Big)^{|y|} - 1 } { growth\_activity\_lo_{n,t,y,h} } \\ & + \bigg( \sum_{y^V \leq y-1,m} ACT_{n,t,y^V,y-1,m,h} + \sum_{m} historical\_activity_{n,t,y-1,m,h} \bigg) \\ & \hspace{2 cm} \cdot \Big( 1 + growth\_activity\_lo_{n,t,y,h} \Big)^{|y|} \\ & - ACT\_LO_{n,t,y,h} \cdot \Bigg( \Big( 1 + soft\_activity\_lo_{n,t,y,h} \Big)^{|y|} - 1 \Bigg)\end{split}$

#### Equation ACTIVITY_SOFT_CONSTRAINT_LO¶

This constraint ensures that the relaxation of the dynamic activity constraint does not exceed the level of the activity.

$ACT\_LO_{n,t,y,h} \leq \sum_{y^V \leq y,m} ACT_{n,t,y^V,y,m,h}$

## Emission section¶

### Auxiliary variable for aggregate emissions¶

#### Equation EMISSION_EQUIVALENCE¶

This constraint simplifies the notation of emissions aggregated over different technology types and the land-use model emulator. The formulation includes emissions from all sub-nodes $$n^L$$ of $$n$$.

$\begin{split}EMISS_{n,e,\widehat{t},y} = \sum_{n^L \in N(n)} \Bigg( \sum_{t \in T(\widehat{t}),y^V \leq y,m,h } emission\_factor_{n^L,t,y^V,y,m,e} \cdot ACT_{n^L,t,y^V,y,m,h} \\ + \sum_{s} \ land\_emission_{n^L,s,y,e} \cdot LAND_{n^L,s,y} \text{ if } \widehat{t} \in \widehat{T}^{LAND} \Bigg)\end{split}$

### Bound on emissions¶

#### Equation EMISSION_CONSTRAINT¶

This constraint enforces upper bounds on emissions (by emission type). For all bounds that include multiple periods, the parameter $$bound\_emission_{n,\widehat{e},\widehat{t},\widehat{y}}$$ is scaled to represent average annual emissions over all years included in the year-set $$\widehat{y}$$.

The formulation includes historical emissions and allows to model constraints ranging over both the model horizon and historical periods.

$\begin{split}\frac{ \sum_{y' \in Y(\widehat{y}), e \in E(\widehat{e})} \begin{array}{l} duration\_period_{y'} \cdot emission\_scaling_{\widehat{e},e} \cdot \\ \Big( EMISS_{n,e,\widehat{t},y'} + \sum_{m} historical\_emission_{n,e,\widehat{t},y'} \Big) \end{array} } { \sum_{y' \in Y(\widehat{y})} duration\_period_{y'} } \leq bound\_emission_{n,\widehat{e},\widehat{t},\widehat{y}}\end{split}$

## Land-use model emulator section¶

### Bounds on total land use¶

#### Equation LAND_CONSTRAINT¶

This constraint enforces a meaningful result of the land-use model emulator, in particular a bound on the total land used in MESSAGEix. The linear combination of land scenarios must be equal to 1.

$\sum_{s \in S} LAND_{n,s,y} = 1$

### Dynamic constraints on land use¶

These constraints enforces upper and lower bounds on the change rate per land scenario.

#### Equation DYNAMIC_LAND_SCEN_CONSTRAINT_UP¶

$\begin{split}LAND_{n,s,y} \leq & initial\_land\_scen\_up_{n,s,y} \cdot \frac{ \Big( 1 + growth\_land\_scen\_up_{n,s,y} \Big)^{|y|} - 1 } { growth\_land\_scen\_up_{n,s,y} } \\ & + \big( LAND_{n,s,y-1} + historical\_land_{n,s,y-1} \big) \cdot \Big( 1 + growth\_land\_scen\_up_{n,s,y} \Big)^{|y|}\end{split}$

#### Equation DYNAMIC_LAND_SCEN_CONSTRAINT_LO¶

$\begin{split}LAND_{n,s,y} \geq & - initial\_land\_scen\_lo_{n,s,y} \cdot \frac{ \Big( 1 + growth\_land\_scen\_lo_{n,s,y} \Big)^{|y|} - 1 } { growth\_land\_scen\_lo_{n,s,y} } \\ & + \big( LAND_{n,s,y-1} + historical\_land_{n,s,y-1} \big) \cdot \Big( 1 + growth\_land\_scen\_lo_{n,s,y} \Big)^{|y|}\end{split}$

These constraints enforces upper and lower bounds on the change rate per land type determined as a linear combination of land use scenarios.

#### Equation DYNAMIC_LAND_TYPE_CONSTRAINT_UP¶

$\begin{split}\sum_{s \in S} land\_use_{n,s,y,u} &\cdot LAND_{n,s,y} \leq initial\_land\_up_{n,y,u} \cdot \frac{ \Big( 1 + growth\_land\_up_{n,y,u} \Big)^{|y|} - 1 } { growth\_land\_up_{n,y,u} } \\ & + \Big( \sum_{s \in S} \big( land\_use_{n,s,y-1,u} + dynamic\_land\_up_{n,s,y-1,u} \big) \\ & \quad \quad \cdot \big( LAND_{n,s,y-1} + historical\_land_{n,s,y-1} \big) \Big) \\ & \quad \cdot \Big( 1 + growth\_land\_up_{n,y,u} \Big)^{|y|}\end{split}$

#### Equation DYNAMIC_LAND_TYPE_CONSTRAINT_LO¶

$\begin{split}\sum_{s \in S} land\_use_{n,s,y,u} &\cdot LAND_{n,s,y} \geq - initial\_land\_lo_{n,y,u} \cdot \frac{ \Big( 1 + growth\_land\_lo_{n,y,u} \Big)^{|y|} - 1 } { growth\_land\_lo_{n,y,u} } \\ & + \Big( \sum_{s \in S} \big( land\_use_{n,s,y-1,u} + dynamic\_land\_lo_{n,s,y-1,u} \big) \\ & \quad \quad \cdot \big( LAND_{n,s,y-1} + historical\_land_{n,s,y-1} \big) \Big) \\ & \quad \cdot \Big( 1 + growth\_land\_lo_{n,y,u} \Big)^{|y|}\end{split}$

## Section of generic relations (linear constraints)¶

This feature is intended for development and testing only - all new features should be implemented as specific new mathematical formulations and associated sets & parameters!

### Auxiliary variable for left-hand side¶

#### RELATION_EQUIVALENCE¶

$\begin{split}REL_{r,n,y} = \sum_{t} \Bigg( & \ relation\_new\_capacity_{r,n,y,t} \cdot CAP\_NEW_{n,t,y} \\[4 pt] & + relation\_total\_capacity_{r,n,y,t} \cdot \sum_{y^V \leq y} \ CAP_{n,t,y^V,y} \\ & + \sum_{n^L,y',m,h} \ relation\_activity_{r,n,y,n^L,t,y',m} \\ & \quad \quad \cdot \Big( \sum_{y^V \leq y'} ACT_{n^L,t,y^V,y',m,h} + historical\_activity_{n^L,t,y',m,h} \Big) \Bigg)\end{split}$

The parameter $$historical\_new\_capacity_{r,n,y}$$ is not included here, because relations can only be active in periods included in the model horizon and there is no “writing” of capacity relation factors across periods.

### Upper and lower bounds on user-defined relations¶

#### Equation RELATION_CONSTRAINT_UP¶

$REL_{r,n,y} \leq relation\_upper_{r,n,y}$

#### Equation RELATION_CONSTRAINT_LO¶

$REL_{r,n,y} \geq relation\_lower_{r,n,y}$