Eclipse SUMO - Simulation of Urban MObility
Loading...
Searching...
No Matches
RealisticEngineModel.h
Go to the documentation of this file.
1/****************************************************************************/
2// Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.dev/sumo
3// Copyright (C) 2001-2024 German Aerospace Center (DLR) and others.
4// This program and the accompanying materials are made available under the
5// terms of the Eclipse Public License 2.0 which is available at
6// https://www.eclipse.org/legal/epl-2.0/
7// This Source Code may also be made available under the following Secondary
8// Licenses when the conditions for such availability set forth in the Eclipse
9// Public License 2.0 are satisfied: GNU General Public License, version 2
10// or later which is available at
11// https://www.gnu.org/licenses/old-licenses/gpl-2.0-standalone.html
12// SPDX-License-Identifier: EPL-2.0 OR GPL-2.0-or-later
13/****************************************************************************/
18// A detailed engine model
19/****************************************************************************/
20
21#pragma once
22#include <config.h>
23
24#include "GenericEngineModel.h"
25
26#include <stdint.h>
27
29#include "EngineParameters.h"
30
31
48
49protected:
50
52 //current gear
54 //minimum speed to be considered for horsepower computation
56 //simulation sampling time
57 double dt_s;
58 //xml file with engine parameters
59 std::string xmlFile;
60 //id of the vehicle parameters to load
61 std::string vehicleType;
62
73 double rpmToSpeed_mps(double rpm, double wheelDiameter_m,
74 double differentialRatio, double gearRatio);
81 double rpmToSpeed_mps(double rpm);
82
93 double speed_mpsToRpm(double speed_mps, double wheelDiameter_m,
94 double differentialRatio, double gearRatio);
95
102 double speed_mpsToRpm(double speed_mps);
103
112 double speed_mpsToRpm(double speed_mps, double gearRatio);
113
122 double rpmToPower_hp(double rpm, const struct EngineParameters::PolynomialEngineModelRpmToHp* engineMapping);
123
130 double rpmToPower_hp(double rpm);
131
143 double speed_mpsToPower_hp(double speed_mps,
144 const struct EngineParameters::PolynomialEngineModelRpmToHp* engineMapping,
145 double wheelDiameter_m, double differentialRatio,
146 double gearRatio);
147
154 double speed_mpsToPower_hp(double speed_mps);
155
168 double speed_mpsToThrust_N(double speed_mps,
169 const struct EngineParameters::PolynomialEngineModelRpmToHp* engineMapping,
170 double wheelDiameter_m, double differentialRatio,
171 double gearRatio, double engineEfficiency);
172
180 double speed_mpsToThrust_N(double speed_mps);
181
191 double airDrag_N(double speed_mps, double cAir, double a_m2, double rho_kgpm3);
192
199 double airDrag_N(double speed_mps);
200
210 double rollingResistance_N(double speed_mps, double mass_kg, double cr1, double cr2);
217 double rollingResistance_N(double speed_mps);
218
226 double gravityForce_N(double mass_kg, double slope);
232 double gravityForce_N();
233
248 double opposingForce_N(double speed_mps, double mass_kg, double slope,
249 double cAir, double a_m2, double rho_kgpm3,
250 double cr1, double cr2);
251
258 double opposingForce_N(double speed_mps);
259
267 double maxNoSlipAcceleration_mps2(double slope, double frictionCoefficient);
268
275
282 double thrust_NToAcceleration_mps2(double thrust_N);
283
291 int performGearShifting(double speed_mps, double acceleration_mps2);
292
299 double getEngineTimeConstant_s(double rpm);
300
310 double maxEngineAcceleration_mps2(double speed_mps);
311
322 double getRealBrakingAcceleration(double speed_mps, double accel_mps2, double reqAccel_mps2, SUMOTime t);
323
324public:
326 virtual ~RealisticEngineModel();
327
339 virtual double getRealAcceleration(double speed_mps, double accel_mps2, double reqAccel_mps2, SUMOTime timeStep = 0);
340
344 void loadParameters();
345
352 virtual void setParameter(const std::string parameter, const std::string& value);
353 virtual void setParameter(const std::string parameter, double value);
354 virtual void setParameter(const std::string parameter, int value);
355
363 void getEngineData(double speed_mps, int& gear, double& rpm);
364};
long long int SUMOTime
Definition GUI.h:36
double maxEngineAcceleration_mps2(double speed_mps)
void getEngineData(double speed_mps, int &gear, double &rpm)
double airDrag_N(double speed_mps, double cAir, double a_m2, double rho_kgpm3)
virtual double getRealAcceleration(double speed_mps, double accel_mps2, double reqAccel_mps2, SUMOTime timeStep=0)
double speed_mpsToPower_hp(double speed_mps, const struct EngineParameters::PolynomialEngineModelRpmToHp *engineMapping, double wheelDiameter_m, double differentialRatio, double gearRatio)
double thrust_NToAcceleration_mps2(double thrust_N)
double opposingForce_N(double speed_mps, double mass_kg, double slope, double cAir, double a_m2, double rho_kgpm3, double cr1, double cr2)
double getRealBrakingAcceleration(double speed_mps, double accel_mps2, double reqAccel_mps2, SUMOTime t)
double rpmToPower_hp(double rpm, const struct EngineParameters::PolynomialEngineModelRpmToHp *engineMapping)
double rpmToSpeed_mps(double rpm, double wheelDiameter_m, double differentialRatio, double gearRatio)
double speed_mpsToThrust_N(double speed_mps, const struct EngineParameters::PolynomialEngineModelRpmToHp *engineMapping, double wheelDiameter_m, double differentialRatio, double gearRatio, double engineEfficiency)
double speed_mpsToRpm(double speed_mps, double wheelDiameter_m, double differentialRatio, double gearRatio)
virtual void setParameter(const std::string parameter, const std::string &value)
double rollingResistance_N(double speed_mps, double mass_kg, double cr1, double cr2)
int performGearShifting(double speed_mps, double acceleration_mps2)
double getEngineTimeConstant_s(double rpm)