Functions associated with VSP calculations.
#calculationcalcVSP(speed = NULL, accel = NULL, slope = NULL,
time = NULL, distance = NULL, data = NULL,
calc.method = calcVSP_JimenezPalacios,
..., fun.name = "calcVSP", this.call = NULL)
calcVSP_JimenezPalacios(speed = NULL, accel = NULL,
slope = NULL, vehicle.weight = NULL, vsp.a = NULL,
vsp.b = NULL, vsp.c = NULL, vsp.g = NULL, ...,
data = NULL,
fun.name = "calcVSP_JimenezPalacios",
this.call = NULL)
#VSP binning
refVSPBin(..., bin.method="ncsu.14")
refVSPBin_NCSU.14(vsp = NULL, data = NULL,
..., fun.name="refVSPBin_NSCU.14")
refVSPBin_MOVES.23(vsp = NULL, speed = NULL, data = NULL,
..., fun.name="refVSPBin_MOVES.23")
#vsp plotting
VSPPlot(vsp, em = NULL, ..., data = NULL, plot.type = 1,
fun.name="VSPPlot", scheme = pems.scheme)
VSPBinPlot(vspbin, em = NULL, ..., data = NULL,
plot.type = 1, stat = NULL, fun.name="VSPBinPlot",
scheme = pems.scheme)
calcVSP by default uses the Jimenez Palacios method
to calculate VSP in kW/metric ton.
refVSPBin generates a pems.element factor
vector of VSP Mode bin assignments.
VSPPlot and VSPBinPlot generate plots as
lattice objects.
(Typically pems.element vectors) speed, accel,
slope, time and distance are possible
inputs for VSP calculation. vsp and speed are
possible inputs for VSP binning methods. vsp,
vspbin and em are x and y inputs for
associated plots.
(See Notes about inputs and methods.)
(Optional, typically pems) The data source for inputs.
(Required functions) calc.method is the function used
to calculate VSP (default calcVSP_JimenezPalaciosCMEM).
bin.method is the methods used when binning VSP
measurements. (See Notes.)
(Optional) Other arguments, currently passed on as supplied to assoicated calculation or binning method.
(Optional character) The name of the parent function, to be used in error messaging.
(Optional) Initial call, should generally be ignored. See codecommon.calculations for further details.
(Numerics) VSP constants. If not supplied, defaults are applied. See Below.
(Optional numeric) For VSPPlot and VSPBinPlot,
the type of plot to generate. For VSPPlot, 1 a
conventional scatter plot; or 2 a box-and-whisker plot. For
VSPBinPlot, 1 a bar plot; or 2 a box-and-whisker
plot.
(Function) For VSPBinPlot, the statistic to use when
calculating bar scales for plot.type 1. By default this
is mean if em is supplied or count if not. NOTE:
stat is ignore when plot.type is used
(Various) For speedEmPlot, the scheme to apply to
the plot, loa argument.
Karl Ropkins
calcVSP... functions calculate VSP:
calcVSP is a wrapper function which allows users to
supply different combinations of inputs. VSP calculations
typically require speed, acceleration and slope inputs.
However, This wrapper allows different input combinations,
e.g.:
time and distance (time and distance -> speed, time and speed -> accel)
time and speed (time and speed -> accel)
speed and accel
This then passes on speed, accel and (if
supplied) slope to the method defined by
calc.method. (This means other VSP functions run
via calcVSP(..., calc.method = function)
share this option without needed dedicated code.)
calcVSP_JimenezPalacios calculates VSP according
to Jimenez Palacios methods. See References and Note below.
refVSPBin... functions generate a reference list of
VSP bins:
refVSPBin is a wrapper that generates VSP Mode bins
depending on method applied.
binVSP_NCSU.14 bins supplied vsp using the
14 bin method described in Frey et al 2002.
binVSP_MOVES.23 bins supplied vsp using that
and speed and the 23 bin MOVES method (See Note).
VSPPlot generates various plots of VSP (x-axis) and
emission (y-axis) data.
VSPBinPlot generates various plots of VSP binned data.
calcVSP_JimenezPalacios uses methods described in:
Jimenez-Palacios, J.L. (1999) Understanding and Quantifying Motor Vehicle Emissions with Vehicle Specific Power and TILDAS Remote Sensing. PhD Thesis, Massachusetts Institute of Technology, Cambridge, MA.
vehicle.weight is the vehicle mass (in metric tons),
and vsp.a, vsp.b, vsp.c and vsp.g
are the calculations constants for:
vsp = speed * (a * accel + (g * slope) + b) + (c * speed^3)
By default: a = 1.1, b = 0.132, c = 0.000302 and g = 0.132 (as of Jimenez-Palacios, 1999).
Method ONLY INTENDED FOR vehicles < 3.855 metric tons.
refVSPBin_NCSU.14 VSP binning as described in:
Frey, H.C., Unal, A., Chen, J., Li, S. and Xuan, C., 2002. Methodology for developing modal emission rates for EPA's multi-scale motor vehicle & equipment emission system. Ann Arbor, Michigan: US Environmental Protection Agency. (EPA420-R-02-027)
See common.calculations (and
checkUnits and
convertUnits) for details of data management.
###########
##example 1
###########
#basic usage
vsp <- calcVSP(velocity, time = local.time, data = pems.1)
#where the returned object, vsp, is vsp values as pems.element
ncsu.14 <- refVSPBin(vsp)
#where the returned object, nscu.14, is the associated modal bin
# assignments based on the Frey et al (2002) 14 bin method.
Run the code above in your browser using DataLab