calc_erois: Calculate EROIs

View source: R/eroi.R

calc_eroisR Documentation

Calculate EROIs

Description

This function calculates energy return on investment (EROI) values given a data frame of input-output matrices in the physical supply-use table (PSUT) format for an energy conversion chain.

Usage

calc_erois(
  .iomats = NULL,
  e_EIOU = "e_EIOU",
  L_ixp = "L_ixp",
  L_ixp_feed = "L_ixp_feed",
  D = "D",
  C = "C",
  eroi_g_p = "eroi_g_p",
  eroi_g_i = "eroi_g_i",
  eroi_g_p_feed = "eroi_g_p_feed",
  eroi_g_i_feed = "eroi_g_i_feed"
)

Arguments

.iomats

A wide-by-matrices data frame containing matrices that describe the Input-Output structure (using the supply-use table format) of an Energy Conversion Chain. .iomats will likely have been obtained combining the calc_io_mats() and calc_E_EIOU() functions. See the example.

e_EIOU

The name of the column containing e_EIOU vectors in .iomats. Default is "e_EIOU".

L_ixp

The name of the column containing L_ixp matrices in .iomats. Default is "L_ixp".

L_ixp_feed

The name of the column containing L_ixp_feed matrix in .iomats. Default is "L_ixp_feed".

D

The name of the column containing D matrices in .iomats. Default is "D".

C

The name of the column containing C matrix in .iomats. Default is "C".

eroi_g_p

The name of the output column containing vectors of product-level gross EROIs, including both energy use for feedstock and EIOU production. Default is "eroi_g_p".

eroi_g_i

The name of the output column containing vectors of industry-level gross EROIs, including both energy use for feedstock and EIOU production. Default is "eroi_g_i".

eroi_g_p_feed

The name of the output column containing vectors of product-level gross EROIs, including only energy use for feedstock production. Default is "eroi_g_p_feed".

eroi_g_i_feed

The name of the output column containing vectors of industry-level gross EROIs, including only energy use for feedstock production. Default is "eroi_g_i_feed".

Details

The argument .iomats should be a wide-by-matrices data frame.

Other input columns are named by the matrices they contain.

This function adds many additional columns to .iomats, each one containing a particular type of EROI. The default column names use the following naming convention:

  • names of EROIs calculated for products include the string "_p";

  • names of EROIs calculated for industries include the string "_i";

  • names of gross EROIs include the string "_g";

  • names of net EROIs include the string "_n".

In addition, calculations are made based on inclusion of either

  • only EIOU required for feedstock inputs production (in which case "_feed" appears in the name);

  • both EIOU required for feedstock and EIOU inputs production (no additional string in the name).

Output columns include:

  • eroi_g_p: vector of product-level gross EROIs, including both EIOU required for feedstock and EIOU inputs production. The inverse of eroi_g_p is calculated by transpose(i) %*% e_EIOU_hat %*% L_ixp.

  • eroi_g_i: vector of industry-level gross EROIs, including both EIOU required for feedstock and EIOU inputs production. The inverse of eroi_i_p is calculated by transpose(C) * eroi_g_p_inv.

  • eroi_g_p_feed: vector of product-level gross EROIs, including only EIOU required for feedstock inputs production. The inverse of eroi_g_p_feed is calculated by transpose(i) %*% e_EIOU_hat %*% L_ixp_feed.

  • eroi_g_i_feed: vector of industry-level gross EROIs, including only EIOU required for feedstock inputs production. The inverse of eroi_i_p is calculated by transpose(C) %*% eroi_g_p_feed_inv.

Note: All matrix multiplication (%*%) is performed "by name" using matsbyname::matrixproduct_byname().

Value

A data frame that includes several additional EROIs vectors in added columns. See description for details.

Examples

library(IEATools)
UKEnergy2000mats %>%
  dplyr::filter(Last.stage == "Final", Energy.type == "E") %>%
  tidyr::pivot_wider(names_from = "matrix.name", values_from = "matrix") %>%
  calc_io_mats() %>%
  calc_E_EIOU() %>%
  calc_erois()

MatthewHeun/Recca documentation built on Feb. 9, 2024, 6:18 p.m.