Economic impacts: Difference between revisions

From Opasnet
Jump to navigation Jump to search
(Text copied fromhttp://iatools.jrc.ec.europa.eu/bin/view/IQTool/EconomicImpactsTop.html)
 
 
(8 intermediate revisions by 2 users not shown)
Line 1: Line 1:
[[Category:Impact Assessment]]
[[Category:Impact assessment]]
[[Category:IA Tools]]
[[Category:IA Tools]]
[[Category:Economy]]
[[Category:Economy]]
{{encyclopedia|moderator=Heta}}
{{method|moderator=Heta}}
 
== Question ==
 
How to assess typical economic impacts in an assessment?
 
== Answer ==
 
== Rationale ==
 
=== External and total costs ===
 
This code tells how to calculate prices of emissions, external costs of health and CO2 emissions, net costs of operating power plants (two different versions), and finally total cost.
 
<rcode name="totalCost" label="Initiate totalCost (for developers only)" store=1 embed=1>
# This code is Op_en3283/totalCost [[Economic impacts]]
library(OpasnetUtils)
 
emissionprice <- Ovariable("emissionprice",
dependencies = data.frame(Name = c("co2price"),Ident = "Op_en7379/externalities"),
formula = function(...) {
temp <- c("CO2direct", "CO2eq", "CO2trade", "PM2.5")
weight <- c(0.33, 0.34, 0.33, 0)
if(openv$N > 0) {
temp <- sample(temp, size = max(1, openv$N), replace = TRUE, prob = weight)
weight <- 1
}
out <- Ovariable(
output = data.frame(
Iter = 1:length(temp),
Pollutant = temp,
Result = weight
),
marginal = c(TRUE, FALSE, FALSE)
)
if(openv$N == 0) {
out <- unkeep(out, cols = "Iter")
}
out <- out * co2price
return(out)
}
)
 
externalCost <- Ovariable("externalCost",
dependencies = data.frame(
Name = c(
"emissions",
"emissionprice",
"DALYs",
"DALYprice"
),
Ident = c(NA,"Op_en7379/externalities",NA,"Op_en7379/externalities")
),
formula = function(...) {
health <- oapply(
unkeep(DALYs, prevresults = TRUE, sources = TRUE),
cols = c(
"Fuel",
"Pollutant",
"Response",
"Population",
"Age",
"Sex",
"Exposure",
"ER_function",
"Exposure_unit"
),
FUN = sum
)
health <- health * DALYprice * 1E-6 * 10 # from € to M€ for 10 a
climate <- oapply(
unkeep(emissions, prevresults = TRUE, sources = TRUE),
cols = c(
"Fuel",
"Emission_site",
"Emission_height"
),
FUN = sum
)
climate <- climate * emissionprice * 1E-6 * 10 # from € to M€ for 10 a
climate <- oapply(climate, cols = "Pollutant", FUN = sum) # Remove joint index Pollutant
out <- OpasnetUtils::combine(health, climate)
# out$Cost <- factor(out$Cost, levels = c(
# "Management cost",
# "Operation cost",
# "Fuel cost",
# "Investment cost",
# "Health",
# "Climate",
# "Profit"
# ))
out$Time <- as.numeric(as.character(out$Time))
out <- oapply(unkeep(out, sources = TRUE), cols = "", FUN = sum)
return(out)
}
)
 
EnergyNetworkCost <- Ovariable("EnergyNetworkCost",
# Energy network costs using profit (includes excesses and deficits but is not strictly plant or fuel-specific.
dependencies =
data.frame(
Name = c(
"plantParameters",
"EnergyNetworkOptim",
"fuelUse",
"fuelPrice",
"temperdays"
),
Ident = c(
NA,
"Op_en5141/EnergyNetworkOptim", # [[Energy balance]]
NA,
"Op_en4151/fuelPrice", # [[Prices of fuels in heat production]]
NA
)
),
formula = function(...) {
 
oper <- plantParameters[plantParameters$Parameter == "Max" , colnames(plantParameters@output) != "Parameter"]
result(oper)[result(oper) != 0] <- 1
 
oper <- plantParameters * oper
 
# Take the first year when a plant is operated and put all investment cost there.
investment <- oper[oper$Parameter == "Investment cost" , ]
investment <- investment[result(investment) > 0 , ]
investment <- investment[order(investment@output$Time) , ]
investment <- investment[!duplicated(investment@output[investment@marginal & colnames(investment@output) != "Time"]) , ]
investment <- unkeep(investment, sources = TRUE)
proinve <- investment # Profit does not include investment, so must subtract.
proinve$Parameter <- "Profit"
 
maintenance <- oper[oper$Parameter == "Management cost" , ]
maintenance <- unkeep(maintenance, sources = TRUE)
promain <- maintenance # Profit does not include maintenance, so must subtract.
promain$Parameter <- "Profit"
 
profit <- EnergyNetworkOptim[EnergyNetworkOptim$Process_variable_name == "Profit" , ]
colnames(profit@output)[colnames(profit@output) == "Process_variable_name"] <- "Parameter"
profit <- profit * temperdays * 10 * 1E-6 # For 10-year periods, € -> M€
profit <- oapply(profit, cols = c("Temperature"), FUN = sum)
profit <- unkeep(profit, cols = c("Process_variable_type"), sources = TRUE, prevresults = TRUE)
profit <- profit * Ovariable(output = data.frame(Plant = "Profit", Result = -1), marginal = c(TRUE, FALSE))
 
    EnergyFlow <- EnergyNetworkOptim[EnergyNetworkOptim$Process_variable_type == "Activity" ,
colnames(EnergyNetworkOptim@output) != "Process_variable_type"
]
colnames(EnergyFlow@output)[colnames(EnergyFlow@output) == "Process_variable_name"] <- "Plant"
EnergyFlow <- unkeep(EnergyFlow, sources = TRUE, prevresults = TRUE)
EnergyFlow <- EnergyFlow * temperdays * 24 * 10 # MW to MWh/10 a
EnergyFlow <- oapply(EnergyFlow, cols = c("Temperature"), FUN = sum)
opercost <- EnergyFlow * oper[oper$Parameter == "Operation cost" , ] * 1E-6 # € to M€
 
fuelcost <- fuelPrice * fuelUse[!fuelUse$Fuel %in% c("Heat", "Electricity") , ] / 3.6E+8 # From MJ to MWh, € to M€, and a to 10 a
colnames(fuelcost@output)[colnames(fuelcost@output) == "Fuel"] <- "Parameter"
fuelcost$Parameter <- "Fuel cost"
fuelcost <- oapply(unkeep(fuelcost, sources = TRUE), cols = c("Burner"), FUN = sum)
cost <- OpasnetUtils::combine(
investment, # Investment cost
maintenance, # Maintenance cost
opercost, # Operation cost
fuelcost, # Fuel cost
profit, # Profit without maintenance and investment
proinve, # Investment cost that reduces profit
promain # Maintenance cost that reduces profit
)
colnames(cost@output)[colnames(cost@output) == "Parameter"] <- "Cost"
cost <- oapply(unkeep(cost, sources = TRUE), cols = "", FUN = sum) # aggregate rows
cost$Time <- as.numeric(as.character(cost$Time))
marginals <- character()
for(i in colnames(cost@output)[cost@marginal]) {
if(any(is.na(cost@output[[i]]))) marginals <- c(marginals, i)
}
if(length(marginals) > 0) {
cost@output <- fillna(cost@output, marginals)
warning(paste("In combine had to fillna marginals", marginals, "\n"))
}
return(cost)
}
)
 
plantCost <- Ovariable("plantCost",
# Energy network costs using income from heat and electricity as profit.
# This is strictly plant and fuel-specific but does not account for excesses and deficits.
dependencies =
data.frame(
Name = c(
"plantParameters",
"EnergyNetworkOptim",
"fuelUse",
"fuelPrice",
"temperdays"
),
Ident = c(
NA,
"Op_en5141/EnergyNetworkOptim", # [[Energy balance]]
NA,
"Op_en4151/fuelPrice", # [[Prices of fuels in heat production]]
NA
)
),
formula = function(...) {
 
oper <- plantParameters[plantParameters$Parameter == "Max" , colnames(plantParameters@output) != "Parameter"]
result(oper)[result(oper) != 0] <- 1
 
oper <- plantParameters * oper
 
# Take the first year when a plant is operated and put all investment cost there.
investment <- oper[oper$Parameter == "Investment cost" , ]
investment <- investment[result(investment) > 0 , ]
investment <- investment[order(investment@output$Time) , ]
investment <- investment[!duplicated(investment@output[investment@marginal & colnames(investment@output) != "Time"]) , ]
investment <- unkeep(investment, sources = TRUE)
maintenance <- oper[oper$Parameter == "Management cost" , ]
maintenance <- unkeep(maintenance, sources = TRUE)
    EnergyFlow <- EnergyNetworkOptim[EnergyNetworkOptim$Process_variable_type == "Activity" ,
colnames(EnergyNetworkOptim@output) != "Process_variable_type"
]
colnames(EnergyFlow@output)[colnames(EnergyFlow@output) == "Process_variable_name"] <- "Plant"
EnergyFlow <- unkeep(EnergyFlow, sources = TRUE, prevresults = TRUE)
EnergyFlow <- EnergyFlow * temperdays * 24 * 10 # MW to MWh/10 a
EnergyFlow <- oapply(EnergyFlow, cols = c("Temperature"), FUN = sum)
opercost <- EnergyFlow * oper[oper$Parameter == "Operation cost" , ] * 1E-6 # € to M€
 
# Include all fuels in fuelcost, also Heat and electricity to get the profits.
fuelcost <- fuelPrice * fuelUse[fuelUse$Plant != "Domestic" , ] / 3.6E+8
# From MJ to MWh, € to M€, and a to 10 a
fuelcost$Fuel <- NULL
fuelcost$Parameter <- "Fuel cost"
fuelcost$Parameter[result(fuelcost) < 0] <- "Sales proceeds"
fuelcost <- oapply(unkeep(fuelcost, sources = TRUE), cols = c("Burner"), FUN = sum)
cost <- OpasnetUtils::combine(
investment, # Investment cost
maintenance, # Maintenance cost
opercost, # Operation cost
fuelcost # Fuel cost and profit
)
colnames(cost@output)[colnames(cost@output) == "Parameter"] <- "Cost"
cost <- oapply(unkeep(cost, sources = TRUE), cols = "", FUN = sum) # aggregate rows
cost$Time <- as.numeric(as.character(cost$Time))
 
return(cost)
}
)
 
totalCost <- Ovariable("totalCost",
dependencies = data.frame(
Name = c(
"plantCost",
"externalCost"
)
),
formula = function(...) {
out <- OpasnetUtils::combine(plantCost, externalCost)
# out$Cost <- factor(out$Cost, levels = c(
# "Management cost",
# "Operation cost",
# "Fuel cost",
# "Investment cost",
# "Health",
# "Climate",
# "Sales proceeds",
# "Profit"
# ))
out$Time <- as.numeric(as.character(out$Time))
out <- oapply(unkeep(out, sources = TRUE), cols = "", FUN = sum)
return(out)
}
)
 
objects.store(emissionprice, externalCost, EnergyNetworkCost, plantCost, totalCost)
cat("Ovariables emissionprice, externalCost, EnergyNetworkCost, plantCost, totalCost stored.\n")
</rcode>
 
=== Net present value ===
 
Net present value is the total value of a product, when all its costs and benefits are discounted and then summed to the present time (as if all costs and benefits would occur today). The effective annual cost is similar, but it is scaled differently: it is as if all costs and benefits would occur every year at constant rate.
 
=== Effective annual cost ===
 
<rcode name="EAC" label="Initiate EAC (for developers only)" embed=1 store=1>
# This code is Op_en3283/EAC [[Economic impacts]]
library(OpasnetUtils)
 
EAC <- Ovariable("EAC",
dependencies = data.frame(Name = c(
"totalCost", # costs and revenues for each year in time
"discount", # discount rate (atomic number)
"time" # vector of years considered
)),
formula = function(...) {
times <- min(times):max(times)
out <- 1 / (1 + discount)^(times - min(times))
out <- Ovariable(
output = data.frame(Time = times, Result = out),
marginal = c(TRUE, FALSE)
)
out <- oapply(totalCost * out, cols = "Time", FUN = sum)
# Change NPV to EAC
out <- out / ((1 - 1/(1+discount)^(max(times) - min(times)))/discount)
return(out)
}
)
 
# An extremely slow attempt to use different time intervals for different unique index combinations.
# This code is NOT used.
 
EACC <- function(
..., # different cost items
discount = 0.03, # discount rate (atomic number)
time = "Time" # column name for time index
) {
allcost <- OpasnetUtils::combine(...)
temp <- unique(allcost[ , allcost@marginal & colnames(allcost@output) != time]@output)
out <- data.frame()
for(i in 1:nrow(temp)) {
temp2 <- allcost
temp2@output <- merge(temp2@output, temp[i , ])
times <- as.numeric(as.character(temp2@output[[time]]))
times <- min(times):max(times)
NPV <- 1 / (1 + discount)^(times - min(times))
NPV <- Ovariable(
output = data.frame(Time = times, Result = NPV),
marginal = c(TRUE, FALSE)
)
NPV <- oapply(temp2 * NPV, cols = "Time", FUN = sum)
# Change NPV to EAC
EAC <- NPV / ((1 - 1/(1+discount)^(max(times) - min(times)))/discount)
out <- rbind(out, EAC@output)
}
return(out)
}
 
objects.store(EAC)
cat("Ovariable EAC stored.\n")
</rcode>
 
=== Dependencies ===
 
* [[External cost]]
* [[:en:Net present value]]
* [[:en:Equivalent annual cost]]
 
== See also ==


*[[Competitiveness, trade and investment flows]]
*[[Competitiveness, trade and investment flows]]
Line 15: Line 369:
*[[Public authorities]]
*[[Public authorities]]
*[[The macroeconomic environment]]
*[[The macroeconomic environment]]
{{Helsinki energy decision 2015}}


==References==
==References==


[http://iatools.jrc.ec.europa.eu/bin/view/IQTool/EconomicImpactsTop.html IA Tools]
[http://iatools.jrc.ec.europa.eu/bin/view/IQTool/EconomicImpactsTop.html IA Tools]

Latest revision as of 04:52, 13 April 2019



Question

How to assess typical economic impacts in an assessment?

Answer

Rationale

External and total costs

This code tells how to calculate prices of emissions, external costs of health and CO2 emissions, net costs of operating power plants (two different versions), and finally total cost.

+ Show code

Net present value

Net present value is the total value of a product, when all its costs and benefits are discounted and then summed to the present time (as if all costs and benefits would occur today). The effective annual cost is similar, but it is scaled differently: it is as if all costs and benefits would occur every year at constant rate.

Effective annual cost

+ Show code

Dependencies

See also

Helsinki energy decision 2015
In English
Assessment Main page | Helsinki energy decision options 2015
Helsinki data Building stock in Helsinki | Helsinki energy production | Helsinki energy consumption | Energy use of buildings | Emission factors for burning processes | Prices of fuels in heat production | External cost
Models Building model | Energy balance | Health impact assessment | Economic impacts
Related assessments Climate change policies in Helsinki | Climate change policies and health in Kuopio | Climate change policies in Basel
In Finnish
Yhteenveto Helsingin energiapäätös 2015 | Helsingin energiapäätöksen vaihtoehdot 2015 | Helsingin energiapäätökseen liittyviä arvoja | Helsingin energiapäätös 2015.pptx

References

IA Tools