emis estimates vehicular emissions as the product of the vehicles on a road, length of the road, emission factor avaliated at the respective speed. \(E = VEH*LENGTH*EF(speed)\)

emis(veh, lkm, ef, speed = 34, agemax = ifelse(is.data.frame(veh),
  ncol(veh), ncol(veh[[1]])), profile, hour = nrow(profile),
  day = ncol(profile), array = T, verbose = FALSE)

Arguments

veh

"Vehicles" data-frame or list of "Vehicles" data-frame. Each data-frame as number of columns matching the age distribution of that ype of vehicle. The number of rows is equal to the number of streets link

lkm

Length of each link in km

ef

List of functions of emission factors

speed

Speed data-frame with number of columns as hours. The default value is 34km/h

agemax

Age of oldest vehicles for that category

profile

Dataframe or Matrix with nrows equal to 24 and ncol 7 day of the week

hour

Number of considered hours in estimation. Default value is number of rows of argument profile

day

Number of considered days in estimation

array

When FALSE produces a dataframe of the estimation. When TRUE expects a profile as a dataframe producing an array with dimensions (streets x columns x hours x days)

verbose

Logical; To show more information

Value

If the user applies a top-down approach, the resulting units will be according its own data. For instance, if the vehicles are veh/day, the units of the emissions implicitly will be g/day.

Note

Hour and day will be deprecated because they can be infered from the profile matrix.

Examples

# NOT RUN {
# Do not run
data(net)
data(pc_profile)
data(profiles)
data(fe2015)
data(fkm)
PC_G <- c(33491,22340,24818,31808,46458,28574,24856,28972,37818,49050,87923,
          133833,138441,142682,171029,151048,115228,98664,126444,101027,
          84771,55864,36306,21079,20138,17439, 7854,2215,656,1262,476,512,
          1181, 4991, 3711, 5653, 7039, 5839, 4257,3824, 3068)
veh <- data.frame(PC_G = PC_G)
pc1 <- my_age(x = net$ldv, y = PC_G, name = "PC")
# Estimation for morning rush hour and local emission factors
speed <- data.frame(S8 = net$ps)
lef <- EmissionFactorsList(fe2015[fe2015$Pollutant=="CO", "PC_G"])
E_CO <- emis(veh = pc1,lkm = net$lkm, ef = lef, speed = speed,
             profile = 1)
# Estimation for 168 hour and local factors
pcw <- temp_fact(net$ldv+net$hdv, pc_profile)
speed <- netspeed(pcw, net$ps, net$ffs, net$capacity, net$lkm, alpha = 1)
lef <- EmissionFactorsList(fe2015[fe2015$Pollutant=="CO", "PC_G"])
E_CO <- emis(veh = pc1,lkm = net$lkm, ef = lef, speed = speed,
             profile = profiles$PC_JUNE_2014)
summary(E_CO)
# Estimation for 168 hour and COPERT factors
pcw <- temp_fact(net$ldv+net$hdv, pc_profile)
speed <- netspeed(pcw, net$ps, net$ffs, net$capacity, net$lkm, alpha = 1)
euro <- as.character(fe2015[fe2015$Pollutant=="CO", "Euro_LDV"])
lef <- lapply(1:length(euro), function(i) {
ef_ldv_speed(v = "PC", t = "4S", cc = "<=1400", f = "G", p = "CO",
             eu= euro[i], show.equation = FALSE)
})
E_CO <- emis(veh = pc1,lkm = net$lkm, ef = lef, speed = speed,
             profile = profiles$PC_JUNE_2014)
# Estimation for 168 hour and scaled factors
pcw <- temp_fact(net$ldv+net$hdv, pc_profile)
speed <- netspeed(pcw, net$ps, net$ffs, net$capacity, net$lkm, alpha = 1)
pckm <- fkm[[1]](1:24); pckma <- cumsum(pckm)
cod1 <- emis_det(po = "CO", cc = 1000, eu = "III", km = pckma[1:11])
cod2 <- emis_det(po = "CO", cc = 1000, eu = "I", km = pckma[12:24])
#vehicles newer than pre-euro
co1 <- fe2015[fe2015$Pollutant=="CO", ] #24 obs!!!
cod <- c(co1$PC_G[1:24]*c(cod1,cod2),co1$PC_G[25:nrow(co1)])
lef <- ef_ldv_scaled(co1, cod, v = "PC", t = "4S", cc = "<=1400",
                     f = "G",p = "CO", eu=co1$Euro_LDV)
length(lef) != ncol(pc1)
#emis change length of 'ef' to match ncol of 'veh'
E_CO <- emis(veh = pc1,lkm = net$lkm, ef = lef, speed = speed,
             profile = profiles$PC_JUNE_2014)
class(E_CO)
lpc <- list(pc1, pc1)
E_COv2 <- emis(veh = lpc,lkm = net$lkm, ef = lef, speed = speed,
               hour = 2, day = 1)
# Entering wrong results
pc1[ , ncol(pc1) + 1] <- pc1$PC_1
dim(pc1)
length(lef)
E_CO <- emis(veh = pc1,lkm = net$lkm, ef = lef, speed = speed,
             profile = profiles$PC_JUNE_2014)
E_COv2 <- emis(veh = lpc,lkm = net$lkm, ef = lef, speed = speed,
               hour = 2, day = 1)
# top down
veh <- age_ldv(x = net$ldv[1:2], name = "PC_E25_1400", agemax = 4)
mil <- fkm$KM_PC_E25(1:4)
ef <- ef_cetesb("COd", "PC_G")[1:4]
emis(veh, lkm, ef)
# }