SUMO - Simulation of Urban MObility
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
PHEMCEP.h
Go to the documentation of this file.
1 /****************************************************************************/
10 // Helper class for PHEM Light, holds a specific CEP for a PHEM emission class
11 /****************************************************************************/
12 // SUMO, Simulation of Urban MObility; see http://sumo-sim.org/
13 // Copyright (C) 2013-2014 DLR (http://www.dlr.de/) and contributors
14 /****************************************************************************/
15 //
16 // This file is part of SUMO.
17 // SUMO is free software: you can redistribute it and/or modify
18 // it under the terms of the GNU General Public License as published by
19 // the Free Software Foundation, either version 3 of the License, or
20 // (at your option) any later version.
21 //
22 /****************************************************************************/
23 #ifndef PHEMCEP_h
24 #define PHEMCEP_h
25 
26 // ===========================================================================
27 // included modules
28 // ===========================================================================
29 #ifdef _MSC_VER
30 #include <windows_config.h>
31 #else
32 #include <config.h>
33 #endif
34 
35 #include <vector>
38 #include "PHEMCEP.h"
39 #include "PHEMConstants.h"
40 
41 
42 // ===========================================================================
43 // class definitions
44 // ===========================================================================
49 class PHEMCEP {
50 public:
51  /*** @brief Constructor
52  * @param[in] emissionClass PHEM emission class of vehicle
53  * @param[in] vehicleMass vehicle mass
54  * @param[in] vehicleLoading vehicle loading
55  * @param[in] vehicleMassRot rotational mass of vehicle
56  * @param[in] crossArea crosssectional area of vehicle
57  * @param[in] cWValue cw-value
58  * @param[in] f0 Rolling resistance f0
59  * @param[in] f1 Rolling resistance f1
60  * @param[in] f2 Rolling resistance f2
61  * @param[in] f3 Rolling resistance f3
62  * @param[in] f4 Rolling resistance f4
63  * @param[in] ratedPower rated power of vehicle
64  * @param[in] pNormV0 out variable for step function to get maximum normalized rated power over speed
65  * @param[in] pNormP0 out variable for step function to get maximum normalized rated power over speed
66  * @param[in] pNormV1 out variable for step function to get maximum normalized rated power over speed
67  * @param[in] pNormP1 out variable for step function to get maximum normalized rated power over speed
68  * @param[in] vehicleFuelType out variable for fuel type (D, G) of vehicle, needed for density of fuel
69  * @param[in] matrixFC Coefficients of the fuel consumption
70  * @param[in] headerLine Definition of covered pollutants
71  * @param[in] headerLinePollutants Coefficients of the pollutants
72  * @param[in] matrixPollutants Coefficients of the pollutants
73  * @param[in] matrixSpeedRotational Table for rotational coefficients over speed
74  */
75  PHEMCEP(bool heavyVehicel, SUMOEmissionClass emissionClass, const std::string& emissionClassIdentifier,
76  double vehicleMass, double vehicleLoading, double vehicleMassRot,
77  double crossArea, double cWValue,
78  double f0, double f1, double f2, double f3, double f4,
79  double ratedPower, double pNormV0, double pNormP0, double pNormV1,
80  double pNormP1, std:: string vehicelFuelType,
81  const std::vector< std::vector<double> >& matrixFC,
82  const std::vector<std::string>& headerLinePollutants,
83  const std::vector< std::vector<double> >& matrixPollutants,
84  const std::vector< std::vector<double> > matrixSpeedRotational
85  );
86 
87 
89  ~PHEMCEP();
90 
99  double CalcPower(double v, double a, double slope) const;
100 
101 
110  double GetMaxAccel(double v, double a, double gradient) const;
111 
117  double GetEmission(const std::string& pollutantIdentifier, double power) const;
118 
119 
124  return _emissionClass;
125  }
126 
127 
131  double GetResistanceF0() const {
132  return _resistanceF0;
133  }
134 
135 
139  double GetResistanceF1() const {
140  return _resistanceF1;
141  }
142 
143 
147  double GetResistanceF2() const {
148  return _resistanceF2;
149  }
150 
151 
155  double GetResistanceF3() const {
156  return _resistanceF3;
157  }
158 
159 
163  double GetResistanceF4() const {
164  return _resistanceF4;
165  }
166 
167 
172  double GetCdValue() const {
173  return _cwValue;
174  }
175 
179  double GetCrossSectionalArea() const {
180  return _crossSectionalArea;
181  }
182 
183 
187  double GetMassVehicle() const {
188  return _massVehicle;
189  }
190 
194  double GetVehicleLoading() const {
195  return _vehicleLoading;
196  }
197 
198 
202  double GetMassRot() const {
203  return _massRot;
204  }
205 
206 
210  double GetRatedPower() const {
211  return _ratedPower;
212  }
213 
217  std::string GetVehicleFuelType() const {
218  return _vehicleFuelType;
219  }
220 
221 private:
230  double Interpolate(double px, double p1, double p2, double e1, double e2) const;
231 
238  void FindLowerUpperInPattern(int& lowerIndex, int& upperIndex, std::vector<double> pattern, double value) const;
239 
243  double GetRotationalCoeffecient(double speed) const;
244 
248  double GetPMaxNorm(double speed) const;
249 
250 private:
264  double _cwValue;
268  double _massVehicle;
272  double _massRot;
274  double _ratedPower;
276  double _pNormV0;
278  double _pNormP0;
280  double _pNormV1;
282  double _pNormP1;
288  std::vector<double> _powerPatternFC;
290  std::vector<double> _powerPatternPollutants;
292  std::vector<double> _cepCurveFC;
296  std::vector<double> _speedPatternRotational;
298  std::vector<double> _speedCurveRotational;
300  std::string _vehicleFuelType;
301 
302 };
303 
304 #endif
305 
306 /****************************************************************************/