Analysis of the model output
An example of a report that can be generated from the model output, using results from the IDEEA electricity model.
Load the model output
Here we use pre-saved results from the IDEEA electricity model, 5 or
32 regions, as described in the
vignette("electricity")
.
ideea_scenarios_list()
# load reference scenario
load_scenario(
file.path(ideea_scenarios(),
"CAP_IDEEA_ELC_reg32_d365_h24_2060"
# "REF_IDEEA_ELC_reg32_d365_h24_2060"
)
)
# load carbon constrained scenario
load_scenario(
file.path(ideea_scenarios(),
"REF_IDEEA_ELC_reg32_d365_h24_Y2050"
# "CAP_IDEEA_ELC_reg32_d365_h24_2060"
)
)
# combine scenarios in one list for comparison
sns <- list(
# REF_2060 = .scen$REF,
CAP_2060 = .scen$CAP
)
Compare the results
Installed capacity
vTechCap <- getData(
scen = sns,
name = c("vTechCap"), # capacity variable of technologies
tech_ = "^E", # select only electricity generators (start with "E")
process = TRUE, # use unified set-name for all processes (rename 'tech' -> 'process')
digits = 1, # round to 2 digits
drop.zeros = T, # drop zero values
merge = TRUE # merge tables
) |>
drop_process_cluster() |> # erase cluster from process name
drop_process_vintage() # erase vintage-year from process name
vTechCap_conv <- vTechCap |>
filter(grepl("ELC2EDC|EDC2ELC", process)) # converters
vTechCap_gen <- vTechCap |>
anti_join(vTechCap_conv, by = "process") # keep only generators
vStorageCap <- getData(
scen = sns,
name = c("vStorageCap"), # capacity variables of storage technologies
# tech_ = "^S", # select only storage technologies (start with "S")
process = TRUE, # use unified set-name for all processes (rename 'tech' -> 'process')
digits = 1, # round to 2 digits
drop.zeros = T, # drop zero values
merge = TRUE # merge tables
) |>
drop_process_vintage() # erase vintage-year from process name
# combine technologies and storage
vCap <- bind_rows(vTechCap, vStorageCap)
vCap$process |> unique()
Capacity maps
ideea_sf <- get_ideea_map(nreg = 32)
vTechCap_gen_sf <- ideea_sf |>
right_join(vTechCap_gen, by = c("reg32" = "region"),
relationship = "many-to-many")
ggplot() +
geom_sf(fill = "grey", data = ideea_sf) +
geom_sf(aes(fill = value), data = vTechCap_sf) +
scale_fill_viridis_c(option = "H", transform = "sqrt", name = "GW") +
facet_wrap(~process) +
theme_ideea_map()
Transmission capacity
vTradeCap <- getData(sns, "vTradeCap", merge = TRUE, process = T,
digits = 1, drop.zeros = T)
tra_lines_coord <- ideea_data$transmission[[regN]] |>
filter(case == "newlines_v01") |>
select(matches("region|lon|lat|trd_name"))
vTradeCap_coord <- vTradeCap |>
left_join(tra_lines_coord,
by = c("process" = "trd_name_ac"),
relationship = "many-to-many") |>
select(-trd_name_dc) |>
as.data.table() |>
rows_patch(
select(
rename(tra_lines_coord, process = trd_name_dc),
-trd_name_ac
), by = c("process"), unmatched = "ignore") |>
mutate(
type = str_extract(process, "HVAC|HVDC"),
) |>
as.data.table()
ggplot() +
geom_sf(data = ideea_sf, fill = "wheat") +
geom_segment(
aes(
x = lon.x, y = lat.x, xend = lon.y, yend = lat.y,
linewidth = value, color = type
),
# color = "dodgerblue",
lineend = "round", alpha = .75,
data = filter(vTradeCap_coord, value >= 1)
) +
# geom_point(aes(lon, lat), data = points_coord_r32, color = "red") +
labs(x = "", y = "") +
facet_grid(year~scenario) +
theme_ideea_map()
Generation mix
vTechOut_ELC <- getData(sns, "vTechOut", tech_ = "^E", process = T, digits = 2,
drop.zeros = TRUE, merge = TRUE) |>
drop_process_cluster() |>
drop_process_vintage()
vTechOut_ELC_year <- vTechOut_ELC |>
group_by(scenario, process, year) |>
summarise(TWh = sum(value) / 1e3, .groups = "drop") |>
filter(!process %in% c("ELC2EDC", "EDC2ELC")) # drop converters
ggplot(vTechOut_ELC_year) +
geom_bar(aes(x = scenario, y = TWh, fill = process), stat = "identity") +
scale_fill_viridis_d(option = "H", direction = -1) +
theme_bw()
Emissions
all_emis |>
group_by(scenario, comm, year) |>
summarise(Mt = sum(value) / 1e3, .groups = "drop") |>
pivot_wider(names_from = scenario, values_from = Mt) |>
kableExtra::kable(
# caption = "Emissions from fuel combustion and processes, CO2 Mt, kt others",
align = "c"
)