Damage vector for life-cycle analysis: Difference between revisions

From Opasnet
Jump to navigation Jump to search
(→‎Calculations: old code removed)
 
(14 intermediate revisions by 2 users not shown)
Line 1: Line 1:
[[Category:Life cycle assessment]]
[[Category:Life cycle assessment]]
[[Category:Contains R code]]
{{variable|moderator=|stub=Yes}}
{{variable|moderator=|stub=Yes}}


Line 8: Line 9:
== Answer ==
== Answer ==


There are two parts to this: damage vector and damage factor. For details, see {{resultlink}}.
For an example of an actual LCA, see [[LCA of a coffee cup]].
<rcode name="answer" embed=1>
library(OpasnetUtils)
# [[Damage vector for life-cycle analysis]]. We need impactsPerDollar, damagesPerImpact, and damages.
objects.latest("Op_en5902", code_name = "initiate")
impactsPerDollar <- EvalOutput(impactsPerDollar)
damagesPerImpact <- EvalOutput(damagesPerImpact)
cat("Impacts per dollar\n")
oprint(head(impactsPerDollar@output))
cat("Damages per impact\n")
oprint(head(damagesPerImpact@output))
</rcode>


== Rationale ==
== Rationale ==


Damages are calculated using this formula:


<math>damages_{s,c,d} = \frac{ activity_s * impactsPD_{s,c} * damagesPI_{c,d} * 365}{normalisation_d},</math>


=== Dependencies ===
where
* damages are the damages caused by the activity in meaningful units such as DALYs,
* activity are the direct inputs of an activity (in Euro), such as in [[LCA of a coffee cup]], table Direct inputs of a coffee cup,
* impactsPD or impactsPerDollar are data from the damage vector (size 430*17) in Opasnet Base of this page,
* damagesPI or damagesPerImpact are data from the Damage factors table below,
* normalisation are impacts turned into meaningful units such as in [[Normalisation data for life cycle assessments#Data]]
* the outcome is scaled by 365 to reflect yearly impacts {{attack|#|I'm not sure why, if the activity is in functional units and it is not clear that the activity happens once per day.|--[[User:Jouni|Jouni]] ([[User talk:Jouni|talk]]) 17:30, 29 January 2014 (EET)}}
* s is purchasing sector,
* c is unique category (this is often summed up so that it does not show in the damage variable),
* d is damage index.


=== Data ===
=== Data ===


<t2b name="damagefactors" index="Unique_categories,Damage_categories" locations="Human health,Ecosystem quality,Climate change,Resources,Water consumption" unit = "-">
'''Damage vector
 
The damage vector contains 430 purchasing sectors and 17 unique categories of impact. See {{resultlink}}.
 
'''Damage factors
 
Damage factors are described in the table below.
 
{{attack|#|The units should be explained!|--[[User:Jouni|Jouni]] ([[User talk:Jouni|talk]]) 07:34, 28 December 2013 (EET)}}
 
<t2b name="Damage factors" index="Unique_categories,Damage_categories" locations="Human health,Ecosystem quality,Climate change,Resources,Water consumption" unit = "-">
Carcinogens|0.0000028|0|0|0|0
Carcinogens|0.0000028|0|0|0|0
Non-carcinogens|0.0000028|0|0|0|0
Non-carcinogens|0.0000028|0|0|0|0
Line 37: Line 80:
</t2b>
</t2b>


===Example of coffee cup===
===Calculations===


<t2b name="coffeecupinputs" index="directRequirements" obs="Result" unit="Euro">
<rcode name="initiate" label="Initiate variables" embed=1>
31131A - Sugar cane mills and refining|0.1
112120 - Dairy cattle and milk production|0.2
311820 - Cookie, cracker, and pasta manufacturing|0.5
311920 - Coffee and tea manufacturing|0.2
221100 - Electric power generation, transmission, and distribution|0.1
322299 - All other converted paper product manufacturing|0.04
335210 - Small electrical appliance manufacturing|0
335221 - Household cooking appliance manufacturing|0.01
</t2b>
 
===Formula===
 
<rcode graphics="1" variables="
name:limit|description:What is the smallest fraction of the total effect you want to see?|default:0.001
">


library(OpasnetUtils)
library(OpasnetUtils)
library(xtable)
library(ggplot2)
library(reshape)


# Take the damage factor table from this page.
# Create the damage factor table based on data from [[Damage vector for life-cycle analysis]]


damagesPerImpact <- opbase.data("Op_en5902.damagefactors") # Download the data from Opasnet Base.
damagesPerImpact <- opbase.data("Op_en5902.damage_factors")
damagesPerImpact <- reshape( # Reshape it into the wide format.
damagesPerImpact$Obs <- NULL
damagesPerImpact[ , colnames(damagesPerImpact) != "Obs"],
damagesPerImpact <- Ovariable("damagesPerImpact", damagesPerImpact)
times = "Result",
timevar = "Unique_categories",
idvar = "Damage_categories",
direction = "wide"
)
colnames(damagesPerImpact) <- gsub("Result.", "", colnames(damagesPerImpact)) # Remove extra "Result." from colnames.
rownames(damagesPerImpact) <- damagesPerImpact[[1]] # Make the first column the rownames.
damagesPerImpact <- damagesPerImpact[ , 2:ncol(damagesPerImpact)] # Remove the first column.
damagesPerImpact <- t(as.matrix(damagesPerImpact)) # Turn the data.frame into a matrix and transpose it.


# Take the impact factor table from the database. Do the same procedures as with damagesPerImpact.
# Take the impact factor table from the database. Do the same procedures as with damagesPerImpact.


impactsPerDollar <- opbase.data("Op_en5902")
impactsPerDollar <- Ovariable("impactsPerDollar", data = opbase.data("Op_en5902"))
impactsPerDollar <- reshape(
impactsPerDollar,
times = "Result",  
timevar = "Unique_categories",
idvar = "Purchasing_sector",
direction = "wide"
)
colnames(impactsPerDollar) <- gsub("Result.", "", colnames(impactsPerDollar))
rownames(impactsPerDollar) <- impactsPerDollar[[1]]
impactsPerDollar <- impactsPerDollar[ , 2:ncol(impactsPerDollar)]
impactsPerDollar <- as.matrix(impactsPerDollar)


# Take the coffee cup direct requirements.
damages <- Ovariable("damages",
dependencies = data.frame(Name = c(
"damagesPerImpact",
"impactsPerDollar",
"activity",
"normalisation"
)),
formula = function(...) {
out <- activity * impactsPerDollar * damagesPerImpact # Actual equation.


coffee <- opbase.data("Op_en5902.coffeecupinputs") # Download the data from Opasnet Base.
# out <- CollapseMarginal(
coffee <- coffee[ , colnames(coffee) != "Obs"]
# out,
# cols = "Unique_categories",
# fun = "sum"
# )


cat("Primary prosesses related to a cup of coffee (in Euro)\n")
# out <- out / normalisation * 365 # Normalise and scale to daily values.


print(xtable(coffee), type = 'html')
return(out)
 
}
coffee <- merge(data.frame(DirectRequirements = rownames(impactsPerDollar)), coffee, all.x = TRUE)
)
coffee$Result <- ifelse(is.na(coffee$Result), 0, coffee$Result)
 
normalisation <- EvalOutput(new("ovariable",
name = "normalisation",
data = tidy(opbase.data("Op_en5904"), objname="normalisation")
))
 
normalisation@output
 
impactsPerDollar <- impactsPerDollar * coffee$Result # Multiply data matrix with activities.


out <- impactsPerDollar %*% damagesPerImpact
objects.store(damagesPerImpact, impactsPerDollar, damages)
 
cat("Ovariables damagesPerImpact, impactsPerDollar, damages saved.\n")
# After matrix operations, turn the output into a data.frame for graphics.
 
out <- as.data.frame(out)
 
out$directRequirements <- rownames(out)
out <- melt(out, idvars = "directRequirements", variable_name = "damages")
out <- out[out$value >= sum(out$value) * limit , ]
out <- dropall(out)
 
# Rename the columns to reflect actual things.
 
colnames(out)[colnames(out) == "value"] <- "Result"
 
damages <- EvalOutput(new("ovariable", name = "Damage", data = out))
 
head(damages@output)
 
damageFractions <- damages / normalisation * 365
 
head(damageFractions@output)
 
cat("Effects smaller than", limit*100, "% of the total effect are not shown.\n")
 
ggplot(out, aes(x = Damage, weight = Result, fill = directRequirements)) + geom_bar() +
theme_grey(base_size = 24) +
theme(axis.text.x = element_text(angle = 45)) +
labs(
title = "Life cycle impacts of a cup of coffee",
x = "Damage",
y = "Amount"
)


</rcode>
</rcode>


==See also==
==See also==
* [[LCA of a coffee cup]]
* [[Normalisation data for life cycle assessments]]


==Keywords==
==Keywords==
Line 157: Line 136:


==Related files==
==Related files==
{{mfiles}}<!-- __OBI_TS:1358344392 -->

Latest revision as of 20:37, 29 January 2014



Question

What are the damages per unit purchased commodity using a life-cycle assessment?

Answer

There are two parts to this: damage vector and damage factor. For details, see {{#opasnet_base_link:Op_en5902}} .

For an example of an actual LCA, see LCA of a coffee cup.

+ Show code

Rationale

Damages are calculated using this formula:

Failed to parse (SVG (MathML can be enabled via browser plugin): Invalid response ("Math extension cannot connect to Restbase.") from server "https://wikimedia.org/api/rest_v1/":): {\displaystyle damages_{s,c,d} = \frac{ activity_s * impactsPD_{s,c} * damagesPI_{c,d} * 365}{normalisation_d},}

where

  • damages are the damages caused by the activity in meaningful units such as DALYs,
  • activity are the direct inputs of an activity (in Euro), such as in LCA of a coffee cup, table Direct inputs of a coffee cup,
  • impactsPD or impactsPerDollar are data from the damage vector (size 430*17) in Opasnet Base of this page,
  • damagesPI or damagesPerImpact are data from the Damage factors table below,
  • normalisation are impacts turned into meaningful units such as in Normalisation data for life cycle assessments#Data
  • the outcome is scaled by 365 to reflect yearly impacts ⇤--#: . I'm not sure why, if the activity is in functional units and it is not clear that the activity happens once per day. --Jouni (talk) 17:30, 29 January 2014 (EET) (type: truth; paradigms: science: attack)
  • s is purchasing sector,
  • c is unique category (this is often summed up so that it does not show in the damage variable),
  • d is damage index.

Data

Damage vector

The damage vector contains 430 purchasing sectors and 17 unique categories of impact. See {{#opasnet_base_link:Op_en5902}} .

Damage factors

Damage factors are described in the table below.

⇤--#: . The units should be explained! --Jouni (talk) 07:34, 28 December 2013 (EET) (type: truth; paradigms: science: attack)

Damage factors(-)
ObsUnique_categoriesHuman healthEcosystem qualityClimate changeResourcesWater consumption
1Carcinogens0.00000280000
2Non-carcinogens0.00000280000
3Respiratory inorganics0.00070000
4Ionizing radiation0.000000000210000
5Ozone layer depletion0.001050000
6Respiratory organics0.000002130000
7Aquatic ecotoxicity00.0000502000
8Terrestrial ecotoxicity00.00791000
9Terrestrial acidification/nutrification01.04000
10Land occupation01.09000
11Aquatic acidification00000
12Aquatic eutrophication00000
13Global warming00100
14Non-renewable energy00010
15Mineral extraction00010
16Water withdrawal00000
17Water consumption00001

Calculations

+ Show code

See also

Keywords

References


Related files