Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

consolidate coasting/pseudoFriction #15805

Open
namdre opened this issue Nov 28, 2024 · 1 comment
Open

consolidate coasting/pseudoFriction #15805

namdre opened this issue Nov 28, 2024 · 1 comment

Comments

@namdre
Copy link
Contributor

namdre commented Nov 28, 2024

MSVehicle::setBrakingSignals(double vNext) {
// To avoid casual blinking brake lights at high speeds due to dawdling of the
// leading vehicle, we don't show brake lights when the deceleration could be caused
// by frictional forces and air resistance (i.e. proportional to v^2, coefficient could be adapted further)
double pseudoFriction = (0.05 + 0.005 * getSpeed()) * getSpeed();
bool brakelightsOn = vNext < getSpeed() - ACCEL2SPEED(pseudoFriction);

vs

PollutantsInterface::Helper::getCoastingDecel(const SUMOEmissionClass c, const double v, const double a, const double slope, const EnergyParams* param) const {
// the interpolation for small v is basically the same as in PHEMlightdllV5::CEP::GetDecelCoast
if (v < PHEMlightdllV5::Constants::SPEED_DCEL_MIN) {
return v / PHEMlightdllV5::Constants::SPEED_DCEL_MIN * getCoastingDecel(c, PHEMlightdllV5::Constants::SPEED_DCEL_MIN, a, slope, param);
}
if (param == nullptr) {
param = EnergyParams::getDefault();
}
// the magic numbers below come from a linear interpolation with http://ts-sim-service-ba/svn/simo/trunk/projects/sumo/data/emissions/linear.py
const double mass = param->getDouble(SUMO_ATTR_MASS);
const double area = param->getDouble(SUMO_ATTR_WIDTH) * param->getDouble(SUMO_ATTR_HEIGHT) * M_PI / 4.;
const double incl = area / mass * -9.05337017 + -0.00017774;
const double grad = PHEMlightdllV5::Constants::GRAVITY_CONST * slope / 100.;
return MIN2(0., incl * v + 0.00001066 * mass + -0.38347107 - 20.0 * incl - grad);
}

@namdre
Copy link
Contributor Author

namdre commented Nov 28, 2024

also, there should be a way to have the cfModel override the coasting decelerating (trains compute this based on their resistance curve in MSCFModel_Rail::maxNextSpeed and MSCFModel_Rail::minNextSpeed)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant