49 if (param ==
nullptr) {
62 power += 0.5 * mass * (v * v - lastV * lastV) /
TS;
86 if (angleDiff != 0.) {
88 double radius =
SPEED2DIST(v) / fabs(angleDiff);
91 if (radius < 0.0001) {
93 }
else if (radius > 10000) {
128 return power / 3600.;
138 if (param ==
nullptr) {
162 double const1, const2, const3;
195 const1 += 0.5 * mass * (2 * v);
196 const2 = 0.5 * mass * (
TS);
201 const1 += 0.5 * rotMass * (2 * v);
202 const2 += 0.5 * rotMass * (
TS);
224 return MAX3(x1, x2, x3);
226 WRITE_ERROR(
TL(
"An acceleration given by the power was not found."));
@ SUMO_ATTR_ROLLDRAGCOEFFICIENT
Roll Drag coefficient.
@ SUMO_ATTR_CONSTANTPOWERINTAKE
Constant Power Intake.
@ SUMO_ATTR_LOADING
additional mass loaded on the vehicle
@ SUMO_ATTR_RECUPERATIONEFFICIENCY_BY_DECELERATION
Recuperation efficiency (by deceleration)
@ SUMO_ATTR_RECUPERATIONEFFICIENCY
Recuperation efficiency (constant)
@ SUMO_ATTR_AIRDRAGCOEFFICIENT
Air drag coefficient.
@ SUMO_ATTR_RADIALDRAGCOEFFICIENT
Radial drag coefficient.
@ SUMO_ATTR_ROTATINGMASS
Mass equivalent of rotating elements.
@ SUMO_ATTR_PROPULSIONEFFICIENCY
Propulsion efficiency.
@ SUMO_ATTR_FRONTSURFACEAREA
Front surface area.
An upper class for objects with additional parameters.
double getDouble(SumoXMLAttr attr) const
double getDoubleOptional(SumoXMLAttr attr, const double def) const
static const EnergyParams * getDefault()
double compute(const SUMOEmissionClass c, const PollutantsInterface::EmissionType e, const double v, const double a, const double slope, const EnergyParams *param) const
Computes the emitted pollutant amount using the given speed and acceleration.
double acceleration(const SUMOEmissionClass c, const PollutantsInterface::EmissionType e, const double v, const double P, const double slope, const EnergyParams *param) const
Computes the achievable acceleration using the given speed and amount of consumed electric power.
HelpersEnergy()
Constructor (initializes myEmissionClassStrings)
Helper methods for PHEMlight-based emission computation.
EmissionType
Enumerating all emission types, including fuel.
static std::tuple< int, double, double, double > cubicSolve(double a, double b, double c, double d)
Solver of cubic equation ax^3 + bx^2 + cx + d = 0.