![]() |
Eclipse SUMO - Simulation of Urban MObility
|
Helper methods for energy-based electricity consumption computation based on the battery device. More...
#include <HelpersEnergy.h>
Public Member Functions | |
| 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. | |
| 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. | |
| std::string | getFuel (const SUMOEmissionClass) const |
| Returns the fuel type described by this emission class as described in the Amitran interface (Gasoline, Diesel, ...). | |
| double | getWeight (const SUMOEmissionClass) const |
| Returns a reference weight in kg described by this emission class This implementation returns the default mass for this model. | |
| HelpersEnergy () | |
| Constructor (initializes myEmissionClassStrings). | |
Static Private Attributes | |
| static const int | ENERGY_BASE = 4 << 16 |
| static constexpr double | myDefaultAirDragCoefficient = 0.35 |
| static constexpr double | myDefaultConstantPowerIntake = 100. |
| static constexpr double | myDefaultFrontSurfaceArea = 2.6 |
| static constexpr double | myDefaultMass = 1830. |
| static constexpr double | myDefaultPropulsionEfficiency = 0.98 |
| static constexpr double | myDefaultRadialDragCoefficient = 0.1 |
| static constexpr double | myDefaultRecuperationEfficiency = 0.96 |
| static constexpr double | myDefaultRecuperationEfficiencyByDeceleration = 0.0 |
| static constexpr double | myDefaultRollDragCoefficient = 0.01 |
| static constexpr double | myDefaultRotatingMass = 40. |
Helper methods for energy-based electricity consumption computation based on the battery device.
Definition at line 41 of file HelpersEnergy.h.
| HelpersEnergy::HelpersEnergy | ( | ) |
Constructor (initializes myEmissionClassStrings).
Definition at line 36 of file HelpersEnergy.cpp.
References ENERGY_BASE.
| double HelpersEnergy::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.
| [in] | c | emission class for the function parameters to use |
| [in] | e | the type of emission (CO, CO2, ...), only electricity gives valid results |
| [in] | v | The vehicle's current velocity |
| [in] | P | The vehicle's current power consumption |
| [in] | slope | The road's slope at vehicle's position [deg] |
Definition at line 133 of file HelpersEnergy.cpp.
References PolySolver::cubicSolve(), DEG2RAD, EnergyParams::getDefault(), EnergyParams::getDoubleOptional(), EnergyParams::getTotalMass(), GRAVITY, MAX2(), MAX3(), myDefaultAirDragCoefficient, myDefaultFrontSurfaceArea, myDefaultMass, myDefaultPropulsionEfficiency, myDefaultRecuperationEfficiency, myDefaultRollDragCoefficient, myDefaultRotatingMass, SUMO_ATTR_AIRDRAGCOEFFICIENT, SUMO_ATTR_FRONTSURFACEAREA, SUMO_ATTR_PROPULSIONEFFICIENCY, SUMO_ATTR_RECUPERATIONEFFICIENCY, SUMO_ATTR_ROLLDRAGCOEFFICIENT, SUMO_ATTR_ROTATINGMASS, TL, TS, and WRITE_ERROR.
| double HelpersEnergy::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.
Returns only valid values for electricity all other types give 0.
| [in] | c | emission class for the function parameters to use |
| [in] | e | the type of emission (CO, CO2, ...), only electricity gives valid results |
| [in] | v | The vehicle's current velocity |
| [in] | a | The vehicle's current acceleration |
| [in] | slope | The road's slope at vehicle's position [deg] |
Definition at line 42 of file HelpersEnergy.cpp.
References ACCEL2SPEED, DEG2RAD, EnergyParams::getAngleDiff(), EnergyParams::getDefault(), EnergyParams::getDoubleOptional(), EnergyParams::getTotalMass(), GRAVITY, EnergyParams::isOff(), myDefaultAirDragCoefficient, myDefaultConstantPowerIntake, myDefaultFrontSurfaceArea, myDefaultMass, myDefaultPropulsionEfficiency, myDefaultRadialDragCoefficient, myDefaultRecuperationEfficiency, myDefaultRecuperationEfficiencyByDeceleration, myDefaultRollDragCoefficient, myDefaultRotatingMass, SPEED2DIST, SUMO_ATTR_AIRDRAGCOEFFICIENT, SUMO_ATTR_CONSTANTPOWERINTAKE, SUMO_ATTR_FRONTSURFACEAREA, SUMO_ATTR_PROPULSIONEFFICIENCY, SUMO_ATTR_RADIALDRAGCOEFFICIENT, SUMO_ATTR_RECUPERATIONEFFICIENCY, SUMO_ATTR_RECUPERATIONEFFICIENCY_BY_DECELERATION, SUMO_ATTR_ROLLDRAGCOEFFICIENT, SUMO_ATTR_ROTATINGMASS, and TS.
|
inline |
Returns the fuel type described by this emission class as described in the Amitran interface (Gasoline, Diesel, ...).
| [in] | c | the emission class |
Definition at line 54 of file HelpersEnergy.h.
|
inline |
Returns a reference weight in kg described by this emission class This implementation returns the default mass for this model.
| [in] | c | the emission class |
Definition at line 63 of file HelpersEnergy.h.
References myDefaultMass.
|
staticprivate |
Definition at line 43 of file HelpersEnergy.h.
Referenced by HelpersEnergy().
|
staticconstexprprivate |
Definition at line 95 of file HelpersEnergy.h.
Referenced by acceleration(), and compute().
|
staticconstexprprivate |
Definition at line 99 of file HelpersEnergy.h.
Referenced by compute().
|
staticconstexprprivate |
Definition at line 94 of file HelpersEnergy.h.
Referenced by acceleration(), and compute().
|
staticconstexprprivate |
Definition at line 93 of file HelpersEnergy.h.
Referenced by acceleration(), compute(), and getWeight().
|
staticconstexprprivate |
Definition at line 100 of file HelpersEnergy.h.
Referenced by acceleration(), and compute().
|
staticconstexprprivate |
Definition at line 97 of file HelpersEnergy.h.
Referenced by compute().
|
staticconstexprprivate |
Definition at line 101 of file HelpersEnergy.h.
Referenced by acceleration(), and compute().
|
staticconstexprprivate |
Definition at line 102 of file HelpersEnergy.h.
Referenced by compute().
|
staticconstexprprivate |
Definition at line 98 of file HelpersEnergy.h.
Referenced by acceleration(), and compute().
|
staticconstexprprivate |
Definition at line 96 of file HelpersEnergy.h.
Referenced by acceleration(), and compute().