calc_eta_fu_Y_eiou | R Documentation |
Final-to-useful efficiencies for energy carriers and sectors
in final demand and energy industry own use
can be calculated from
allocations (C_Y
and C_eiou
),
machine efficiencies (eta_i
), and
(for exergetic efficiencies) exergy-to-energy ratios (phi
).
This function performs those calculations.
By default, the output contains matrices in the same
structure as Y and U_EIOU when last stage is final.
calc_eta_fu_Y_eiou(
.c_mats_eta_phi_vecs = NULL,
C_Y = Recca::alloc_cols$C_Y,
C_eiou = Recca::alloc_cols$C_eiou,
eta_i = Recca::efficiency_cols$eta_i,
phi = Recca::psut_cols$phi,
matricize = TRUE,
energy_type = Recca::energy_types$energy_type,
eta_fu = Recca::efficiency_cols$eta_fu,
energy = Recca::energy_types$e,
exergy = Recca::energy_types$x,
eta_fu_Y_e = paste0(eta_fu, "_Y_", energy),
eta_fu_Y_x = paste0(eta_fu, "_Y_", exergy),
eta_fu_eiou_e = paste0(eta_fu, "_EIOU_", energy),
eta_fu_eiou_x = paste0(eta_fu, "_EIOU_", exergy),
notation = RCLabels::arrow_notation
)
.c_mats_eta_phi_vecs |
A data frame containing allocation matrices ( |
C_Y |
The name of the column in |
C_eiou |
The name of the column in |
eta_i |
The name of the column in |
phi |
The name of the column in |
matricize |
A boolean that tells whether to return matrices of the same
structure as Y and U_EIOU when last stage is final.
Default is |
energy_type , energy , exergy |
See |
eta_fu |
The base name of the output columns.
Default is |
eta_fu_Y_e |
The name of the energy efficiency output column
for energy flowing into final demand (Y).
Default is |
eta_fu_Y_x |
The name of the exergy efficiency output column
for energy flowing into final demand (Y).
Default is |
eta_fu_eiou_e |
The name of the energy efficiency output column
for energy flowing into the energy industry (U_EIOU).
Default is |
eta_fu_eiou_x |
The name of the exergy efficiency output column
for energy flowing into the energy industry (U_EIOU).
Default is |
notation |
The notation for the row and column labels of the matrices and vectors.
Default is |
The matrix formula for calculating energy efficiencies
is eta_fu_E =
C *
eta_i,
where C is one of C_Y or C_EIOU.
The matrix formula for calculating exergy efficiencies
from allocations and machine energy efficiencies is
eta_fu_X =
(phi_u_hat_inv *
(C *
eta_fu_hat)) *
phi_u.
The C_Y matrix is assumed to have rows named with prefixes of final energy carriers and suffixes of the final demand sector into which the final energy carrier flows. The C_EIOU matrix is similar, except that its rows are named with suffixes of the energy industry sector into which the final energy carrier flows. The columns of the C_Y and C_EIOU matrices are named with prefixes of machine names and suffixes of useful energy product made by the machine. See examples.
The eta_i vector of machine efficiencies has rows named with prefixes same as C_Y and C_EIOU columns. The name of the eta_i column is not used. See examples.
The phi vector of exergy-to-energy ratios has rows named with energy carriers that correspond to the prefixes of C_Y and C_EIOU rows and the suffixes of C_Y and C_EIOU columns. See examples.
This function uses matsbyname::vec_from_store_byname()
to construct the eta_i
and phi
vectors before multiplying, thereby
eliminating unnecessary growth of the output matrices.
A data frame or list containing final-to-useful efficiencies.
C_Y <- matrix(c(0.7, 0.3, 0, 0, 0,
0, 0, 0.2, 0.5, 0.3), byrow = TRUE, nrow = 2, ncol = 5,
dimnames = list(c("Electricity -> Non-ferrous metals",
"PSB -> Residential"),
c("Electric arc furnaces -> HTH.600.C",
"Electric lights -> L",
"Wood stoves -> LTH.20.C",
"Wood stoves -> LTH.50.C",
"Wood stoves -> MTH.100.C")))
C_Y
eta_i <- matrix(c(0.9, 0.2, 0.4, 0.4, 0.3), nrow = 5, ncol = 1,
dimnames = list(c("Electric arc furnaces -> HTH.600.C",
"Electric lights -> L",
"Wood stoves -> LTH.20.C",
"Wood stoves -> LTH.50.C",
"Wood stoves -> MTH.100.C"),
"eta_i"))
eta_i
phi <- matrix(c(1, 1.1, 1 - 298.15/(600+273.15), 0.95,
1 - (20 + 273.15)/298.15,
1 - 298.15/(50+273.15),
1 - 298.15/(100+273.15)),
nrow = 7, ncol = 1,
dimnames = list(c("Electricity", "PSB", "HTH.600.C", "L",
"LTH.20.C", "LTH.50.C", "MTH.100.C"),
"phi"))
phi
res <- calc_eta_fu_Y_eiou(C_Y = C_Y, C_eiou = C_Y, eta_i = eta_i, phi = phi)
res$eta_fu_Y_E
res$eta_fu_EIOU_E # Same because C_Y and C_EIOU are same
res$eta_fu_Y_X
res$eta_fu_EIOU_X # Same because C_Y and C_EIOU are same
res2 <- calc_eta_fu_Y_eiou(C_Y = C_Y, C_eiou = C_Y, eta_i = eta_i, phi = phi,
matricize = FALSE)
res2$eta_fu_Y_E
res2$eta_fu_Y_X
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.