From e5094941d68daf48e2c8ea8b9103557c48e451be Mon Sep 17 00:00:00 2001 From: Ben Date: Thu, 17 Oct 2024 12:32:33 +0200 Subject: [PATCH] Update the notation of new items in models.py --- message_ix/model/MESSAGE/model_core.gms | 4 ++-- message_ix/models.py | 30 +++++++++++++++++++++++++ 2 files changed, 32 insertions(+), 2 deletions(-) diff --git a/message_ix/model/MESSAGE/model_core.gms b/message_ix/model/MESSAGE/model_core.gms index c54baac25..8d142782a 100644 --- a/message_ix/model/MESSAGE/model_core.gms +++ b/message_ix/model/MESSAGE/model_core.gms @@ -145,7 +145,7 @@ Variables * =========================================================================== ====================================================================================================== * * .. warning:: -* Please be aware that transitioning from one period length to another for consecutive periods may result in false values of :math:`\text{PRICE_EMISSION}`. +* Please be aware that transitioning from one period length to another for consecutive periods may result in false values of :math:`\text{PRICE_EMISSION}`. * Please see `this issue `_ for further information. We are currently working on a fix. *** @@ -426,7 +426,7 @@ COST_ACCOUNTING_NODAL(node, year).. + SUM(relation$( relation_cost(relation,node,year) ), relation_cost(relation,node,year) * REL(relation,node,year) ) * cost terms associated with linear relations at the sub-annual time slice level - + SUM((relation,time)$( relation_cost(relation,node,year) AND + + SUM((relation,time)$( relation_cost_time(relation,node,year,time) AND (map_relation_time(relation,node,year,time) OR map_relation_year(relation,node,year,time) ) ), relation_cost_time(relation,node,year,time) * REL_TIME(relation,node,year,time ) ) * implementation of slack variables for constraints to aid in debugging diff --git a/message_ix/models.py b/message_ix/models.py index c89acb8da..3f2950ae3 100644 --- a/message_ix/models.py +++ b/message_ix/models.py @@ -374,6 +374,8 @@ def initialize(cls, scenario): _set("cat_tec", "type_tec t") _set("cat_year", "type_year y") _set("is_capacity_factor", "nl t yv ya h") +_set("is_relation_lower_time", "r nr yr h") +_set("is_relation_upper_time", "r nr yr h") _set("level_renewable", "l") _set("level_resource", "l") _set("level_stocks", "l") @@ -469,11 +471,15 @@ def initialize(cls, scenario): par("ref_new_capacity", "nl t yv") par("ref_relation", "r nr yr") par("relation_activity", "r nr yr nl t ya m") +par("relation_activity_time", "r nr yr nl t ya m h") par("relation_cost", "r nr yr") +par("relation_cost_time", "r nr yr h") par("relation_lower", "r nr yr") +par("relation_lower_time", "r nr yr h") par("relation_new_capacity", "r nr yr t") par("relation_total_capacity", "r nr yr t") par("relation_upper", "r nr yr") +par("relation_upper_time", "r nr yr h") par("reliability_factor", "n t ya c l h q") par("renewable_capacity_factor", "n c g l y") par("renewable_potential", "n c g l y") @@ -568,6 +574,11 @@ def initialize(cls, scenario): "r nr yr", "Auxiliary variable for left-hand side of user-defined relations", ) +var( + "REL_TIME", + "r nr yr", + "Time-dependent auxiliary variable for left-hand side of user-defined relations", +) var( "REN", "n t c g y h", @@ -832,6 +843,25 @@ def initialize(cls, scenario): "", "Auxiliary equation to simplify the implementation of relations", ) +equ( + "RELATION_EQUIVALENCE_TIME", + "", "time dependent auxiliary equation to simplify the implementation of relations", + ) +equ( + "RELATION_EQUIVALENCE_YEAR", + "", + "time dependent auxiliary equation to simplify the implementation of relations at" + " the year level", + ) +equ( + "RELATION_CONSTRAINT_UP_TIME", + "", + "time dependentupper bound of relations (linear constraints)", + ) +equ( + "RELATION_CONSTRAINT_LO_TIME", + "", + "time dependent lower bound of relations (linear constraints)") equ( "RENEWABLES_CAPACITY_REQUIREMENT", "",