45 if (param ==
nullptr) {
58 power += 0.5 * mass * (v * v - lastV * lastV) /
TS;
82 if (angleDiff != 0.) {
84 double radius =
SPEED2DIST(v) / fabs(angleDiff);
87 if (radius < 0.0001) {
89 }
else if (radius > 10000) {
124 return power / 3600.;
134 if (param ==
nullptr) {
158 double const1, const2, const3;
191 const1 += 0.5 * mass * (2 * v);
192 const2 = 0.5 * mass * (
TS);
197 const1 += 0.5 * rotMass * (2 * v);
198 const2 += 0.5 * rotMass * (
TS);
204 Prest -= drag * (v * v * v);
205 const1 += drag * (3 * v * v *
TS);
206 const2 += drag * (3 * v *
TS *
TS);
207 const3 = drag * (
TS *
TS *
TS);
221 return MAX3(x1, x2, x3);
223 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_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 getTotalMass(const double defaultEmptyMass, const double defaultLoading) const
Returns the sum of the empty mass (SUMO_ATTR_MASS), tthe loading (SUMO_ATTR_LOADING) and the mass of ...
double getDoubleOptional(SumoXMLAttr attr, const double def) const
Returns the value for a given key with an optional default. SUMO_ATTR_MASS and SUMO_ATTR_FRONTSURFACE...
static const EnergyParams * getDefault()
double getAngleDiff() const
Returns the angle difference between the last two calls of setDynamicValues (usually the last two tim...
static constexpr double myDefaultRadialDragCoefficient
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.
static constexpr double myDefaultFrontSurfaceArea
static constexpr double myDefaultRollDragCoefficient
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.
static constexpr double myDefaultRecuperationEfficiency
HelpersEnergy()
Constructor (initializes myEmissionClassStrings)
static constexpr double myDefaultMass
static constexpr double myDefaultRotatingMass
static constexpr double myDefaultRecuperationEfficiencyByDeceleration
static constexpr double myDefaultAirDragCoefficient
static constexpr double myDefaultConstantPowerIntake
static constexpr double myDefaultPropulsionEfficiency
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.