Building model: Difference between revisions

From Opasnet
Jump to navigation Jump to search
(→‎Calculations: new building model without timepoints. Does not go to negative.)
Line 63: Line 63:
===Calculations===
===Calculations===


<rcode name='buildings' label='Initiate buildings (only for developers)' embed=1>
<rcode name='buildingstest' label='Initiate buildings (only for developers)' embed=1 store=1>
### This code is Op_en6289/buildings on page [[Building model]].
### This code is Op_en6289/buildingstest on page [[Building model]].


library(OpasnetUtils)
library(OpasnetUtils)
Line 73: Line 73:
dependencies = data.frame(Name = c(
dependencies = data.frame(Name = c(
"stockBuildings",
"stockBuildings",
"heatingShares",
"efficiencyShares",
"changeBuildings",
"changeBuildings",
"heatingShares", # This can be indexed by building year (Time) or Observation year (Obsyear)
"efficiencyShares", # Same here
"renovationShares",  
"renovationShares",  
"renovationRate",
"renovationRate", # Fraction of buildings renovated between timepoints
"obstime",
"obstime" # In the new version obstime is ovariable with column Obsyear.
"heating_before", # Should heatingShares be calculated before renovate and timepoints (or after)?
"efficiency_before" # Should efficiencyShares be calculated before renovate and timepoints (or after)?
)),
)),
formula = function(...) {
formula = function(...) {


#### Calculate cb ie. those buildings that were built between Time-1 and Time.
stock <- stockBuildings * obstime * heatingShares * efficiencyShares
#### This has two parts: the stock (stockBuildings) is treated as net construction rate
#### by assuming that after construction Time nothing is demolished.
#### Then this is added to the direct construction data (changeBuildings).


# ### This code can be used to change cumulative building stock data to construction rates of periods.
stock2 <- changeBuildings * obstime # Must contain data about heatings and efficiencies
# stockBuildings@output$Time <- as.numeric(as.character(stockBuildings@output$Time))
stock2@output$Time <- as.factor(stock2@output$Time) # Also stock@output$Time is factor
# years <- sort(unique(stockBuildings@output$Time))
buil <- combine(stock, stock2) # Buildings in the whole timeline
# cb <- stockBuildings
buil <- unkeep(buil, sources = TRUE)
# cb@output$Time <- years[match(cb@output$Time, years) + 1] # Frame shift with time, years 2:n.
buil@output$Age <- as.numeric(as.character(buil@output$Obsyear)) - as.numeric(as.character(buil@output$Time))
# cb@output <- subset(cb@output, !is.na(Time))
buil@marginal <- c(buil@marginal, TRUE)
# cb <- stockBuildings - cb
buil@output <- buil@output[buil@output$Age >= 0 , ]
# cb@output <- orbind(cb, subset(stockBuildings@output, Time = years[1])) # First year
 
# Note that if stockBuildings and changeBuildings have different marginals (typically policies),
# there will be NA in these indices. This will be corrected below.
for(i in colnames(buil@output)[buil@marginal]) {
if(any(is.na(buil@output[[i]]))) {
buil@output <- fillna(buil@output, i)
print(paste("Column", i, "treated with fillna."))
}
}
renovate <- (1 - renovationRate) * (1 - renovationShares) # Assumes that data has row for Renovation: None = 0
renovate@output <- renovate@output[renovate@output$Renovation == "None" , ]
renovate <- combine(renovate, renovationRate * renovationShares)
out <- data.frame()
prevreno <- unkeep(buil * renovate * 0, sources = TRUE) # Previously renovated buildings for the first time point
prevreno@output <- prevreno@output[prevreno@output$Renovation != "None" , ][1,] # Just take one renovated example row
marginals <- colnames(prevreno@output)[prevreno@marginal]
######## This function applies renovations to the building stock and then follows it in time.
for(i in obstime@output$Obsyear) { # Accumulate the building stock
 
# Take the building stock
renovate <- function(
temp <- buil
renoStock, # building stock to be renovated
temp@output <- temp@output[temp@output$Obsyear == i , ] # Take buildings of year i
renovationShares, # shares of different renovations (see Answer)
prevreno@output$Obsyear <- i # update the observation year of the previous renovation
renovationRate, # renovation rate (see Answer)
# Subtrack from the building stock buildings that are already renovated.
obstime # observation times (see Answer)
temp <- combine(temp, -1 * oapply(prevreno, cols = "Renovation", FUN = sum)) # Subtract previously renovated
) {
reno <- unkeep(temp * renovate, sources = TRUE) # Renovate the current non-renovated stock
reno <- renoStock * renovationShares
# If renovate does not match with this timepoint, mark all buildings here as unrenovated.
marginals <- colnames(reno@output)[reno@marginal]
# Is there new renovation in this time point?
reno@output$Age <- as.numeric(as.character(reno@output$Startyear)) - # Startyear is the time of renovation
if(sum(result(reno)) == 0) {
as.numeric(as.character(reno@output$Time)) # Time is the time of construction
reno <- temp * Ovariable(
reno@marginal <- colnames(reno@output) %in% marginals
 
reno <- reno * renovationRate # continuousOps(reno, renovationRate, '*') FIX continuousOps before using
reno <- oapply(reno, cols = c("Age", "Time"), FUN = sum)
 
out <- reno * -1 # Equal amount stops being non-renovated.
out@output$Renovation <- "None"
out <- orbind2(out, reno, use_fillna = TRUE) # Renovated buildings
colnames(renoStock@output)[colnames(renoStock@output) == "Time"] <- "Startyear"
out <- orbind2(
out,
renoStock * Ovariable( # Add non-renovated buildings
output = data.frame(Renovation = "None", Result = 1),  
output = data.frame(Renovation = "None", Result = 1),  
marginal = c(TRUE, FALSE),
marginal = c(TRUE, FALSE)
use_fillna = TRUE
)
)
)
######## NA in indices will ruin timepoints. Therefore must do fillna but with warning.
b <- character()
for(i in colnames(out@output)[out@marginal]) {if(any(is.na(out@output[[i]]))) b <- c(b, i)}
if(length(b) > 0) {
out@output <- fillna(out@output, b)
warning("Missing values had to be filled for timepoints by function fillna in indices: ", b, "\n")
}
}
 
newreno <- combine(prevreno, reno) # Renovated buildings in this time point.
out <- timepoints(out, obstime) # Accumulate over observation time.
# Take the previous timepoints, and previously renovated and now possibly renovated together.
 
out <- rbind(newreno@output, out) # Add previously and now renovated together
return(out)
prevreno <- unkeep(newreno, sources = TRUE)
prevreno@output <- prevreno@output[prevreno@output$Renovation != "None" , ]
}
}
 
out <- Ovariable(output = out, marginal = colnames(out) %in% marginals)
########### Renovations of existing buildings. Heating and efficiency are applied afterwards,
out <- oapply(unkeep(out, sources = TRUE), cols = c("Age", "Time"), FUN = sum)
# so that they may change in the existing stock.
colnames(out@output)[colnames(out@output) == "Obsyear"] <- "Time" # From now on, Time means the time of observation
 
out@output$Time <- as.numeric(as.character(out@output$Time))
stock <- stockBuildings
 
if(heating_before) stock <- stock * heatingShares
if(efficiency_before) stock <- stock * efficiencyShares
 
stock <- renovate(stock, renovationShares, renovationRate, obstime)
 
if(!heating_before) stock <- stock * heatingShares
if(!efficiency_before) stock <- stock * efficiencyShares
 
########### Renovations of constructed buildings. These must contain the heating and efficiency
# data, and those cannot be changed afterwards.
 
change <- renovate(changeBuildings, renovationShares, renovationRate, obstime)
# Add buildings from stock and buildings from construction data
out <- orbind2(
stock,
change,
use_fillna = TRUE,
warn = "This should NOT happen: stock and change don't match when evaluating buildings"
)
out@output$Time <- as.numeric(as.character(out@output$Time))
return(out)
return(out)
}
}

Revision as of 14:59, 14 July 2015



Question

How to estimate the size of the building stock of a city, including heating properties, renovations etc? The situation is followed over time, and different policies can be implemented.

Answer

For examples of model use, see Building stock in Kuopio and Climate change policies and health in Kuopio.

The model uses the following ovariables and their inputs:

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 buildings = (stockBuildings + changeBuildings) * heatingShares * efficiencyShares * renovationShares * renovationRate}

Variables in the assessment model
Ovariable Dependencies Measure Indices Missing data
buildings (from the model) stockBuildings (case-specific data from the user) e.g. Building stock in Kuopio Amount of building stock (typically in floor-m2) at given timepoints. Required indices: Time (time the building was built. If not known, present year can be used for all buildings.) Typical indices: City_area, Building (building type) You must give either stockBuildings, heatingShares, and efficiencyShares or changeBuildings or both. For missing data, use 0.
heatingShares (case-specific data from the user) Fractions of heating types. Should sum up to 1 within each group defined by optional indices. Required indices: Heating. Typical indices: Time, Building If no data, use 1 as a placeholder.
efficiencyShares (case-specific data from the user) Fraction of energy efficiency types. Should sum up to 1 for each group defined by other indices. Required indices: Efficiency. Typical indices: Time, Building. If no data, use 1 as default.
changeBuildings (case-specific data from the user) Construction or demolition rate as floor-m2 at given timepoints. Required indices: Time, Efficiency, Heating. If both stockBuildings and changeBuildings are used, changeBuildings should have all indices in stockBuildings, heatingShares, and efficiencyShares. Typical indices: Building, City_area. If the data is only in stockBuildings, use 0 here.
renovationShares (case-specific data from the user) Fraction of renovation types when renovation is done. Should sum to 1 for each group defined by other indices. Required indices: Renovation, Startyear. Startyear is the time when the renovation is done, and it must be different than the Time index. Typical indices: If no data, use 1 as default.
renovationRate (case-specific data from user. You can also use fairly generic data from Building stock in Kuopio.) Rate of renovation (fraction per time unit). Required indices: Age (the time difference between construction and renovation, i.e. Startyear - Time for each building).
obstime (assessment-specific years of interest) one-column data.frame about the years to be used in output. The column name must be the same as the index name in RenovationShares (typically Startyear). E.g. Climate change policies and health in Kuopio

Rationale

Causal diagram of the building model.

Calculations

+ 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
Urgenche research project 2011 - 2014: city-level climate change mitigation
Urgenche pages

Urgenche main page · Category:Urgenche · Urgenche project page (password-protected)

Relevant data
Building stock data in Urgenche‎ · Building regulations in Finland · Concentration-response to PM2.5 · Emission factors for burning processes · ERF of indoor dampness on respiratory health effects · ERF of several environmental pollutions · General criteria for land use · Indoor environment quality (IEQ) factors · Intake fractions of PM · Land use in Urgenche · Land use and boundary in Urgenche · Energy use of buildings

Relevant methods
Building model · Energy balance · Health impact assessment · Opasnet map · Help:Drawing graphs · OpasnetUtils‎ · Recommended R functions‎ · Using summary tables‎

City Kuopio
Climate change policies and health in Kuopio (assessment) · Climate change policies in Kuopio (plausible city-level climate policies) · Health impacts of energy consumption in Kuopio · Building stock in Kuopio · Cost curves for energy (prioritization of options) · Energy balance in Kuopio (energy data) · Energy consumption and GHG emissions in Kuopio by sector · Energy consumption classes (categorisation) · Energy consumption of heating of buildings in Kuopio · Energy transformations (energy production and use processes) · Fuels used by Haapaniemi energy plant · Greenhouse gas emissions in Kuopio · Haapaniemi energy plant in Kuopio · Land use in Kuopio · Building data availability in Kuopio · Password-protected pages: File:Heat use in Kuopio.csv · Kuopio housing

City Basel
Buildings in Basel (password-protected)

Energy balances
Energy balance in Basel · Energy balance in Kuopio · Energy balance in Stuttgart · Energy balance in Suzhou


References


  • Sundell, J., Levin, H., Nazaroff, W. W., Cain, W. S., Fisk, W. J., Grimsrud, D. T., Gyntelberg, F., Li, Y., Persily, A. K., Pickering, A. C., Samet, J. M., Spengler, J. D., Taylor, S. T., Weschler, C. J., Ventilation rates and health: multidisciplinary review of the scientific literature. INDOOR AIR 21 (2011) 3: 191 - 204. doi:10.1111/j.1600-0668.2010.00703.x ISSN 0905-6947
  • Brightman, H. S., Milton, D. K., Wypij, D., Burge, H. A., Spengler, J. D. Evaluating building-related symptoms using the US EPA BASE study results. INDOOR AIR 18 (2008) 4: 335-345. doi:10.1111/j.1600-0668.2008.00557.x
  • Nishioka, Y, Levy, JI, Norris, GA, Bennett, DH, Spengler, JD. A risk-based approach to health impact assessment for input-output analysis - Part 2: Case study of insulation. INTERNATIONAL JOURNAL OF LIFE CYCLE ASSESSMENT 10 (2005) 4: 255-262. doi:10.1065/lca2004.10.186.2 ISSN 0948-3349
  • Samet, JM, Spengler, JD. Indoor environments and health: Moving into the 21st century. AMERICAN JOURNAL OF PUBLIC HEALTH 93 (2003) 9: 1489-1493. 10.2105/AJPH.93.9.1489 doi:DI 10.2105/AJPH.93.9.1489 ISSN 0090-0036
  • Nishioka, Y, Levy, JI, Norris, GA, Wilson, A, Hofstetter, P, Spengler, JD. Integrating risk assessment and life cycle assessment: A case study of insulation RISK ANALYSIS 22 (2002) 5: 1003-1017. doi:10.1111/1539-6924.00266 ISSN 0272-4332