HelpersHarmonoise.cpp

Go to the documentation of this file.
00001 /****************************************************************************/
00007 // Noise data collector for edges/lanes
00008 /****************************************************************************/
00009 // SUMO, Simulation of Urban MObility; see http://sumo.sourceforge.net/
00010 // Copyright 2001-2010 DLR (http://www.dlr.de/) and contributors
00011 /****************************************************************************/
00012 //
00013 //   This program is free software; you can redistribute it and/or modify
00014 //   it under the terms of the GNU General Public License as published by
00015 //   the Free Software Foundation; either version 2 of the License, or
00016 //   (at your option) any later version.
00017 //
00018 /****************************************************************************/
00019 
00020 
00021 // ===========================================================================
00022 // included modules
00023 // ===========================================================================
00024 #ifdef _MSC_VER
00025 #include <windows_config.h>
00026 #else
00027 #include <config.h>
00028 #endif
00029 
00030 #include "HelpersHarmonoise.h"
00031 #include <limits>
00032 #include <cmath>
00033 
00034 #ifdef HAVE_MESOSIM
00035 #include <microsim/MSGlobals.h>
00036 #include <mesosim/MELoop.h>
00037 #include <mesosim/MESegment.h>
00038 #endif
00039 
00040 #ifdef CHECK_MEMORY_LEAKS
00041 #include <foreign/nvwa/debug_new.h>
00042 #endif // CHECK_MEMORY_LEAKS
00043 
00044 
00045 // ===========================================================================
00046 // static definitions
00047 // ===========================================================================
00048 // ---------------------------------------------------------------------------
00049 // vehicle class noise emission coefficients
00050 // ---------------------------------------------------------------------------
00051 // rolling component, light vehicles, alpha
00052 double
00053 HelpersHarmonoise::myR_A_C1_Parameter[27] = { 69.9, 69.9, 69.9, 74.9, 74.9, 74.9, 77.3, 77.5, 78.1, 78.3, 78.9, 77.8, 78.5, 81.9, 84.1, 86.5, 88.6, 88.2, 87.6, 85.8, 82.8, 80.2, 77.6, 75.0, 72.8, 70.4, 67.9 };
00054 
00055 // rolling component, light vehicles, beta
00056 double
00057 HelpersHarmonoise::myR_B_C1_Parameter[27] = { 33.0, 33.0, 33.0, 15.2, 15.2, 15.2, 41.0, 41.2, 42.3, 41.8, 38.6, 35.5, 31.7, 21.5, 21.2, 23.5, 29.1, 33.5, 34.1, 35.1, 36.4, 37.4, 38.9, 39.7, 39.7, 39.7, 39.7 };
00058 
00059 
00060 // rolling component, heavy vehicles, alpha
00061 double
00062 HelpersHarmonoise::myR_A_C3_Parameter[27] = { 80.5, 80.5, 80.5, 82.5, 83.5, 83.5, 86.5, 88.3, 88.7, 88.3, 91.4, 92.2, 96.0, 98.1, 97.8, 98.4, 97.2, 94.6, 95.9, 90.5, 87.1, 85.1, 83.2, 81.3, 81.3, 81.3, 81.3 };
00063 
00064 // rolling component, heavy vehicles, beta
00065 double
00066 HelpersHarmonoise::myR_B_C3_Parameter[27] = { 33.0, 33.0, 33.0, 30.0, 30.0, 30.0, 41.0, 41.2, 42.3, 41.8, 38.6, 35.5, 31.7, 21.5, 21.2, 23.5, 29.1, 33.5, 34.1, 35.1, 36.4, 37.4, 38.9, 39.7, 39.7, 39.7, 39.7 };
00067 
00068 
00069 
00070 // traction component, light vehicles, alpha
00071 double
00072 HelpersHarmonoise::myT_A_C1_Parameter[27] = { 90.0, 92.0, 89.0, 91.0, 92.4, 94.8, 90.8, 86.8, 86.2, 84.5, 84.5, 84.8, 83.5, 81.8, 81.4, 79.0, 79.2, 81.4, 85.5, 85.8, 85.2, 82.9, 81.0, 78.2, 77.2, 75.2, 74.2 };
00073 
00074 // traction component, light vehicles, beta
00075 double
00076 HelpersHarmonoise::myT_B_C1_Parameter[27] = { 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 9.4, 9.4, 9.4, 9.4, 9.4, 9.4, 9.4, 9.4, 9.4, 9.4, 9.4, 9.4, 9.4, 9.4, 9.4, 9.4, 9.4 };
00077 
00078 
00079 // traction component, heavy vehicles, alpha
00080 double
00081 HelpersHarmonoise::myT_A_C3_Parameter[27] = { 97.7, 97.3, 98.2, 103.3, 109.5, 104.3, 99.8, 100.2, 98.9, 99.5, 100.7, 101.2, 100.6, 100.2, 97.4, 97.1, 97.8, 97.3, 95.8, 94.9, 92.7, 90.6, 89.9, 87.9, 85.9, 83.8, 82.2 };
00082 
00083 // traction component, heavy vehicles, beta
00084 double
00085 HelpersHarmonoise::myT_B_C3_Parameter[27] = { 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 11.7, 11.7, 11.7, 11.7, 11.7, 11.7, 11.7, 11.7, 11.7, 11.7, 11.7, 11.7, 11.7, 11.7, 11.7, 11.7, 11.7 };
00086 
00087 
00088 // ---------------------------------------------------------------------------
00089 // A-weighted correction for octave bands
00090 // ---------------------------------------------------------------------------
00091 double
00092 HelpersHarmonoise::myAOctaveBandCorrection[27] = { -44.7, -39.4, -34.6, -30.2, -26.2, -22.5, -19.1, -16.1, -13.4,
00093         -10.9, -8.6, -6.6, -4.8, -3.2, -1.9, -0.8, 0.0, +0.6,
00094         +1.0, +1.2, +1.3, +1.2, +1.0, +0.5, -0.1, -1.1, -2.5
00095                                                  };
00096 
00097 
00098 
00099 double
00100 mySurfaceCorrection[27] = { 0.7, 0.2, 3.6, -1.0, -1.8, -0.1, -0.9, -0.7, -1.1, -0.5, -1.5,
00101                             -2.4, -3.0, -4.6, -5.8, -6.5, -7.9, -7.8, -7.2, -6.3, -5.6,
00102                             -5.5, -4.8, -4.3
00103                           };
00104 
00105 
00106 // ===========================================================================
00107 // method definitions
00108 // ===========================================================================
00109 SUMOReal
00110 HelpersHarmonoise::computeNoise(SUMOEmissionClass c, double v, double a) throw() {
00111     double *alphaT, *betaT, *alphaR, *betaR;
00112     double ac = 0;
00113     if (c>=SVE_HDV_3_1 && c<=SVE_HDV_12_12) {
00114         alphaT = myT_A_C3_Parameter;
00115         betaT = myT_B_C3_Parameter;
00116         alphaR = myR_A_C3_Parameter;
00117         betaR = myR_B_C3_Parameter;
00118         ac = 5.6;
00119     } else if (c!=SVE_ZERO_EMISSIONS) {
00120         alphaT = myT_A_C1_Parameter;
00121         betaT = myT_B_C1_Parameter;
00122         alphaR = myR_A_C1_Parameter;
00123         betaR = myR_B_C1_Parameter;
00124         ac = 4.4;
00125     } else {
00126         return 0;
00127     }
00128     //
00129     double L_low = 0;
00130     double L_high = 0;
00131     v = v * 3.6;
00132     double s = -30.;//
00133     for (unsigned int i=0; i<27; ++i) {
00134         double crc_low = alphaR[i] + betaR[i]*log10(v/70.) + 10.*log10(.8);// + mySurfaceCorrection[i];
00135         double ctc_low = alphaT[i] + betaT[i]*((v-70.)/70.) + a*ac + 10.*log10(.2);
00136         double Li_low = 10. * log10(pow(10., (crc_low/10.)) + pow(10., (ctc_low/10.)));
00137         Li_low += s;
00138         double crc_high = alphaR[i] + betaR[i]*log10(v/70.) + 10.*log10(.2);// + mySurfaceCorrection[i];
00139         double ctc_high = alphaT[i] + betaT[i]*((v-70.)/70.) + a*ac + 10.*log10(.8);
00140         double Li_high = 10. * log10(pow(10., (crc_high/10.)) + pow(10., (ctc_high/10.)));
00141         Li_high += s;
00142         L_low += pow(10., (Li_low+myAOctaveBandCorrection[i])/10.);
00143         L_high += pow(10., (Li_high+myAOctaveBandCorrection[i])/10.);
00144     }
00145     L_low = (10. * log10(L_low));
00146     L_high = (10. * log10(L_high));
00147     SUMOReal v1 = (SUMOReal)(10. * log10(pow(10., L_low/10.) + pow(10., L_high/10.)));
00148     return v1;
00149 }
00150 
00151 
00152 
00153 
00154 /****************************************************************************/
00155 

Generated on Wed May 5 00:06:30 2010 for Sumo - Simulation of Urban MObility by  doxygen 1.5.6