## Question

What is the amount of road traffic in Helsinki, measured as car-kilometres, passenger-kilometres, bus-kilometres etc., and also as fuel/energy consumption?

• Model run 17.12.2018 [1]

 ```# This is code Op_en7926/answer on page [[Road traffic in Helsinki]] library(OpasnetUtils) library(ggplot2) objects.latest("Op_en6007", code_name="hnh2035") # [[OpasnetUtils/Drafts]] combineLines, pushIndicatorGraph objects.latest("Op_en6007", code_name="miscellaneous") # [[OpasnetUtils/Drafts]] truncateIndex objects.latest("Op_en7926", code_name="roadkm") # [[Road traffic in Helsinki]] roadkm roadkm <- EvalOutput(roadkm) clean <- function(ova) { ova\$Scenario[is.na(ova\$Scenario) | ova\$Scenario %in% c("","NA")] <- "toteutunut" tmp <- unkeep(ova, sources=TRUE) # tmp <- oapply(tmp, INDEX="Vehicle",sum)@output # Find the top 6: # gasoline car 29652.63589 # diesel car 10380.38549 # vans 5130.52399 # motorcycles 1983.26063 # trucks 1832.49332 # buses 1077.48932 # leave this to get electric cars in # electric car 600.54554 # > levels(tmp\$Vehicle) # [1] "diesel car" "diesel hybrid" "electric car" # [4] "gasoline car" "gasoline CNG car" "gasoline ethanol car" # [7] "gasoline hybrid" "hybrid with diesel" "hybrid with gasoline" # [10] "other car" "" "private cars" # [13] "trucks" "buses" "motorcycles" # [16] "microcars" "mopeds" "vans" # [19] "Tieliikenne yhteensä" "YHTEENSÄ kadut " "YHTEENSÄ tiet" levels(tmp\$Vehicle)[c(2,5:12,14,16,17,19:21)] <- "muu ajoneuvo" levels(tmp\$Vehicle)[c(1,3,4,13,15,18)] <- c( "dieselauto","sähköauto", "bensiiniauto","kuorma-auto","moottoriyörä", "pakettiauto" ) tmp <- oapply( tmp[tmp\$Municipality=="Helsinki" & tmp\$Scenario %in% c("BAU","HNH2035"),], cols="Location", FUN=sum ) return(tmp@output) } tmp <- clean(roadkm) tmp <- tmp[!(tmp\$Year %in% 2015:2016 & tmp\$Vehicle=="muu ajoneuvo"),] ggplot(tmp, aes(x=Year, y=roadkmResult, colour=Vehicle,group=Vehicle))+ geom_line(size=2)+facet_grid(Scenario~.)+theme_gray(base_size=18)+ scale_colour_manual(values=colhki)+ labs(y="Ajokilometrejä (milj km/a)", x="Vuosi") ggplot(clean(carnum), aes(x=Year, y=carnumResult, colour=Vehicle,group=Vehicle))+ geom_line(size=2)+facet_grid(Scenario~.)+theme_gray(base_size=18)+ scale_colour_manual(values=colhki)+ labs( y="Autojen lukumäärä", x="Vuosi" ) ```

## Rationale

### Data

Cars in Helsinki metropolitan area(#)
ObsMunicipalityYeargasoline cargasoline hybridhybrid with gasolinediesel cardiesel hybridhybrid with dieselelectric cargasoline CNG cargasoline ethanol carother car
1Helsinki201719190637801464663139477316399447107
2Helsinki20161913802586649645071095916526649585
3Helsinki20151900441605171596480359818953152
4Espoo201797235219768536951383325031725643
5Espoo201696532147725235799271915024226535
6Vantaa201786860218545532898393716215518819
7Vantaa20168535713932153171336281068117620
• Data to the table comes from Helsinki Environmental statistics.
• Gasoline/diesel hybrid means a car that mainly uses fossil fuel but can get extra boost and energy efficiency from small batteries and electric motor.
• Hybrid with gasoline/diesel is a rechargeable hybrid that can run on batteries for 50 km or more, making gasoline/diesel a supplemental fuel.
• Gasoline CNG/ethanol cars can use compressed natural gas or ethanol as alternative fuels.

### Calculations

#### Push to HNH2035

 ```# This is code Op_en7926/ on page [[Road traffic in Helsinki]] library(OpasnetUtils) library(plotly) objects.latest("Op_en6007", code_name="hnh2035") # [[OpasnetUtils/Drafts]] combineLines, pushIndicatorGraph objects.latest("Op_en6007", code_name="miscellaneous") # [[OpasnetUtils/Drafts]] truncateIndex objects.latest("Op_en7926", code_name="roadkm") # [[Road traffic in Helsinki]] roadkm roadkm <- EvalOutput(roadkm) clean <- function(ova) { ova\$Scenario[is.na(ova\$Scenario) | ova\$Scenario %in% c("","NA")] <- "toteutunut" tmp <- unkeep(ova, sources=TRUE) # tmp <- oapply(tmp, INDEX="Vehicle",sum)@output # Find the top 6: # gasoline car 29652.63589 # diesel car 10380.38549 # vans 5130.52399 # motorcycles 1983.26063 # trucks 1832.49332 # buses 1077.48932 # leave this to get electric cars in # electric car 600.54554 # > levels(tmp\$Vehicle) # [1] "diesel car" "diesel hybrid" "electric car" # [4] "gasoline car" "gasoline CNG car" "gasoline ethanol car" # [7] "gasoline hybrid" "hybrid with diesel" "hybrid with gasoline" # [10] "other car" "" "private cars" # [13] "trucks" "buses" "motorcycles" # [16] "microcars" "mopeds" "vans" # [19] "Tieliikenne yhteensä" "YHTEENSÄ kadut " "YHTEENSÄ tiet" levels(tmp\$Vehicle)[c(2,5:12,14,16,17,19:21)] <- "muu ajoneuvo" levels(tmp\$Vehicle)[c(1,3,4,13,15,18)] <- c( "dieselauto","sähköauto", "bensiiniauto","kuorma-auto","moottoriyörä", "pakettiauto" ) tmp <- oapply( tmp[tmp\$Municipality=="Helsinki" & tmp\$Scenario %in% c("BAU","HNH2035"),], cols="Location", FUN=sum ) return(tmp@output) } tmp <- clean(roadkm) tmp <- tmp[!(tmp\$Year %in% 2015:2016 & tmp\$Vehicle=="muu ajoneuvo"),] levels(tmp\$Scenario)[levels(tmp\$Scenario)=="HNH2035"] <- "tavoite" p_roadkm <- plot_ly( tmp, x = ~Year, y = ~roadkmResult, type = 'scatter', mode = 'lines', color = ~Vehicle, linetype = ~Scenario) %>% layout( title="Ajoneuvosuorite Helsingissä tyypeittäin", xaxis=list(title="Vuosi"), yaxis=list(title="Ajoneuvokilometrejä (M km)") ) tst <- combineLines(carnum) tst <- truncateIndex(tst[tst\$Municipality=="Helsinki",], "Vehicle",6)@output tst <- tst[order(tst\$Year),] levels(tst\$Scenario)[levels(tst\$Scenario)=="HNH2035"] <- "tavoite" p_carnum <- plot_ly( tst, x = ~Year, y = ~carnumResult, type = 'scatter', mode = 'lines', color = ~Vehicle, linetype = ~Scenario) %>% layout( title="Ajoneuvomäärät Helsingissä tyypeittäin", xaxis=list(title="Vuosi"), yaxis=list(title="Ajoneuvojen määrä (kpl)") ) pushIndicatorGraph(p_roadkm, "https://hnh.teamy.fi/v1/indicator/6/") pushIndicatorGraph(p_carnum, "https://hnh.teamy.fi/v1/indicator/7/") cat("Plotly graphs on vehicle fleet and km POSTed to HNH2035 server.\n") ```

#### Number of cars

 ```# This is code Op_en7926/carnumRaw on page [[Road traffic in Helsinki]] library(OpasnetUtils) carnumRaw <- Ovariable( "carnumRaw", ddata = "Op_en7926", # [[Road traffic in Helsinki]] subset="Cars in Helsinki metropolitan area" ) carnumRaw@data\$Year <- as.numeric(as.character(carnumRaw@data\$Year)) carnumRaw@meta\$unit <- "#" objects.store(carnumRaw) cat("Ovariable carnumRaw stored.\n") ```

 ```# This is code Op_en7926/carnum on page [[Road traffic in Helsinki]] library(OpasnetUtils) carnum <- Ovariable( "carnum", dependencies = data.frame( Name=c("carnumRaw","addcarnum"), Ident=c( "Op_en7926/carnumRaw", # [[Road traffic in Helsinki]] "Op_en7926/addcarnum" # [[Road traffic in Helsinki]] ) ), formula = function(...) { carnumRaw\$carnumRawSource <- NULL projectile <- carnumRaw[carnumRaw\$Year==2017,colnames(carnumRaw@output)!="Year"] * Ovariable( output = data.frame( Year = rep(setdiff(addcarnum\$Year, carnumRaw\$Year),each=2), Scenario = c("BAU","HNH2035"), Result=1 ), marginal=c(TRUE,FALSE) ) carnumRaw\$Scenario <- "toteutunut" out <- combine( carnumRaw, projectile, addcarnum, name="carnum" ) # out@output <- fillna(out@output, "Scenario") out <- oapply(out, cols="", FUN=sum)#INDEX=c("Year","Scenario","Vehicle","Municipality"), FUN=sum) return(out) } ) #carnum@data\$Year <- as.numeric(as.character(carnum@data\$Year)) carnum@meta\$unit <- "#" objects.store(carnum) cat("Ovariable carnum stored.\n") ```

 ```# This is code Op_en7926/addcarnum on page [[Road traffic in Helsinki]] library(OpasnetUtils) addcarnum <- Ovariable( "addcarnum", dependencies = data.frame( Name=c("tpv"), Ident=c("Op_fi5767/tpv") # [[Hiilineutraali Helsinki 2035]] ), formula = function(...) { out <- EvalOutput(Ovariable("tpv",data=tpv[ tpv\$Metric %in% c("Sähköautojen määrä","Kaupungin sähköautojen määrä"), c("Metric","Year","Scenario","Unit","Result")] )) out@output <- rbind( cbind( out@output[1:4], Result = result(out), Vehicle="electric car"), cbind( out@output[1:4], Result = -result(out), Vehicle="gasoline car" ) ) out\$Municipality <- "Helsinki" out@marginal <- colnames(out@output) %in% c("Year","Scenario","Vehicle","Municipality") return(out) } ) objects.store(addcarnum) cat("Ovariable addcarnum stored.\n") ```

#### Measured consumption and mileage

 ```# This is code Op_en7926/consumptionRT on page [[Road traffic in Helsinki]] library(OpasnetUtils) objects.latest("Op_en7925",code_name="preprocess") # [[:File:Finnish road traffic emissions by Liisa.zip]] emissionRT for 2017. # Units: CO [t], HC [t], NOx [t], PM [t], CH4 [t], N2O [t], SO2 [t], # CO2 [t], CO2eq [t], Consumption [t], Energy [TJ], Mileage [Mkm] consumptionRT <- Ovariable( "consumptionRT", data = cbind( emissionRT[c("Municipality","Vehicle","Location")], Year = 2017, Result = emissionRT\$Consumption ) ) consumptionRT@meta\$unit <- "ton/a" mileageRT <- Ovariable( "mileageRT", data = cbind( emissionRT[c("Municipality","Vehicle","Location")], Year = 2017, Result = emissionRT\$Mileage ) ) mileageRT@meta\$unit <- "Mkm/a" objects.store(consumptionRT, mileageRT) cat("Ovariables consumptionRT, mileageRT stored.\n") ```

#### Estimated mileage

carkm is about kilometres driven by private cars (categorised in several subtypes). vehkm is about kilometres driven by all other road vehicles. roadkm is a combination of the two.

 ```# This is code Op_en7926/carkm on page [[Road traffic in Helsinki]] library(OpasnetUtils) carkm <- Ovariable( "carkm", dependencies = data.frame( Name=c("carnum","mileageRT"), Ident=c( "Op_en7926/carnum", # [[Road traffic in Helsinki]] "Op_en7926/consumptionRT" # [[Road traffic in Helsinki]] ) ), formula = function(...) { kmpercar <- oapply( mileageRT[mileageRT\$Vehicle=="private cars",], c("Municipality","Year","Location"), sum ) / oapply(carnum[carnum\$Year==2017,], c("Municipality","Year"),sum) kmpercar <- unkeep(kmpercar, "Year", prevresults=TRUE) # 2017 is the only year out <- kmpercar * carnum out <- oapply(out, cols="carnumSource", FUN=sum) # carfr <- carnum / oapply(carnum, cols="Vehicle", FUN=sum) # out <- carfr * mileageRT[mileageRT\$Vehicle == "private cars", colnames(mileageRT@output)!="Vehicle"] return(out) } ) carkm@meta\$unit <- "Mkm" objects.store(carkm) cat("Ovariable carkm stored.\n") ```

 ```# This is code Op_en7926/vehkm on page [[Road traffic in Helsinki]] library(OpasnetUtils) vehkm <- Ovariable( "vehkm", dependencies = data.frame( Name=c("mileageRT"), Ident=c( "Op_en7926/consumptionRT" # [[Road traffic in Helsinki]] ) ), formula = function(...) { out <- mileageRT[ mileageRT\$Municipality %in% c("Helsinki","Espoo","Vantaa","Kauniainen") & mileageRT\$Vehicle != "private cars",] out <- combine( out, out[out\$Year==2017,colnames(out@output)!="Year"] * Ovariable( output = data.frame( Year = setdiff(2017:2035, out\$Year), Result=1 ), marginal=c(TRUE,FALSE) ) ) return(out) } ) vehkm@meta\$unit <- "Mkm" objects.store(vehkm) cat("Ovariable vehkm stored.\n") ```

 ```# This is code Op_en7926/roadkm on page [[Road traffic in Helsinki]] library(OpasnetUtils) roadkm <- Ovariable( "roadkm", dependencies = data.frame( Name=c("carkm","vehkm"), Ident=c( "Op_en7926/carkm", # [[Road traffic in Helsinki]] "Op_en7926/vehkm" # [[Road traffic in Helsinki]] ) ), formula = function(...) { out <- combine(carkm, vehkm) return(out) } ) roadkm@meta\$unit <- "Mkm" objects.store(roadkm) cat("Ovariable roadkm stored.\n") ```

### Impact of MaaS on private car need

This is a simple simulation about the private car fleet in Helsinki, and the impact of mobility as a service (MaaS) on the need of number of cars. The following assumptions are used. They are just round numbers and possibly guesstimates but they are not too far from the situation in Helsinki. We assume that all car driving and car need happens within the city. This is of course unrealistic but actually the results are not sensitive to this.

• Number private cars: 250000
• Kilometres driven per car in the beginning of the follow-up period: 15000 km/a
• Total mileage of a car (the car is kept in driving condition until then, and then wrecked): 250000 km
• Total travel need (stays constant in time): 3750000000 km (#cars * kilometres driven)
• Follow-up time: 50 a
• Rate at which MaaS reduces the need to drive car: 0, 2, 4, or 8 %/a

Results can be found from here. The graph shows (from top left) total kilometres driven by car (Carkm), number of cars in the fleet (Cars), total kilometres travelled with MaaS rather than cars (MaaSkm), the total number of cars needed to make sure that there are cars available for the current driving need for the next 20 years (Need), and finally number of new cars bought to fulfill the need (New cars).

With zero MaaS rate nothing happens, as expected. But already at 2 % rate, dramatic things start to happen. The car kilometres driven decrease slowly as MaaS km increase. However, the decreased need of cars results in a sudden drop of almost 50 % of new car sales within less than ten years. This is because the existing car fleet lasts longer when the car kilometres decrease. Car industry never recovers from this change, and the production keeps decreasing until the end of the follow-up period, where 100000 cars (40 % of the original amount) is enough for all drivers.

Exactly the same thing happens (but more dramatically) if MaaS increases at a higher rate of 4 %/year. The new car sales drop within five years by 80 %, and the fraction of MaaS increases to 80 % in 50 years. This is not an unrealistic scenario, and the modal shift may easily be quicker.

As expected, if the MaaS increase rate is 8 %/a, the drop is even stronger. This leads to a complete end of new car sales in three years. Interestingly, the number of existing cars reduces slower than with 4 % rate. The reason is that the total mileage of cars is postponed into the distant future: even after 50 years since car shops closed, there are more than 100000 cars stored in garages, waiting to be needed. The situation is much like in Cuba, where the U.S. sanctions practically stopped the new car sales in the 1960's and the car fleet became stuck to that era.

A friendly advice: don't invest your money in car industry or a car that you think you could sell some day.

 ```# This is code Op_en7926/ on page [[Road traffic in Helsinki]] library(ggplot2) # All numbers are for Helsinki numcar <- 250000 # private cars newcar <- 15000 # new cars per year now --> life expectancy 16.7 a kmcar <- 15000 # kilometres driven per year (within Helsinki ca 10000) dropkm <- 250000 # mileage expectancy (life expectancy*kmcar) tripkm <- 3750000000 # Currently numcar*kmcar time <- 1:50 maas <- c(0, 0.02, 0.04,0.08) # percentage/a of tripkm reduction due to MaaS car <- numcar need <- newcar*20 # need is the expected number of cars needed in 20 a if carkm is constant dat <- data.frame() for(j in maas) { carkmj <- tripkm*(1-j)^time maaskmj <- tripkm*(1-(1-j)^time) for(i in 2:50) { car[i] <- car[i-1] + newcar[i-1] - carkmj[i-1]/dropkm need[i] <- carkmj[i-1]*20/dropkm newcar[i] <- max(0,min(need[i], (numcar+newcar[1]))-car[i]) } dat <- rbind( dat, data.frame( MaaSrate = paste(as.character(j*100),"%/a"), Time=rep(time,5), Var=rep(c("Cars","Carkm","MaaSkm","Need","New cars"),each=length(time)), Result=c(car,carkmj,maaskmj,need,newcar) ) ) } ggplot(dat, aes(x=Time,y=Result,colour=MaaSrate))+geom_line()+facet_wrap(~Var, scales="free_y")+ theme_gray(base_size=24) ```