extend_to_useful_helper: A helper function for extending to the useful energy/exergy...

View source: R/final_to_useful.R

extend_to_useful_helperR Documentation

A helper function for extending to the useful energy/exergy stage

Description

The helper function is needed, because moving from final to useful energy occurs for both the final demand matrix (Y) and the energy industry own use matrix (U_eiou). The calculations are identical, so we factor the calculations into this function.

Usage

extend_to_useful_helper(
  .sutdata = NULL,
  dest_mat,
  C_mat,
  eta_fu_vec,
  product_type = IEATools::row_col_types$product,
  industry_type = IEATools::row_col_types$industry,
  arr_note = RCLabels::arrow_notation,
  from_note = RCLabels::from_notation,
  add_to_U = "add_to_U",
  add_to_V = "add_to_V",
  add_to_dest = "add_to_dest",
  details_fu = "details_fu"
)

Arguments

.sutdata

a data frame containing dest_mat, C_mat, and eta_fu_vec columns for calculations. Default is NULL.

dest_mat

a Y or U_eiou matrix (Product x Industry) that is a destination for final energy in an energy conversion chain or the string name of such matrices in .sutadata.

C_mat

an allocation matrix (either Y or U_eiou, both Product x Industry), indicating the distribution of final energy carriers (Products) to final-to-useful energy conversion machines (Industries). C_mat should have been created by form_C_mats(). This argument could also be the string name of such matrices in .sutdata.

eta_fu_vec

an efficiency column vector indicating the efficiency (column) of final-to-useful energy conversion machines (rows). eta_fu_vec should have been created by form_eta_fu_phi_u_vecs(). This argument could also be the string name of such matrices in .sutdata.

product_type

a string identifying product row or column types. Default is "IEATools::row_col_types$product".

industry_type

a string identifying industry row or column types. Default is "IEATools::row_col_types$industry".

arr_note

a row and column name notation vector that indicates a source -> destination relationship. arr_note is used for the eta_fu matrix, among others. See matsbyname::notation_vec(). Default is RCLabels::arrow_notation.

from_note

a row and column name notation vector that indicates a ⁠destination [from source]⁠ relationship. from_note is used for the columns of some intermediate matrices. See matsbyname::notation_vec(). Default is RCLabels::from_notation.

add_to_U

a string name for the matrix to be added to a use matrix. Default is "add_to_U".

add_to_V

a string name for the matrix to be added to a make matrix. Default is "add_to_V".

add_to_dest

a string name for the matrix to replace some entries previous destination matrix. Default is "repl_dest".

details_fu

A string name for the matrix containing detailed information about the final-to-useful extension, namely, final energy product, destination sector, final-to-useful machine, and useful energy product.

Value

a named list containing four items: add_to_U_f (a matrix to be added to a use (U) matrix), add_to_V_f (a matrix to be added to a make (V) matrix), add_to_dest_mat (a matrix to replace the destination matrix, typically Y_f or U_eiou), and details_fu (a matrix that retails all details for final energy product, destination sector, final-to-useful machine, and useful energy product).


MatthewHeun/IEATools documentation built on Feb. 6, 2024, 3:29 p.m.