diff --git a/temoa/temoa_model/table_writer.py b/temoa/temoa_model/table_writer.py index 86533183..0bd95f51 100644 --- a/temoa/temoa_model/table_writer.py +++ b/temoa/temoa_model/table_writer.py @@ -699,10 +699,10 @@ def write_costs(self, M: TemoaModel, emission_entries=None, iteration=None): continue var_cost = value(M.CostVariable[r, p, t, v]) - undiscounted_var_cost = activity * var_cost * value(MPL[r, p, t, v]) + undiscounted_var_cost = activity * var_cost * value(M.PeriodLength[p]) model_var_cost = temoa_rules.fixed_or_variable_cost( - activity, var_cost, value(MPL[r, p, t, v]), GDR=GDR, P_0=p_0, p=p + activity, var_cost, value(M.PeriodLength[p]), GDR=GDR, P_0=p_0, p=p ) if '-' in r: exchange_costs.add_cost_record( @@ -740,7 +740,6 @@ def _gather_emission_costs_and_flows(self, M: 'TemoaModel'): # see the note on emissions in the Cost function in temoa_rules GDR = value(M.GlobalDiscountRate) - MPL = M.ModelProcessLife if self.config.scenario_mode == TemoaMode.MYOPIC: p_0 = M.MyopicBaseyear else: @@ -788,12 +787,12 @@ def _gather_emission_costs_and_flows(self, M: 'TemoaModel'): flows[ei] = 0.0 continue undiscounted_emiss_cost = ( - flows[ei] * M.CostEmission[ei.r, ei.p, ei.e] * MPL[ei.r, ei.p, ei.t, ei.v] + flows[ei] * M.CostEmission[ei.r, ei.p, ei.e] * M.PeriodLength[ei.p] ) discounted_emiss_cost = temoa_rules.fixed_or_variable_cost( cap_or_flow=flows[ei], cost_factor=M.CostEmission[ei.r, ei.p, ei.e], - process_lifetime=MPL[ei.r, ei.p, ei.t, ei.v], + process_lifetime=M.PeriodLength[ei.p], GDR=GDR, P_0=p_0, p=ei.p, diff --git a/temoa/temoa_model/temoa_rules.py b/temoa/temoa_model/temoa_rules.py index ae856129..25830b3d 100644 --- a/temoa/temoa_model/temoa_rules.py +++ b/temoa/temoa_model/temoa_rules.py @@ -492,7 +492,7 @@ def PeriodCost_rule(M: 'TemoaModel', p): fixed_or_variable_cost( M.V_FlowOut[r, p, s, d, S_i, S_t, S_v, S_o], M.CostVariable[r, p, S_t, S_v], - MPL[r, p, S_t, S_v], + M.PeriodLength[p], GDR, P_0, p, @@ -509,7 +509,7 @@ def PeriodCost_rule(M: 'TemoaModel', p): fixed_or_variable_cost( M.V_FlowOutAnnual[r, p, S_i, S_t, S_v, S_o], M.CostVariable[r, p, S_t, S_v], - MPL[r, p, S_t, S_v], + M.PeriodLength[p], GDR, P_0, p, @@ -555,7 +555,7 @@ def PeriodCost_rule(M: 'TemoaModel', p): fixed_or_variable_cost( cap_or_flow=M.V_FlowOut[r, p, s, d, i, t, v, o] * M.EmissionActivity[r, e, i, t, v, o], cost_factor=M.CostEmission[r, p, e], - process_lifetime=MPL[r, p, t, v], + process_lifetime=M.PeriodLength[p], GDR=GDR, P_0=P_0, p=p, @@ -572,7 +572,7 @@ def PeriodCost_rule(M: 'TemoaModel', p): fixed_or_variable_cost( cap_or_flow=M.V_FlowOutAnnual[r, p, i, t, v, o] * M.EmissionActivity[r, e, i, t, v, o], cost_factor=M.CostEmission[r, p, e], - process_lifetime=MPL[r, p, t, v], + process_lifetime=M.PeriodLength[p], GDR=GDR, P_0=P_0, p=p,