The traffic simulator Eclipse SUMO contains emission models that are continuous reformulations of the Handbook Emission Factors for Road Transport (HBEFA) versions 4.2, 3.1 and 2.1: polynomials in speed and acceleration fitted by DLR to HBEFA data (SUMO docs; Krajzewicz et al., 2015). VEIN includes an exact R port of these models:
hbefa_classes(): the available emission classes,emis_hbefa(): instantaneous emissions (g/s) from speed,
acceleration and slope,ef_hbefa(): constant-speed (cruise) emission factors
(g/km),ef_hbefa_cycle(): emission factors (g/km) over a speed
trace.The formulas and coefficients come from SUMO and are distributed
under EPL-2.0 OR GPL-2.0-or-later (see
system.file("COPYRIGHTS", package = "vein")).
library(vein)
cl <- hbefa_classes() # HBEFA4, 833 classes
table(cl$category)
#>
#> Coach HGV LCV MC PC UBus
#> 76 334 158 36 89 140
cl[cl$category == "PC" & cl$fuel %in% "petrol", c("class", "euro", "hbefa_id")]
#> class euro hbefa_id
#> 1 HBEFA4/PC_petrol_ltECE 0 111900
#> 2 HBEFA4/PC_petrol_ECE-15_00 0 111901
#> 3 HBEFA4/PC_petrol_ECE-15_01_02 0 111902
#> 4 HBEFA4/PC_petrol_ECE-15_03 0 111903
#> 5 HBEFA4/PC_petrol_ECE-15_04 0 111904
#> 6 HBEFA4/PC_petrol_AGV82_(CH) 0 111905
#> 7 HBEFA4/PC_petrol_conv_other_concepts 0 111906
#> 8 HBEFA4/PC_petrol_Ucat 0 111907
#> 9 HBEFA4/PC_petrol_Euro-1 1 111910
#> 10 HBEFA4/PC_petrol_PreEuro_3WCat_lt1987 0 111912
#> 11 HBEFA4/PC_petrol_PreEuro_3WCat_1987-90 0 111913
#> 12 HBEFA4/PC_petrol_Euro-2 2 111920
#> 13 HBEFA4/PC_petrol_Euro-3 3 111930
#> 14 HBEFA4/PC_petrol_Euro-4 4 111940
#> 15 HBEFA4/PC_petrol_Euro-5 5 111950
#> 16 HBEFA4/PC_petrol_Euro-6ab 6 111961
#> 17 HBEFA4/PC_petrol_Euro-6c 6 111965
#> 18 HBEFA4/PC_petrol_Euro-6d-temp 6 111967
#> 19 HBEFA4/PC_petrol_Euro-6d 6 111968
#> 20 HBEFA4/PC_petrol_Euro-7 7 111970
#> 88 HBEFA4/PC_2S_EE 0 191700HBEFA3 and HBEFA2 classes are also available:
head(hbefa_classes("HBEFA3")[, c("class", "category", "fuel", "euro")])
#> class category fuel euro
#> 1 HBEFA3/LDV LDV all NA
#> 2 HBEFA3/LDV_G_EU0 LDV petrol 0
#> 3 HBEFA3/LDV_G_EU1 LDV petrol 1
#> 4 HBEFA3/LDV_G_EU2 LDV petrol 2
#> 5 HBEFA3/LDV_G_EU3 LDV petrol 3
#> 6 HBEFA3/LDV_G_EU4 LDV petrol 4emis_hbefa() takes the speed in m/s and the acceleration
in m/s² (or units objects) and returns g/s. Pollutants are
"CO2", "CO", "HC",
"FC" (fuel), "NOx", "PM" and
"EC" (electricity, Wh/s).
emis_hbefa("HBEFA4/PC_petrol_Euro-4", "CO2",
v = units::set_units(50, "km/h"), a = c(-1, -0.2, 0, 0.5, 1))
#> Units: [g/s]
#> [1] 0.000000 1.419202 2.058762 3.657662 5.256563The first value is 0: like SUMO, a car that decelerates more than its coasting deceleration (about -0.29 m/s² at 50 km/h for 1500 kg) does not emit. Battery electric vehicles recover energy instead:
ef_hbefa() evaluates the model at constant speed and
divides by the distance travelled per second. Here we compare it with
ef_ldv_speed() for a Euro 4 petrol car.
V <- 10:130
hb <- ef_hbefa("HBEFA4/PC_petrol_Euro-4", "CO2")
eea <- ef_ldv_speed(v = "PC", t = "4S", cc = "<=1400", f = "G", eu = "IV", p = "CO2")
plot(V, hb(V), type = "l", col = "blue", ylim = c(0, 600),
xlab = "Speed [km/h]", ylab = "CO2 [g/km]")
lines(V, eea(V), col = "red")
legend("topright", c("SUMO HBEFA4 cruise (average Euro 4 petrol car)",
"EMEP/EEA average speed (<= 1.4 l)"),
col = c("blue", "red"), lty = 1)The curves come from different data and have a different meaning: the
EMEP/EEA factors are averages over real driving at a given mean speed,
while the cruise factors are steady-speed values of an instantaneous
model, without accelerations, stops, traffic situations or cold starts.
At low speeds the cruise curve rises steeply because the idle
consumption is divided by a short distance; below vmin (5
km/h by default) the speed is clamped.
ef_hbefa_cycle() integrates the instantaneous emissions
over a 1 Hz speed trace in km/h, with the convention of SUMO’s
emissionsDrivingCycle (a_t = v_t - v_(t-1), emissions at
v_t).
# synthetic urban trip: three stop-and-go segments with a traffic light
seg <- c(seq(0, 50, by = 5), rep(50, 30), seq(50, 0, by = -7.5), 0, rep(0, 15))
urban <- rep(seg, 3)
plot(urban, type = "l", xlab = "time [s]", ylab = "speed [km/h]")ef_hbefa_cycle(c("HBEFA4/PC_petrol_Euro-4", "HBEFA4/PC_diesel_Euro-6d"),
"CO2", speed = urban)
#> Units: [g/km]
#> [1] 243.0486 263.6376The mean speed of this trip is 30.7 km/h; the cruise factor at that speed is lower than the trip factor, as it ignores accelerations and idling:
hbefa_eea() translates the vehicle keys of
ef_ldv_speed() and ef_hdv_speed() into HBEFA4
classes. Called without arguments it returns the equivalence for every
key of vein’s EEA tables, with a note when the match is not direct
(e.g. HBEFA4 has no engine size classes for passenger cars, full hybrids
are taken as petrol, Euro IV/V trucks as the SCR variant).
hbefa_eea("PC", "4S", "1400_2000", "G", c("PRE", "I", "IV", "VI", "VId"))
#> [1] "HBEFA4/PC_petrol_ltECE" "HBEFA4/PC_petrol_Euro-1"
#> [3] "HBEFA4/PC_petrol_Euro-4" "HBEFA4/PC_petrol_Euro-6ab"
#> [5] "HBEFA4/PC_petrol_Euro-6d"
tab <- hbefa_eea()
table(tab$VEH, tab$exact)
#>
#> FALSE TRUE
#> Coach 6 8
#> LCV 12 72
#> Moped 12 0
#> Motorcycle 6 18
#> PC 186 128
#> Trucks 42 56
#> Ubus 9 12
head(tab[!tab$exact, ])
#> VEH TYPE CC FUEL EURO class exact
#> 2 PC GDI <=800 G IV HBEFA4/PC_petrol_Euro-4 FALSE
#> 4 PC GDI <=800 G V HBEFA4/PC_petrol_Euro-5 FALSE
#> 6 PC GDI <=800 G VI HBEFA4/PC_petrol_Euro-6ab FALSE
#> 8 PC GDI <=800 G VIc HBEFA4/PC_petrol_Euro-6d-temp FALSE
#> 9 PC GDI_GPF <=800 G VIc HBEFA4/PC_petrol_Euro-6d-temp FALSE
#> 11 PC GDI <=800 G VId HBEFA4/PC_petrol_Euro-6d FALSE
#> note
#> 2 no GDI class in HBEFA4: petrol
#> 4 no GDI class in HBEFA4: petrol
#> 6 no GDI class in HBEFA4: petrol
#> 8 no GDI class in HBEFA4: petrol
#> 9 no GDI class in HBEFA4: petrol
#> 11 no GDI class in HBEFA4: petrolef_hbefa_speed() takes the same arguments as
ef_ldv_speed() (and g, gr,
l of ef_hdv_speed()) and returns the same
objects, so it can replace them in a project script. NO2 and NO use the
NOx share of the EEA tables.
ef_hbefa_speed("PC", "4S", "1400_2000", "G", c("I", "IV", "VI"), "CO2",
speed = Speed(c(20, 50, 90)))
#> I1 IV2 VI3 speed
#> 1 303.9716 [g/km] 293.0706 [g/km] 277.3333 [g/km] 20
#> 2 157.0535 [g/km] 148.2309 [g/km] 140.1758 [g/km] 50
#> 3 166.6800 [g/km] 151.3675 [g/km] 136.6625 [g/km] 90
ef_ldv_speed("PC", "4S", "1400_2000", "G", c("I", "IV", "VI"), "CO2",
speed = Speed(c(20, 50, 90)))
#> I1 IV2 VI3 speed
#> 1 254.6893 [g/km] 197.8141 [g/km] 197.8141 [g/km] 20
#> 2 166.9912 [g/km] 136.7133 [g/km] 136.7133 [g/km] 50
#> 3 156.5385 [g/km] 130.7286 [g/km] 130.7286 [g/km] 90
ef_hbefa_speed(v = "Trucks", t = "RT", g = ">14 & <=20", eu = "V", p = "NOx",
speed = Speed(c(20, 50, 90)), show.equation = TRUE)
#> V -> HBEFA4/RT_gt14-20t_Euro-V_SCR (Euro V as the SCR variant)
#> Units: [g/km]
#> [1] 4.96630 2.35054 1.57550Remember that these are cruise factors (section 3): below about 30 km/h they are higher than the EEA average-speed factors, and HBEFA4 “PM” includes non-exhaust PM10.
Krajzewicz, D., Behrisch, M., Wagner, P., Luz, R., Krumnow, M. (2015). Second Generation of Pollutant Emission Models for SUMO. In: Modeling Mobility with Open Data. Lecture Notes in Mobility. Springer, Cham. https://doi.org/10.1007/978-3-319-15024-6_12