Eclipse SUMO - Simulation of Urban MObility
EngineParameters.h
Go to the documentation of this file.
1 /****************************************************************************/
2 // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo
3 // Copyright (C) 2001-2019 German Aerospace Center (DLR) and others.
4 // This program and the accompanying materials
5 // are made available under the terms of the Eclipse Public License v2.0
6 // which accompanies this distribution, and is available at
7 // http://www.eclipse.org/legal/epl-v20.html
8 // SPDX-License-Identifier: EPL-2.0
9 /****************************************************************************/
15 /****************************************************************************/
16 
17 #ifndef ENGINEPARAMETERS_H_
18 #define ENGINEPARAMETERS_H_
19 
20 #include <iostream>
21 #include <iomanip>
22 
23 //gravity force
24 #define GRAVITY_MPS2 9.81
25 //horsepower to watts conversion factor
26 #define HP_TO_W 745.699872
27 //maximum engine time constant
28 #define TAU_MAX 0.5
29 //maximum degree for the engine polynomial
30 #define MAX_POLY_DEGREE 9
31 
33 
34 public:
35 
43  int degree;
44  double x[MAX_POLY_DEGREE];
45  };
46 
55  double rpm;
56  double deltaRpm;
57  };
58 
59  //id of the type of vehicle
60  std::string id;
61  //number of gears
62  int nGears;
63  //gear ratios
64  double* gearRatios;
65  //differential ratio
67  //wheel diameter in meters
69  //mass of vehicle
70  double mass_kg;
71  //air friction parameters
72  double cAir, a_m2, rho_kgpm3;
73  //precomputed air friction coefficient
75  //tires parameters
76  double cr1, cr2;
77  //precomputed rolling resistance parameters
78  double __cr1, __cr2;
79  //road slope in degrees
80  double slope;
81  //precomputed gravitational force
82  double __gravity;
83  //tires friction coefficient
85  //precomputed maximum acceleration with no slip
87  //engine mapping
89  //gear shifting rule
91  //engine efficiency
93  //factor taking into account inertia of rotating masses, such as flywheel
94  double massFactor;
95  //number of cylinders of the engine
96  int cylinders;
97  //simulation timestep
98  double dt;
99  //min and max rpm
100  double minRpm, maxRpm;
101  //brakes actuation time constant in second
102  double brakesTau_s;
103  //engine time constants for exhaust and burning
105  //whether tauBurn_s is fixed or dynamic
107  //other precomputed coefficients
112  double __engineTau1;
113  double __engineTau2;
117  //todo: finish
118  double minSpeed;
119 
123  void computeCoefficients();
124 
128  void dumpParameters(std::ostream& out);
129 
131  EngineParameters(const EngineParameters& other);
133  virtual ~EngineParameters();
134 
135 };
136 
137 #endif /* ENGINEPARAMETERS_H_ */
double __speedToRpmCoefficient
void dumpParameters(std::ostream &out)
double __maxNoSlipAcceleration
struct GearShiftingRules shiftingRule
double __rpmToSpeedCoefficient
double tiresFrictionCoefficient
EngineParameters & operator=(const EngineParameters &other)
#define MAX_POLY_DEGREE
double __maxAccelerationCoefficient
struct PolynomialEngineModelRpmToHp engineMapping
double __airFrictionCoefficient
double __speedToThrustCoefficient