Skip to content

aeromaps.models.impacts.generic_energy_model.bottom_up.abatement_cost

abatement_cost

====================== Module to compute energy abatement costs for different pathways.

EnergyAbatementCost

EnergyAbatementCost(name, pathway_name, pathways_data, *args, **kwargs)

Bases: AeroMAPSModel

Computes specific abatement cost and generic specific abatement cost for a pathway, based on discounted costs and avoided emissions over the lifespan of each vintage.

Parameters:

Name Type Description Default
name str

Name of the model instance ('f"{pathway_name}_bottom_up_abatement_cost"' by default).

required
pathway_name str

Name of the energy pathway for which the abatement cost is computed.

required
pathways_data dict

Dictionary containing data for all pathways, used to complete inputs names necessary.

required

Attributes:

Name Type Description
input_names dict

Dictionary of input variable names populated at model initialisation before MDA chain creation.

output_names dict

Dictionary of output variable names populated at model initialisation before MDA chain creation.

Source code in aeromaps/models/impacts/generic_energy_model/bottom_up/abatement_cost.py
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
def __init__(self, name, pathway_name, pathways_data, *args, **kwargs):
    super().__init__(
        name=name,
        model_type="custom",
        *args,
        **kwargs,
    )
    self.pathway_name = pathway_name

    # Inputs needed: discounted costs, unitary emissions, discounted emissions
    self.input_names = {
        f"{self.pathway_name}_lifespan_unitary_discounted_costs": pd.Series([0.0]),
        f"{self.pathway_name}_lifespan_unitary_emissions": pd.Series([0.0]),
        f"{self.pathway_name}_lifespan_discounted_unitary_emissions": pd.Series([0.0]),
        f"{self.pathway_name}_mean_mfsp": pd.Series([0.0]),
        f"{self.pathway_name}_mean_co2_emission_factor": pd.Series([0.0]),
        "cac_reference_unitary_discounted_costs": pd.Series([0.0]),
        "cac_reference_unitary_discounted_emissions": pd.Series([0.0]),
        "cac_reference_unitary_emissions": pd.Series([0.0]),
        "cac_reference_co2_emission_factor": pd.Series([0.0]),
        "cac_reference_mfsp": pd.Series([0.0]),
        "social_discount_rate": 0.0,
        "exogenous_carbon_price_trajectory": pd.Series([0.0]),
    }

    if f"{self.pathway_name}_eis_plant_lifespan" in pathways_data:
        self.input_names[f"{self.pathway_name}_eis_plant_lifespan"] = 0.0

    # Outputs: specific abatement cost and generic specific abatement cost

    self.output_names = {
        f"{self.pathway_name}_carbon_abatement_cost": pd.Series([0.0]),
        f"{self.pathway_name}_specific_carbon_abatement_cost": pd.Series([0.0]),
        f"{self.pathway_name}_generic_specific_carbon_abatement_cost": pd.Series([0.0]),
    }

compute

compute(input_data)

Compute the specific abatement cost and generic specific abatement cost for each vintage.

Parameters:

Name Type Description Default
input_data

Dictionary containing all input data required for the computation, completed at model instantiation with information from yaml files and outputs of other models.

required

Returns:

Type Description
output_data

Dictionary containing all output data resulting from the computation. Contains outputs defined during model instantiation.

Source code in aeromaps/models/impacts/generic_energy_model/bottom_up/abatement_cost.py
 74
 75
 76
 77
 78
 79
 80
 81
 82
 83
 84
 85
 86
 87
 88
 89
 90
 91
 92
 93
 94
 95
 96
 97
 98
 99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
def compute(self, input_data) -> dict:
    """
    Compute the specific abatement cost and generic specific abatement cost for each vintage.

    Parameters
    ----------
    input_data
        Dictionary containing all input data required for the computation, completed at model instantiation with information from yaml files and outputs of other models.

    Returns
    -------
    output_data
        Dictionary containing all output data resulting from the computation. Contains outputs defined during model instantiation.
    """
    unitary_discounted_costs = input_data.get(
        f"{self.pathway_name}_lifespan_unitary_discounted_costs", pd.Series([0.0])
    )
    unitary_discounted_emissions = input_data.get(
        f"{self.pathway_name}_lifespan_discounted_unitary_emissions", pd.Series([0.0])
    )
    unitary_emissions = input_data.get(
        f"{self.pathway_name}_lifespan_unitary_emissions", pd.Series([0.0])
    )
    mfsp = input_data.get(f"{self.pathway_name}_mean_mfsp", pd.Series([0.0]))
    co2_emission_factor = input_data.get(
        f"{self.pathway_name}_mean_co2_emission_factor", pd.Series([0.0])
    )
    fossil_mfsp = input_data.get("cac_reference_mfsp", pd.Series([0.0]))
    fossil_ef = input_data.get("cac_reference_co2_emission_factor", pd.Series([0.0]))

    reference_unitary_discounted_costs = input_data.get(
        "cac_reference_unitary_discounted_costs", pd.Series([0.0])
    )
    reference_unitary_discounted_emissions = input_data.get(
        "cac_reference_unitary_discounted_emissions", pd.Series([0.0])
    )
    reference_unitary_emissions = input_data.get(
        "cac_reference_unitary_emissions", pd.Series([0.0])
    )

    generic_specific_carbon_abatement_cost = (
        unitary_discounted_costs - reference_unitary_discounted_costs
    ) / (reference_unitary_discounted_emissions - unitary_discounted_emissions)
    specific_carbon_abatement_cost = (
        unitary_discounted_costs - reference_unitary_discounted_costs
    ) / (reference_unitary_emissions - unitary_emissions)

    carbon_abatement_cost = (mfsp - fossil_mfsp) / (fossil_ef - co2_emission_factor)

    # Unit conversion = > from €/gCO2 to €/tCO2
    specific_carbon_abatement_cost *= 1000000
    generic_specific_carbon_abatement_cost *= 1000000
    carbon_abatement_cost *= 1000000

    output_data = {
        f"{self.pathway_name}_specific_carbon_abatement_cost": specific_carbon_abatement_cost,
        f"{self.pathway_name}_generic_specific_carbon_abatement_cost": generic_specific_carbon_abatement_cost,
        f"{self.pathway_name}_carbon_abatement_cost": carbon_abatement_cost,
    }

    self._store_outputs(output_data)
    return output_data

ReferenceAbatementCost

ReferenceAbatementCost(name, pathway_name, configuration_data, *args, **kwargs)

Bases: AeroMAPSModel

Computes specific abatement cost and generic specific abatement cost for a reference pathway, based on discounted costs and avoided emissions over the lifespan of each vintage.

Parameters:

Name Type Description Default
name str

Name of the model instance ('f"{pathway_name}_bottom_up_abatement_cost"' by default).

required
pathway_name str

Name of the energy pathway for which the abatement cost is computed.

required
pathways_data dict

Dictionary containing data for all pathways, used to complete inputs names necessary.

required

Attributes:

Name Type Description
input_names dict

Dictionary of input variable names populated at model initialisation before MDA chain creation.

output_names dict

Dictionary of output variable names populated at model initialisation before MDA chain creation.

Source code in aeromaps/models/impacts/generic_energy_model/bottom_up/abatement_cost.py
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
def __init__(self, name, pathway_name, configuration_data, *args, **kwargs):
    super().__init__(
        name=name,
        model_type="custom",
        *args,
        **kwargs,
    )
    self.pathway_name = pathway_name

    # Inputs needed: discounted costs, unitary emissions, discounted emissions
    self.input_names = {
        "social_discount_rate": 0.0,
        "exogenous_carbon_price_trajectory": pd.Series([0.0]),
    }

    # 2 cases: either ref pathway is defined to-down, as before. Weak CAC definition, considering its average price and EF
    # 1:
    if (
        configuration_data["cost_model"] == "bottom-up"
        and configuration_data["cost_model"] == "bottom-up"
    ):
        self.input_names.update(
            {
                f"{self.pathway_name}_lifespan_unitary_discounted_costs": pd.Series([0.0]),
                f"{self.pathway_name}_lifespan_unitary_emissions": pd.Series([0.0]),
                f"{self.pathway_name}_lifespan_discounted_unitary_emissions": pd.Series([0.0]),
                f"{self.pathway_name}_mean_mfsp": pd.Series([0.0]),
                f"{self.pathway_name}_mean_co2_emission_factor": pd.Series([0.0]),
            }
        )
        self.bottom_up_cac = True
    else:
        print(
            f"⚠️ Warning: reference pathway for CAC ({self.pathway_name}) is not defined as bottom-up, "
            f"using top-down values for CAC computation."
        )
        self.input_names.update(
            {
                f"{self.pathway_name}_mean_mfsp": pd.Series([0.0]),
                f"{self.pathway_name}_mean_co2_emission_factor": pd.Series([0.0]),
            }
        )
        self.bottom_up_cac = False

    # Outputs: specific abatement cost and generic specific abatement cost

    self.output_names = {
        "cac_reference_unitary_discounted_costs": pd.Series([0.0]),
        "cac_reference_unitary_discounted_emissions": pd.Series([0.0]),
        "cac_reference_unitary_emissions": pd.Series([0.0]),
        "cac_reference_co2_emission_factor": pd.Series([0.0]),
        "cac_reference_mfsp": pd.Series([0.0]),
    }

compute

compute(input_data)

Compute the specific abatement cost and generic specific abatement cost for each vintage.

Parameters:

Name Type Description Default
input_data

Dictionary containing all input data required for the computation, completed at model instantiation with information from yaml files and outputs of other models.

required

Returns:

Type Description
output_data

Dictionary containing all output data resulting from the computation. Contains outputs defined during model instantiation.

Source code in aeromaps/models/impacts/generic_energy_model/bottom_up/abatement_cost.py
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
def compute(self, input_data) -> dict:
    """
    Compute the specific abatement cost and generic specific abatement cost for each vintage.

    Parameters
    ----------
    input_data
        Dictionary containing all input data required for the computation, completed at model instantiation with information from yaml files and outputs of other models.

    Returns
    -------
    output_data
        Dictionary containing all output data resulting from the computation. Contains outputs defined during model instantiation.
    """

    ref_mfsp = input_data.get(f"{self.pathway_name}_mean_mfsp", pd.Series([0.0]))
    ref_ef = input_data.get(f"{self.pathway_name}_mean_co2_emission_factor", pd.Series([0.0]))

    if self.bottom_up_cac:
        reference_unitary_discounted_costs = input_data.get(
            f"{self.pathway_name}_lifespan_unitary_discounted_costs", pd.Series([0.0])
        )
        reference_unitary_discounted_emissions = input_data.get(
            f"{self.pathway_name}_lifespan_discounted_unitary_emissions", pd.Series([0.0])
        )
        reference_unitary_emissions = input_data.get(
            f"{self.pathway_name}_lifespan_unitary_emissions", pd.Series([0.0])
        )

    else:
        reference_lifespan = input_data.get(f"{self.pathway_name}_eis_plant_lifespan", 25.0)
        social_discount_rate = input_data.get("social_discount_rate")
        exogenous_carbon_price_trajectory = input_data.get(
            "exogenous_carbon_price_trajectory", pd.Series([0.0])
        )

        reference_unitary_discounted_costs = self._unit_discounted_cumul_costs(
            ref_mfsp, reference_lifespan, social_discount_rate
        )
        (reference_unitary_emissions, reference_unitary_discounted_emissions) = (
            self._unitary_cumul_emissions_vintage(
                ref_ef,
                exogenous_carbon_price_trajectory,
                reference_lifespan,
                social_discount_rate,
            )
        )

    output_data = {
        "cac_reference_unitary_discounted_costs": reference_unitary_discounted_costs,
        "cac_reference_unitary_discounted_emissions": reference_unitary_discounted_emissions,
        "cac_reference_unitary_emissions": reference_unitary_emissions,
        "cac_reference_co2_emission_factor": ref_ef,
        "cac_reference_mfsp": ref_mfsp,
    }

    self._store_outputs(output_data)
    return output_data