if (FALSE) {
# Quick view
pol <- c("CO", "NOx", "HC", "NMHC", "CH4", "FC", "PM", "CO2", "SO2")
f <- sapply(1:length(pol), function(i){
print(pol[i])
ef_hdv_speed(v = "Trucks",t = "RT", g = "<=7.5", e = "II", gr = 0,
l = 0.5, p = pol[i], x = 10)(30)
})
f
V <- 0:130
ef1 <- ef_hdv_speed(v = "Trucks",t = "RT", g = "<=7.5", e = "II", gr = 0,
l = 0.5, p = "HC")
plot(1:130, ef1(1:130), pch = 16, type = "b")
euro <- c(rep("V", 5), rep("IV", 5), rep("III", 5), rep("II", 5),
rep("I", 5), rep("PRE", 15))
lef <- lapply(1:30, function(i) {
ef_hdv_speed(v = "Trucks", t = "RT", g = ">32", gr = 0,
eu = euro[i], l = 0.5, p = "NOx",
show.equation = FALSE)(25) })
efs <- EmissionFactors(unlist(lef)) #returns 'units'
plot(efs, xlab = "age")
lines(efs, type = "l")
a <- ef_hdv_speed(v = "Trucks", t = "RT", g = ">32", gr = 0,
eu = euro, l = 0.5, p = "NOx", speed = Speed(0:125))
a$speed <- NULL
filled.contour(as.matrix(a), col = cptcity::lucky(n = 24),
xlab = "Speed", ylab = "Age")
persp(x = as.matrix(a), theta = 35, xlab = "Speed", ylab = "Age",
zlab = "NOx [g/km]", col = cptcity::lucky(), phi = 25)
aa <- ef_hdv_speed(v = "Trucks", t = "RT", g = ">32", gr = 0,
eu = rbind(euro, euro), l = 0.5, p = "NOx", speed = Speed(0:125))
}
Run the code above in your browser using DataLab