Skip to content

Commit d38e45e

Browse files
committed
Adjust calculation of PRICE_EMISSION
1 parent 3a8910b commit d38e45e

File tree

2 files changed

+18
-16
lines changed

2 files changed

+18
-16
lines changed

Diff for: message_ix/model/MESSAGE/model_core.gms

+11-9
Original file line numberDiff line numberDiff line change
@@ -131,21 +131,23 @@ Variables
131131
*
132132
* Auxiliary variables
133133
* ^^^^^^^^^^^^^^^^^^^
134-
* =========================================================================== ======================================================================================================
135-
* Variable Explanatory text
136-
* =========================================================================== ======================================================================================================
137-
* :math:`\text{DEMAND}_{n,c,l,y,h} \in \mathbb{R}` Demand level (in equilibrium with MACRO integration)
138-
* :math:`\text{PRICE_COMMODITY}_{n,c,l,y,h} \in \mathbb{R}` Commodity price (undiscounted marginals of :ref:`commodity_balance_gt` and :ref:`commodity_balance_lt`)
139-
* :math:`\text{PRICE_EMISSION}_{n,\widehat{e},\widehat{t},y} \in \mathbb{R}` Emission price (undiscounted marginals of :ref:`emission_constraint`)
140-
* :math:`\text{COST_NODAL_NET}_{n,y} \in \mathbb{R}` System costs at the node level net of energy trade revenues/cost
141-
* :math:`\text{GDP}_{n,y} \in \mathbb{R}` Gross domestic product (GDP) in market exchange rates for MACRO reporting
142-
* =========================================================================== ======================================================================================================
134+
* ======================================================================================= =======================================================================================================
135+
* Variable Explanatory text
136+
* ======================================================================================= =======================================================================================================
137+
* :math:`\text{DEMAND}_{n,c,l,y,h} \in \mathbb{R}` Demand level (in equilibrium with MACRO integration)
138+
* :math:`\text{EMISSION_CONSTRAINT_RESCALE}_{n,\widehat{e},\widehat{t},y} \in \mathbb{R}` Annual average marginal of :ref:`emission_constraint`
139+
* :math:`\text{PRICE_COMMODITY}_{n,c,l,y,h} \in \mathbb{R}` Commodity price (undiscounted marginals of :ref:`commodity_balance_gt` and :ref:`commodity_balance_lt`)
140+
* :math:`\text{PRICE_EMISSION}_{n,\widehat{e},\widehat{t},y} \in \mathbb{R}` Emission price (undiscounted marginals of :ref:`emission_constraint`)
141+
* :math:`\text{COST_NODAL_NET}_{n,y} \in \mathbb{R}` System costs at the node level net of energy trade revenues/cost
142+
* :math:`\text{GDP}_{n,y} \in \mathbb{R}` Gross domestic product (GDP) in market exchange rates for MACRO reporting
143+
* ======================================================================================= =======================================================================================================
143144
*
144145
***
145146

146147
Variables
147148
* auxiliary variables for demand, prices, costs and GDP (for reporting when MESSAGE is run with MACRO)
148149
DEMAND(node,commodity,level,year_all,time) demand
150+
EMISSION_CONSTRAINT_RESCALE(node,type_emission,type_tec,type_year) rescaled of marginals of EMISSION_CONSTRAINT constraint
149151
PRICE_COMMODITY(node,commodity,level,year_all,time) commodity price (derived from marginals of COMMODITY_BALANCE constraint)
150152
PRICE_EMISSION(node,type_emission,type_tec,year_all) emission price (derived from marginals of EMISSION_BOUND constraint)
151153
COST_NODAL_NET(node,year_all) system costs at the node level over time including effects of energy trade

Diff for: message_ix/model/MESSAGE/model_solve.gms

+7-7
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ if (%foresight% = 0,
1414
* This is the standard option; the GAMS global variable ``%foresight%=0`` by default.
1515
*
1616
* .. math::
17-
* \min_x \text{OBJ} = \sum_{y \in Y} \text{OBJ}_y(x_y)
17+
* \min_x OBJ = \sum_{y \in Y} OBJ_y(x_y)
1818
***
1919

2020
* reset year in case it was set by MACRO to include the base year before
@@ -40,11 +40,11 @@ if (%foresight% = 0,
4040
) ;
4141

4242
* rescale the dual of the emission constraint to account that the constraint is defined on the average year, not total
43-
EMISSION_CONSTRAINT.m(node,type_emission,type_tec,type_year)$(
43+
EMISSION_CONSTRAINT_RESCALE.l(node,type_emission,type_tec,type_year)$(
4444
EMISSION_CONSTRAINT.m(node,type_emission,type_tec,type_year) ) =
4545
EMISSION_CONSTRAINT.m(node,type_emission,type_tec,type_year)
4646
/ SUM(year$( cat_year(type_year,year) ), duration_period(year) )
47-
* SUM(year$( map_first_period(type_year,year) ), duration_period(year) / df_period(year) * df_year(year) );
47+
;
4848

4949

5050
* assign auxiliary variables DEMAND, PRICE_COMMODITY and PRICE_EMISSION for integration with MACRO and reporting
@@ -54,8 +54,8 @@ EMISSION_CONSTRAINT.m(node,type_emission,type_tec,type_year)$(
5454
/ df_period(year) ;
5555
PRICE_EMISSION.l(node,type_emission,type_tec,year)$( SUM(type_year$( cat_year(type_year,year) ), 1 ) ) =
5656
SMAX(type_year$( cat_year(type_year,year) ),
57-
- EMISSION_CONSTRAINT.m(node,type_emission,type_tec,type_year) )
58-
/ df_year(year) ;
57+
- EMISSION_CONSTRAINT_RESCALE.l(node,type_emission,type_tec,type_year) )
58+
/ df_period(year) * duration_period(year);
5959
PRICE_EMISSION.l(node,type_emission,type_tec,year)$(
6060
PRICE_EMISSION.l(node,type_emission,type_tec,year) = - inf ) = 0 ;
6161

@@ -77,10 +77,10 @@ else
7777
* Loop over :math:`\hat{y} \in Y`, solving
7878
*
7979
* .. math::
80-
* \min_x \ \text{OBJ} = \sum_{y \in \hat{Y}(\hat{y})} \text{OBJ}_y(x_y) \\
80+
* \min_x \ OBJ = \sum_{y \in \hat{Y}(\hat{y})} OBJ_y(x_y) \\
8181
* \text{s.t. } x_{y'} = x_{y'}^* \quad \forall \ y' < y
8282
*
83-
* where :math:`\hat{Y}(\hat{y}) = \{y \in Y | \ |\hat{y}| - |y| < \text{optimization_horizon} \}` and
83+
* where :math:`\hat{Y}(\hat{y}) = \{y \in Y | \ |\hat{y}| - |y| < optimization\_horizon \}` and
8484
* :math:`x_{y'}^*` is the optimal value of :math:`x_{y'}` in iteration :math:`|y'|` of the iterative loop.
8585
*
8686
* The advantage of this implementation is that there is no need to 'store' the optimal values of all decision

0 commit comments

Comments
 (0)