cdmAcm0002-methodology.RmdThis vignette demonstrates how cdmAcm0002 translates the
CDM large-scale methodology ACM0002 into reproducible R code. The
package focuses on grid-connected renewable electricity generation
projects and provides tools to run applicability checks, calculate
baseline and project emissions, and summarise monitoring periods.
check_applicability_grid_connection("grid-connected", export_share = 0.92)
#> [1] TRUE
check_applicability_renewable_technology("wind")
#> [1] TRUEBoth conditions must be satisfied to proceed with ACM0002 calculations.
monitoring_data <- simulate_acm0002_dataset(6, seed = 2025)
knitr::kable(head(monitoring_data))
#> Warning: 'xfun::attr()' is deprecated.
#> Use 'xfun::attr2()' instead.
#> See help("Deprecated")
#> Warning: 'xfun::attr()' is deprecated.
#> Use 'xfun::attr2()' instead.
#> See help("Deprecated")| period | gross_generation_mwh | auxiliary_consumption_mwh | combined_margin_ef | fossil_fuel_tj | fossil_emission_factor | electricity_import_mwh | import_emission_factor | leakage_emissions |
|---|---|---|---|---|---|---|---|---|
| Period 01 | 15744.91 | 631.7690 | 0.7289518 | 0.0368731 | 74 | 28.84151 | 0.75 | 0 |
| Period 02 | 15042.77 | 593.6009 | 0.7882455 | 0.0742902 | 74 | 16.98648 | 0.75 | 0 |
| Period 03 | 15927.79 | 572.4028 | 0.8033081 | 0.0475543 | 74 | 20.82200 | 0.75 | 0 |
| Period 04 | 16526.99 | 656.1721 | 0.7403152 | 0.0573379 | 74 | 30.50716 | 0.75 | 0 |
| Period 05 | 15445.17 | 568.3443 | 0.7473926 | 0.0785278 | 74 | 26.19867 | 0.75 | 0 |
| Period 06 | 14804.57 | 459.5957 | 0.7708835 | 0.0567153 | 74 | 37.22625 | 0.75 | 0 |
The simulated data includes gross generation, auxiliary consumption, fossil back-up fuel use, and grid emission factors for each monitoring period.
net_generation <- calculate_net_electricity_generation(
monitoring_data$gross_generation_mwh,
monitoring_data$auxiliary_consumption_mwh
)
baseline_emissions <- calculate_baseline_emissions(
net_generation,
monitoring_data$combined_margin_ef
)
project_emissions <- calculate_project_emissions(
monitoring_data$fossil_fuel_tj,
monitoring_data$fossil_emission_factor,
monitoring_data$electricity_import_mwh,
monitoring_data$import_emission_factor
)
emission_reductions <- calculate_emission_reductions(
baseline_emissions,
project_emissions,
monitoring_data$leakage_emissions
)
knitr::kable(
tibble::tibble(
period = monitoring_data$period,
net_generation,
baseline_emissions,
project_emissions,
emission_reductions
)
)
#> Warning: 'xfun::attr()' is deprecated.
#> Use 'xfun::attr2()' instead.
#> See help("Deprecated")
#> Warning: 'xfun::attr()' is deprecated.
#> Use 'xfun::attr2()' instead.
#> See help("Deprecated")| period | net_generation | baseline_emissions | project_emissions | emission_reductions |
|---|---|---|---|---|
| Period 01 | 15113.14 | 11016.75 | 24.35974 | 10992.39 |
| Period 02 | 14449.17 | 11389.49 | 18.23733 | 11371.25 |
| Period 03 | 15355.38 | 12335.10 | 19.13552 | 12315.97 |
| Period 04 | 15870.81 | 11749.41 | 27.12337 | 11722.28 |
| Period 05 | 14876.83 | 11118.83 | 25.46006 | 11093.37 |
| Period 06 | 14344.98 | 11058.31 | 32.11662 | 11026.19 |
period_summary <- aggregate_monitoring_periods(monitoring_data)
knitr::kable(period_summary)
#> Warning: 'xfun::attr()' is deprecated.
#> Use 'xfun::attr2()' instead.
#> See help("Deprecated")
#> Warning: 'xfun::attr()' is deprecated.
#> Use 'xfun::attr2()' instead.
#> See help("Deprecated")| period | gross_generation_mwh | auxiliary_consumption_mwh | net_electricity_mwh | combined_margin_ef | fossil_fuel_tj | fossil_emission_factor | electricity_import_mwh | import_emission_factor | leakage_emissions | baseline_emissions | project_emissions | emission_reductions |
|---|---|---|---|---|---|---|---|---|---|---|---|---|
| Period 01 | 15744.91 | 631.7690 | 15113.14 | 0.7289518 | 0.0368731 | 74 | 28.84151 | 0.75 | 0 | 11016.75 | 24.35974 | 10992.39 |
| Period 02 | 15042.77 | 593.6009 | 14449.17 | 0.7882455 | 0.0742902 | 74 | 16.98648 | 0.75 | 0 | 11389.49 | 18.23733 | 11371.25 |
| Period 03 | 15927.79 | 572.4028 | 15355.38 | 0.8033081 | 0.0475543 | 74 | 20.82200 | 0.75 | 0 | 12335.10 | 19.13552 | 12315.97 |
| Period 04 | 16526.99 | 656.1721 | 15870.81 | 0.7403152 | 0.0573379 | 74 | 30.50716 | 0.75 | 0 | 11749.41 | 27.12337 | 11722.28 |
| Period 05 | 15445.17 | 568.3443 | 14876.83 | 0.7473926 | 0.0785278 | 74 | 26.19867 | 0.75 | 0 | 11118.83 | 25.46006 | 11093.37 |
| Period 06 | 14804.57 | 459.5957 | 14344.98 | 0.7708835 | 0.0567153 | 74 | 37.22625 | 0.75 | 0 | 11058.31 | 32.11662 | 11026.19 |
totals <- estimate_emission_reductions_acm0002(monitoring_data)
knitr::kable(totals)
#> Warning: 'xfun::attr()' is deprecated.
#> Use 'xfun::attr2()' instead.
#> See help("Deprecated")
#> Warning: 'xfun::attr()' is deprecated.
#> Use 'xfun::attr2()' instead.
#> See help("Deprecated")| total_gross_generation_mwh | total_auxiliary_consumption_mwh | total_net_electricity_mwh | total_baseline_emissions | total_project_emissions | total_leakage_emissions | total_emission_reductions |
|---|---|---|---|---|---|---|
| 93492.2 | 3481.885 | 90010.31 | 68667.89 | 146.4326 | 0 | 68521.46 |
reference_table <- tibble::tibble(
Function = c(
"check_applicability_grid_connection",
"check_applicability_renewable_technology",
"calculate_net_electricity_generation",
"calculate_baseline_emissions",
"calculate_project_emissions",
"calculate_emission_reductions",
"aggregate_monitoring_periods",
"estimate_emission_reductions_acm0002",
"simulate_acm0002_dataset"
),
Signature = c(
"(connection_status, export_share = 1, minimum_export = 0.9)",
"(technology, allowed = c('wind', 'solar', 'hydro', 'geothermal', 'biomass'))",
"(gross_generation_mwh, auxiliary_consumption_mwh)",
"(net_electricity_mwh, combined_margin_ef)",
"(fossil_fuel_tj, fossil_emission_factor, electricity_import_mwh = 0, import_emission_factor = 0)",
"(baseline_emissions, project_emissions, leakage_emissions = 0)",
"(monitoring_data)",
"(monitoring_data)",
"(n_periods = 12, seed = NULL)"
),
Purpose = c(
"Verify that the plant exports renewable electricity to the grid.",
"Ensure the generation technology is eligible under ACM0002.",
"Compute net electricity delivered to the grid.",
"Apply the combined margin emission factor to net electricity.",
"Estimate project emissions from fossil back-up systems and imports.",
"Derive emission reductions from baseline, project, and leakage values.",
"Summarise monitoring periods with emissions metrics.",
"Return project-level totals for reporting.",
"Generate synthetic monitoring datasets for testing and demos."
)
)
knitr::kable(reference_table)
#> Warning: 'xfun::attr()' is deprecated.
#> Use 'xfun::attr2()' instead.
#> See help("Deprecated")
#> Warning: 'xfun::attr()' is deprecated.
#> Use 'xfun::attr2()' instead.
#> See help("Deprecated")| Function | Signature | Purpose |
|---|---|---|
| check_applicability_grid_connection | (connection_status, export_share = 1, minimum_export = 0.9) | Verify that the plant exports renewable electricity to the grid. |
| check_applicability_renewable_technology | (technology, allowed = c(‘wind’, ‘solar’, ‘hydro’, ‘geothermal’, ‘biomass’)) | Ensure the generation technology is eligible under ACM0002. |
| calculate_net_electricity_generation | (gross_generation_mwh, auxiliary_consumption_mwh) | Compute net electricity delivered to the grid. |
| calculate_baseline_emissions | (net_electricity_mwh, combined_margin_ef) | Apply the combined margin emission factor to net electricity. |
| calculate_project_emissions | (fossil_fuel_tj, fossil_emission_factor, electricity_import_mwh = 0, import_emission_factor = 0) | Estimate project emissions from fossil back-up systems and imports. |
| calculate_emission_reductions | (baseline_emissions, project_emissions, leakage_emissions = 0) | Derive emission reductions from baseline, project, and leakage values. |
| aggregate_monitoring_periods | (monitoring_data) | Summarise monitoring periods with emissions metrics. |
| estimate_emission_reductions_acm0002 | (monitoring_data) | Return project-level totals for reporting. |
| simulate_acm0002_dataset | (n_periods = 12, seed = NULL) | Generate synthetic monitoring datasets for testing and demos. |
| Step | Description | Functions |
|---|---|---|
| 1 | Run ACM0002 applicability checks |
check_applicability_grid_connection(),
check_applicability_renewable_technology()
|
| 2 | Simulate or load monitoring data | simulate_acm0002_dataset() |
| 3 | Calculate net generation and emissions |
calculate_net_electricity_generation(),
calculate_baseline_emissions(),
calculate_project_emissions()
|
| 4 | Derive emission reductions | calculate_emission_reductions() |
| 5 | Aggregate monitoring periods | aggregate_monitoring_periods() |
| 6 | Produce project totals | estimate_emission_reductions_acm0002() |