Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
182 changes: 96 additions & 86 deletions _energy/_electricity.qmd
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ mn_emissions <- read_rds(file.path(here::here(), "_energy/data/minnesota_county_
wi_emissions <- read_rds(file.path(here::here(), "_energy/data/wisconsin_county_ElecEmissions.RDS")) %>%
rename(county = county_name)

elecEmissions_all <- county_emissions %>%
elec_emissions <- county_emissions %>%
filter(category == "Electricity") %>%
group_by(county_name, emissions_year) %>%
summarise(
Expand All @@ -39,78 +39,76 @@ elecEmissions_all <- county_emissions %>%
)




eiaQA_all <- bind_rows(
read_rds(
file.path(
here::here(),
"_energy/data/minnesota_QA_versusEIAStateProfile.RDS"
)
),
read_rds(
file.path(
here::here(),
"_energy/data/wisconsin_QA_versusEIAStateProfile.RDS"
)
)
)

EIAvMETC_tons <- eiaQA_all %>%
mutate(
downscaled_EIA_total_CO2e_emissions_tons = downscaled_EIA_total_CO2e_emissions_lbs / 2000,
OURS_total_CO2e_emissions_tons = OURS_total_CO2e_emissions_lbs / 2000
) %>%
pivot_longer(
cols = c("downscaled_EIA_total_CO2e_emissions_tons", "OURS_total_CO2e_emissions_tons"),
names_to = "inventory_source",
values_to = "value_emissions"
) %>%
mutate(
inventory_source = recode(inventory_source,
downscaled_EIA_total_CO2e_emissions_tons = "EIA",
OURS_total_CO2e_emissions_tons = "Metropolitan Council"
)
)

nrelQA <- read_rds(
file.path(
here::here(),
"_energy/data-raw/nrel_slope/nrel_emissions.RDS"
)
) %>%
filter(source == "Electricity" && year == 2021) %>%
group_by(county_name) %>%
summarise(total_value_emissions = sum(co2e))

nrel_metc_electricity_comp <- nrelQA %>%
left_join(
elecEmissions_all %>% select(county_name,
MetC = value_emissions
),
by = "county_name"
) %>%
pivot_longer(
cols = c("total_value_emissions", "MetC"),
names_to = "inventory_source",
values_to = "value_emissions"
) %>%
mutate(
inventory_source = recode(inventory_source,
total_value_emissions =
"NREL SLOPE",
MetC =
"Metropolitan Council"
)
)

electricity_2005 <- elecEmissions_all %>%
# eiaQA_all <- bind_rows(
# read_rds(
# file.path(
# here::here(),
# "_energy/data/minnesota_QA_versusEIAStateProfile.RDS"
# )
# ),
# read_rds(
# file.path(
# here::here(),
# "_energy/data/wisconsin_QA_versusEIAStateProfile.RDS"
# )
# )
# )
#
# EIAvMETC_tons <- eiaQA_all %>%
# mutate(
# downscaled_EIA_total_CO2e_emissions_tons = downscaled_EIA_total_CO2e_emissions_lbs / 2000,
# OURS_total_CO2e_emissions_tons = OURS_total_CO2e_emissions_lbs / 2000
# ) %>%
# pivot_longer(
# cols = c("downscaled_EIA_total_CO2e_emissions_tons", "OURS_total_CO2e_emissions_tons"),
# names_to = "inventory_source",
# values_to = "value_emissions"
# ) %>%
# mutate(
# inventory_source = recode(inventory_source,
# downscaled_EIA_total_CO2e_emissions_tons = "EIA",
# OURS_total_CO2e_emissions_tons = "Metropolitan Council"
# )
# )
#
# nrelQA <- read_rds(
# file.path(
# here::here(),
# "_energy/data-raw/nrel_slope/nrel_emissions.RDS"
# )
# ) %>%
# filter(source == "Electricity" && year == 2021) %>%
# group_by(county_name) %>%
# summarise(total_value_emissions = sum(co2e))
#
# nrel_metc_electricity_comp <- nrelQA %>%
# left_join(
# elecEmissions_all %>% select(county_name,
# MetC = value_emissions
# ),
# by = "county_name"
# ) %>%
# pivot_longer(
# cols = c("total_value_emissions", "MetC"),
# names_to = "inventory_source",
# values_to = "value_emissions"
# ) %>%
# mutate(
# inventory_source = recode(inventory_source,
# total_value_emissions =
# "NREL SLOPE",
# MetC =
# "Metropolitan Council"
# )
# )

electricity_2005 <- elec_emissions %>%
filter(emissions_year == 2005) %>%
pull(value_emissions) %>%
sum()

electricity_2021 <- elecEmissions_all %>%
filter(emissions_year == 2021) %>%
electricity_2022 <- elec_emissions %>%
filter(emissions_year == 2022) %>%
pull(value_emissions) %>%
sum()

Expand All @@ -119,16 +117,16 @@ hookaddcap()

## Introduction

Emissions from the electricity generation sector have declined by `r scales::percent((electricity_2005 - electricity_2021) / electricity_2005, accuracy = 0.1)` in the region since 2005, largely as a result of transitions in the grid towards energy sources such as wind and solar [@mpcaClimateChangeTrends2023]. In 2023, Minnesota Governor Walz signed a bill mandating a statewide carbon-free electricity standard by 2040. The law "establishes a standard for utilities to supply Minnesota customers with electricity generated or procured from carbon-free resources, beginning at an amount equal to 80% of retail sales for public utility customers in Minnesota in 2030 and increasing every 5 years to reach 100% for all electric utilities by 2040. The bill also requires that, by 2035, an amount equal to at least 55% of an electric utility’s total retail electric sales to customers in Minnesota must be generated or procured from eligible energy technologies." Wisconsin has not adopted a similar carbon-free electricity standard, but a Wisconsin DNR report noted both the economic gains from such to the renewable energy economy in the state, as well as the opportunities for decarbonization [@holtWisconsinCleanEnergy2019].
Emissions from the electricity generation sector have declined by `r scales::percent((electricity_2005 - electricity_2022) / electricity_2005, accuracy = 0.1)` in the region since 2005, largely as a result of transitions in the grid towards energy sources such as wind and solar [@mpcaClimateChangeTrends2023]. In 2023, Minnesota Governor Walz signed a bill mandating a statewide carbon-free electricity standard by 2040. The law "establishes a standard for utilities to supply Minnesota customers with electricity generated or procured from carbon-free resources, beginning at an amount equal to 80% of retail sales for public utility customers in Minnesota in 2030 and increasing every 5 years to reach 100% for all electric utilities by 2040. The bill also requires that, by 2035, an amount equal to at least 55% of an electric utility’s total retail electric sales to customers in Minnesota must be generated or procured from eligible energy technologies." Wisconsin has not adopted a similar carbon-free electricity standard, but a Wisconsin DNR report noted both the economic gains from such to the renewable energy economy in the state, as well as the opportunities for decarbonization [@holtWisconsinCleanEnergy2019].


```{r tbl-elec-mrow-proportions}
#| tbl-cap: "Grid Mix for MROW subregion of 2021 eGRID"
#| tbl-cap: "Grid Mix for MROW subregion of 2022 eGRID"
#| out-width: "95%"

eGRID_mix <- data.frame(
"Energy Source" = c("Coal", "Oil", "Gas", "Other Fossil", "Nuclear", "Hydro", "Biomass", "Wind", "Solar", "Geothermal", "Other", "Unknown/Purchased Fuel"),
Percentage = c("39.6%", "0.2%", "10.6%", "0.10%", "8.6%", "4.4%", "0.8%", "34.6%", "0.9%", "0.0%", "0.2%", "N/A")
Percentage = c("38%", "0.1%", "8.3%", "0.10%", "8.1%", "3.9%", "0.7%", "39.8%", "1.0%", "0.0%", "0.1%", "N/A")
)

(eGRID_mix) %>%
Expand All @@ -142,10 +140,10 @@ eGRID_mix <- data.frame(
```

### Results
### 2021 county and subsector breakdown
### 2022 county and subsector breakdown

```{r fig-energy-electricity-sector-emissions}
#| fig-cap: "2021 electricity emissions by sector"
#| fig-cap: "2022 electricity emissions by sector"
#| out-width: "95%"


Expand All @@ -155,7 +153,7 @@ fig_energy_electricity_sector_emissions <-
source = "fig-energy-electricity-sector-emissions",
data = county_emissions %>%
filter(
emissions_year == 2021,
emissions_year == 2022,
category == "Electricity"
),
y = ~ reorder(county_name, value_emissions),
Expand Down Expand Up @@ -232,7 +230,7 @@ fig_electricity_baseline
```

```{r fig-ctu-ag-emissions}
#| fig-cap: "2021 city level electricity emissions"
#| fig-cap: "2022 city level electricity emissions per capita"
#| out-width: "95%"
#| out-height: "500px"

Expand All @@ -241,19 +239,23 @@ fig_electricity_baseline
### load emissions and downscaling var (proportion of county ag land)
ctu_elec_emissions <- readRDS(file.path(here::here(), "./_energy/data/_ctu_electricity_emissions.rds"))

electricity_emissions_2021 <- ctu_elec_emissions %>%
filter(inventory_year == 2021) %>%
electricity_emissions_2022 <- ctu_elec_emissions %>%
filter(inventory_year == 2022) %>%
group_by(ctu_name, ctu_class) %>%
summarize(mt_co2e = sum(value_emissions, na.rm = TRUE))

### map CTU scale electricity emissions
### map CTU scale electricity emissions per capita

cprg_ctu <- readRDS(here("_meta", "data", "cprg_ctu.RDS")) %>%
mutate(geometry = st_make_valid(geometry))

ctu_population <- readRDS(here("_meta", "data", "ctu_population.RDS")) %>%
group_by(gnis, ctu_name, ctu_class, inventory_year) %>%
summarize(ctu_population = sum(ctu_population, na.rm = TRUE)) %>%
ungroup()

ctu_elec_map <- left_join(cprg_ctu,
electricity_emissions_2021,
electricity_emissions_2022,
by = c("ctu_name", "ctu_class")
) %>%
filter(
Expand All @@ -265,23 +267,31 @@ ctu_elec_map <- left_join(cprg_ctu,
),
!is.na(county_name)
) %>%
select(ctu_name, geometry, mt_co2e) %>%
replace(is.na(.), 0)
left_join(ctu_population %>%
filter(inventory_year == 2022),
join_by(gnis,
ctu_name,
ctu_class)) %>%
select(ctu_name, geometry, mt_co2e, ctu_population) %>%
replace(is.na(.), 0) %>%
mutate(mt_co2_per_cap = mt_co2e / ctu_population) %>%
filter(!ctu_name %in% c("Fort Snelling",
"Northfield"))


# Define color palette based on the plasma scale from viridis
pal <- colorNumeric(palette = "plasma", domain = ctu_elec_map$mt_co2e)
pal <- colorNumeric(palette = "plasma", domain = ctu_elec_map$mt_co2_per_cap)

# Create the leaflet map
map_ctu_elec <- leaflet(ctu_elec_map) %>%
addTiles() %>% # Add default OpenStreetMap tiles
addPolygons(
fillColor = ~ pal(mt_co2e),
fillColor = ~ pal(mt_co2_per_cap),
color = "black", # Border color
weight = 1,
fillOpacity = 0.9, # Transparency of the fill color
popup = ~ paste(ctu_name, " electricity emissions:", round(mt_co2e, 2)), # Popup with details
label = ~ paste(ctu_name, " emissions:", round(mt_co2e, 2)), # Hover text
label = ~ paste(ctu_name, " emissions per capita:", round(mt_co2_per_cap, 2)), # Hover text
highlightOptions = highlightOptions(
weight = 3,
color = "blue",
Expand All @@ -290,7 +300,7 @@ map_ctu_elec <- leaflet(ctu_elec_map) %>%
) %>%
addLegend(
pal = pal,
values = ~mt_co2e,
values = ~mt_co2_per_cap,
title = "CTU Electricity Emissions",
opacity = 0.7
)
Expand Down
Loading