17 public CEP(
bool heavyVehicle,
19 double vehicleLoading,
20 double vehicleMassRot,
29 List<double> transmissionGearRatios,
32 double engineIdlingSpeed,
33 double engineRatedSpeed,
34 double effictiveWheelDiameter,
39 string vehicelFuelType,
40 List<List<double>> matrixFC,
41 List<string> headerLinePollutants,
42 List<List<double>> matrixPollutants,
43 List<List<double>> matrixSpeedRotational,
44 List<List<double>> normedDragTable,
46 List<double> idlingPollutants)
72 List<string> pollutantIdentifier =
new List<string>();
73 List<List<double>> pollutantMeasures =
new List<List<double>>();
74 List<List<double>> normalizedPollutantMeasures =
new List<List<double>>();
77 for (
int i = 0; i < headerLinePollutants.Count; i++)
79 pollutantIdentifier.Add(headerLinePollutants[i]);
83 for (
int i = 0; i < headerLinePollutants.Count; i++)
85 pollutantMeasures.Add(
new List<double>());
86 normalizedPollutantMeasures.Add(
new List<double>());
93 for (
int i = 0; i < matrixSpeedRotational.Count; i++)
95 if (matrixSpeedRotational[i].Count != 3)
106 for (
int i = 0; i < normedDragTable.Count; i++)
108 if (normedDragTable[i].Count != 2)
120 for (
int i = 0; i < matrixFC.Count; i++)
122 if (matrixFC[i].Count != 2)
134 double pollutantMultiplyer = 1;
155 int headerCount = headerLinePollutants.Count;
156 for (
int i = 0; i < matrixPollutants.Count; i++)
158 for (
int j = 0; j < matrixPollutants[i].Count; j++)
160 if (matrixPollutants[i].Count != headerCount + 1)
170 pollutantMeasures[j - 1].Add(matrixPollutants[i][j] * pollutantMultiplyer);
171 normalizedPollutantMeasures[j - 1].Add(matrixPollutants[i][j]);
179 for (
int i = 0; i < headerLinePollutants.Count; i++)
679 if (value <= pattern.First())
686 if (value >= pattern.Last())
688 lowerIndex = pattern.Count - 1;
689 upperIndex = pattern.Count - 1;
694 int middleIndex = (pattern.Count - 1) / 2;
695 upperIndex = pattern.Count - 1;
698 while (upperIndex - lowerIndex > 1)
700 if (pattern[middleIndex] == value)
702 lowerIndex = middleIndex;
703 upperIndex = middleIndex;
706 else if (pattern[middleIndex] < value)
708 lowerIndex = middleIndex;
709 middleIndex = (upperIndex - lowerIndex) / 2 + lowerIndex;
713 upperIndex = middleIndex;
714 middleIndex = (upperIndex - lowerIndex) / 2 + lowerIndex;
718 if (pattern[lowerIndex] <= value && value < pattern[upperIndex])
769 CEP newCEP =
new CEP(cps.Select(p => p.HeavyVehicle ? 1 : 0).Sum() > 0,
770 cps.Select(p => p._massVehicle).Sum(),
771 cps.Select(p => p._vehicleLoading).Sum(),
772 cps.Select(p => p._vehicleMassRot).Sum(),
773 cps.Select(p => p._crossSectionalArea).Sum(),
774 cps.Select(p => p._cWValue).Sum(),
775 cps.Select(p => p._resistanceF0).Sum(),
776 cps.Select(p => p._resistanceF1).Sum(),
777 cps.Select(p => p._resistanceF2).Sum(),
778 cps.Select(p => p._resistanceF3).Sum(),
779 cps.Select(p => p._resistanceF4).Sum(),
780 cps.Select(p => p._axleRatio).Sum(),
781 cps.Select(p => p._auxPower).Sum(),
782 cps.Select(p => p._ratedPower).Sum(),
783 cps.Select(p => p._engineIdlingSpeed).Sum(),
784 cps.Select(p => p._engineRatedSpeed).Sum(),
785 cps.Select(p => p._effectiveWheelDiameter).Sum(),
786 cps.Select(p => p._pNormV0).Sum(),
787 cps.Select(p => p._pNormP0).Sum(),
788 cps.Select(p => p._pNormV1).Sum(),
789 cps.Select(p => p._pNormP1).Sum());
791 newCEP._fuelType = cps.First().FuelType;
794 #region SpeedRotationalTable
795 double minSpeedRotational = cps.Select(p => p._speedPatternRotational.First()).
Min();
796 double maxSpeedRotational = cps.Select(p => p._speedPatternRotational.Last()).
Max();
798 newCEP._speedPatternRotational
803 newCEP._speedCurveRotational =
new List<double>();
804 newCEP._gearTransmissionCurve =
new List<double>();
806 for (
int i = 0; i < newCEP._speedPatternRotational.Count; i++)
808 newCEP._speedCurveRotational.Add(cps.Select(p => p.GetRotationalCoeffecient(newCEP._speedPatternRotational[i])).Sum());
810 newCEP._gearTransmissionCurve.Add(cps.Select(p => p.GetGearCoeffecient(newCEP._speedPatternRotational[i])).Sum());
814 #region NormalizingPower
817 if (newCEP._heavyVehicle)
819 newCEP._normalizingPower = newCEP._ratedPower;
824 newCEP._normalizingPower = newCEP._drivingPower;
830 double minNormPowerPatternFC = cps.Select(p => p._normalizedPowerPatternFC.First()).Min();
831 double maxNormPowerPatternFC = cps.Select(p => p._normalizedPowerPatternFC.Last()).Max();
833 newCEP._normalizedPowerPatternFC
835 maxNormPowerPatternFC,
838 newCEP._cepCurveFC =
new List<double>();
839 newCEP._normedCepCurveFC =
new List<double>();
840 newCEP._powerPatternFC =
new List<double>();
842 for (
int i = 0; i < newCEP._normalizedPowerPatternFC.Count; i++)
844 double newCepVal = cps.Select(p => p.GetNormedEmission(
"FC", newCEP._normalizedPowerPatternFC[i],
double.MaxValue, Helper)).Sum();
845 newCEP._cepCurveFC.Add(newCepVal * newCEP._ratedPower);
846 newCEP._normedCepCurveFC.Add(newCepVal);
847 newCEP._powerPatternFC.Add(newCEP._normalizedPowerPatternFC[i] * newCEP._ratedPower);
852 double minNormPowerPattern = cps.Select(p => p._normailzedPowerPatternPollutants.First()).Min();
853 double maxNormPowerPattern = cps.Select(p => p._normailzedPowerPatternPollutants.Last()).Max();
855 newCEP._normailzedPowerPatternPollutants
860 newCEP._cepCurvePollutants =
new Dictionary<string, List<double>>();
861 newCEP._powerPatternPollutants =
new List<double>();
862 newCEP._cepNormalizedCurvePollutants =
new Dictionary<string, List<double>>();
864 foreach (
string id in cps.First()._cepCurvePollutants.Keys)
866 newCEP._cepCurvePollutants.Add(
id,
new List<double>());
867 newCEP._cepNormalizedCurvePollutants.Add(
id,
new List<double>());
870 for (
int i = 0; i < newCEP._normailzedPowerPatternPollutants.Count; i++)
872 foreach (
string id in newCEP._cepCurvePollutants.Keys)
876 double newCepVal = cps.Select(p => p.GetNormedEmission(
id, newCEP._normailzedPowerPatternPollutants[i],
double.MaxValue, Helper)).Sum();
877 newCEP._cepCurvePollutants[id].Add(newCepVal * newCEP._ratedPower);
878 newCEP._cepNormalizedCurvePollutants[id].Add(newCepVal);
882 newCEP._cepCurvePollutants[id].Add(cps.Select(p => p.GetEmission(
id, newCEP._normailzedPowerPatternPollutants[i] * p._normalizingPower,
double.MaxValue, Helper)).Sum());
883 newCEP._cepNormalizedCurvePollutants[id].Add(cps.Select(p => p.GetNormedEmission(
id, newCEP._normailzedPowerPatternPollutants[i],
double.MaxValue, Helper)).Sum());
886 newCEP._powerPatternPollutants.Add(newCEP._normailzedPowerPatternPollutants[i] * newCEP.NormalizingPower);
891 newCEP._idlingValueFC = cps.Select(p => p._idlingValueFC).Sum();
892 newCEP._idlingValuesPollutants =
new Dictionary<string, double>();
894 foreach (
string id in cps.First()._idlingValuesPollutants.Keys)
896 newCEP._idlingValuesPollutants.Add(
id, cps.Select(p => p._idlingValuesPollutants[
id]).Sum());
901 double minTragTable = cps.Select(p => p._nNormTable.First()).Min();
902 double maxTragTable = cps.Select(p => p._nNormTable.Last()).Max();
909 newCEP._dragNormTable =
new List<double>();
911 for (
int i = 0; i < newCEP._nNormTable.Count; i++)
913 newCEP._dragNormTable.Add(cps.Select(p => p.GetDragCoeffecient(newCEP._nNormTable[i])).Sum());
924 CEP newCEP =
new CEP(cp1.HeavyVehicle,
925 d * cp1._massVehicle,
926 d * cp1._vehicleLoading,
927 d * cp1._vehicleMassRot,
928 d * cp1._crossSectionalArea,
930 d * cp1._resistanceF0,
931 d * cp1._resistanceF1,
932 d * cp1._resistanceF2,
933 d * cp1._resistanceF3,
934 d * cp1._resistanceF4,
938 d * cp1._engineIdlingSpeed,
939 d * cp1._engineRatedSpeed,
940 d * cp1._effectiveWheelDiameter,
946 newCEP._fuelType = cp1.FuelType;
949 #region SpeedRotationalTable
950 newCEP._speedPatternRotational =
new List<double>(cp1._speedPatternRotational);
951 newCEP._speedCurveRotational =
new List<double>(cp1._speedCurveRotational.Select(p => p * d));
952 newCEP._gearTransmissionCurve =
new List<double>(cp1._gearTransmissionCurve.Select(p => p * d));
955 #region NormalizingPower
958 if (newCEP._heavyVehicle)
960 newCEP._normalizingPower = newCEP._ratedPower;
965 newCEP._normalizingPower = newCEP._drivingPower;
971 newCEP._powerPatternFC =
new List<double>(cp1._powerPatternFC.Select(p => p * d));
972 newCEP._normalizedPowerPatternFC =
new List<double>(cp1._normalizedPowerPatternFC);
973 newCEP._cepCurveFC =
new List<double>(cp1._cepCurveFC.Select(p => p * d));
974 newCEP._normedCepCurveFC =
new List<double>(cp1._normedCepCurveFC.Select(p => p * d));
978 newCEP._powerPatternPollutants =
new List<double>(cp1._normailzedPowerPatternPollutants.Select(p => p * newCEP._normalizingPower));
979 newCEP._normailzedPowerPatternPollutants =
new List<double>(cp1._normailzedPowerPatternPollutants);
980 newCEP._cepCurvePollutants =
new Dictionary<string, List<double>>();
981 newCEP._cepNormalizedCurvePollutants =
new Dictionary<string, List<double>>();
983 foreach (
string id in cp1._cepCurvePollutants.Keys)
985 newCEP._cepCurvePollutants.Add(
id,
new List<double>(cp1._cepCurvePollutants[
id].Select(p => p * d)));
986 newCEP._cepNormalizedCurvePollutants.Add(
id,
new List<double>(cp1._cepNormalizedCurvePollutants[
id].Select(p => p * d)));
991 newCEP._idlingValueFC = cp1._idlingValueFC * d;
992 newCEP._idlingValuesPollutants =
new Dictionary<string, double>();
994 foreach (
string id in cp1._idlingValuesPollutants.Keys)
996 newCEP._idlingValuesPollutants.Add(
id,
997 cp1._idlingValuesPollutants[
id] * d);
1002 newCEP._nNormTable =
new List<double>(cp1._nNormTable);
1003 newCEP._dragNormTable =
new List<double>(cp1._dragNormTable.Select(p => p * d));
CEP(bool heavyVehicle, double vehicleMass, double vehicleLoading, double vehicleMassRot, double crossArea, double cWValue, double f0, double f1, double f2, double f3, double f4, double axleRatio, List< double > transmissionGearRatios, double auxPower, double ratedPower, double engineIdlingSpeed, double engineRatedSpeed, double effictiveWheelDiameter, double pNormV0, double pNormP0, double pNormV1, double pNormP1, string vehicelFuelType, List< List< double > > matrixFC, List< string > headerLinePollutants, List< List< double > > matrixPollutants, List< List< double > > matrixSpeedRotational, List< List< double > > normedDragTable, double idlingFC, List< double > idlingPollutants)
CEP(bool heavyVehicle, double vehicleMass, double vehicleLoading, double vehicleMassRot, double crossArea, double cWValue, double f0, double f1, double f2, double f3, double f4, double axleRatio, double auxPower, double ratedPower, double engineIdlingSpeed, double engineRatedSpeed, double effictiveWheelDiameter, double pNormV0, double pNormP0, double pNormV1, double pNormP1)