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) {
161 double const1, const2, const3;
194 const1 += 0.5 * mass * (2 * v);
195 const2 = 0.5 * mass * (
TS);
223 return MAX3(x1, x2, x3);
225 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_RECUPERATIONEFFICIENCY_BY_DECELERATION
Recuperation efficiency (by deceleration)
@ SUMO_ATTR_RECUPERATIONEFFICIENCY
Recuperation efficiency (constant)
@ SUMO_ATTR_AIRDRAGCOEFFICIENT
Air drag coefficient.
@ SUMO_ATTR_VEHICLEMASS
Vehicle mass.
@ SUMO_ATTR_RADIALDRAGCOEFFICIENT
Radial drag coefficient.
@ SUMO_ATTR_PROPULSIONEFFICIENCY
Propulsion efficiency.
@ SUMO_ATTR_INTERNALMOMENTOFINERTIA
Internal moment of inertia.
@ SUMO_ATTR_FRONTSURFACEAREA
Front surface area.
An upper class for objects with additional parameters.
double getDouble(SumoXMLAttr attr) 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.