14 List<string> headerLineFCvalues,
15 List<List<double>> matrixFCvalues,
16 List<string> headerLinePollutants,
17 List<List<double>> matrixPollutants,
18 List<double> idlingFCvalues,
19 List<double> idlingPollutants)
41 RatedPower = Vehicle.EngineData.ICEData.Prated.Value +
Vehicle.EngineData.EMData.Prated.Value;
58 _pNormV0 = Vehicle.FLDData.P_n_max_v0.Value / 3.6;
60 _pNormV1 = Vehicle.FLDData.P_n_max_v1.Value / 3.6;
64 List<string> FCvaluesIdentifier =
new List<string>();
65 List<List<double>> FCvaluesMeasures =
new List<List<double>>();
66 List<List<double>> normalizedFCvaluesMeasures =
new List<List<double>>();
67 for (
int i = 0; i < headerLineFCvalues.Count; i++)
69 FCvaluesIdentifier.Add(headerLineFCvalues[i]);
70 FCvaluesMeasures.Add(
new List<double>());
71 normalizedFCvaluesMeasures.Add(
new List<double>());
75 List<string> pollutantIdentifier =
new List<string>();
76 List<List<double>> pollutantMeasures =
new List<List<double>>();
77 List<List<double>> normalizedPollutantMeasures =
new List<List<double>>();
78 for (
int i = 0; i < headerLinePollutants.Count; i++)
80 pollutantIdentifier.Add(headerLinePollutants[i]);
81 pollutantMeasures.Add(
new List<double>());
82 normalizedPollutantMeasures.Add(
new List<double>());
87 for (
int i = 0; i <
Vehicle.TransmissionData.Transm[
"Speed"].Count; i++)
101 int headerFCCount = headerLineFCvalues.Count;
102 for (
int i = 0; i < matrixFCvalues.Count; i++)
104 for (
int j = 0; j < matrixFCvalues[i].Count; j++)
106 if (matrixFCvalues[i].Count != headerFCCount + 1)
116 FCvaluesMeasures[j - 1].Add(matrixFCvalues[i][j] *
RatedPower);
117 normalizedFCvaluesMeasures[j - 1].Add(matrixFCvalues[i][j]);
126 for (
int i = 0; i < headerLineFCvalues.Count; i++)
134 double pollutantMultiplyer = 1;
152 int headerCount = headerLinePollutants.Count;
153 for (
int i = 0; i < matrixPollutants.Count; i++)
155 for (
int j = 0; j < matrixPollutants[i].Count; j++)
157 if (matrixPollutants[i].Count != headerCount + 1)
167 pollutantMeasures[j - 1].Add(matrixPollutants[i][j] * pollutantMultiplyer);
168 normalizedPollutantMeasures[j - 1].Add(matrixPollutants[i][j]);
176 for (
int i = 0; i < headerLinePollutants.Count; i++)
183 _FleetMix =
new Dictionary<string, double>();
841 CEP newCEP =
new CEP(cps.Select(p => p.HeavyVehicle ? 1 : 0).Sum() > 0,
842 cps.Select(p => p._massVehicle).Sum(),
843 cps.Select(p => p._vehicleLoading).Sum(),
844 cps.Select(p => p._vehicleMassRot).Sum(),
845 cps.Select(p => p._crossSectionalArea).Sum(),
846 cps.Select(p => p._cWValue).Sum(),
847 cps.Select(p => p._resistanceF0).Sum(),
848 cps.Select(p => p._resistanceF1).Sum(),
849 cps.Select(p => p._resistanceF2).Sum(),
850 cps.Select(p => p._resistanceF3).Sum(),
851 cps.Select(p => p._resistanceF4).Sum(),
852 cps.Select(p => p._axleRatio).Sum(),
853 cps.Select(p => p._auxPower).Sum(),
854 cps.Select(p => p.RatedPower).Sum(),
855 cps.Select(p => p._engineIdlingSpeed).Sum(),
856 cps.Select(p => p._engineRatedSpeed).Sum(),
857 cps.Select(p => p._effectiveWheelDiameter).Sum(),
858 cps.Select(p => p._pNormV0).Sum(),
859 cps.Select(p => p._pNormP0).Sum(),
860 cps.Select(p => p._pNormV1).Sum(),
861 cps.Select(p => p._pNormP1).Sum());
863 #region Fleetmix and Fueltype
864 if (cps.Select(p => p.FuelType).Min() == cps.Select(p => p.FuelType).Max())
865 newCEP.FuelType = cps.First().FuelType;
867 newCEP.FuelType =
"Mix";
869 newCEP._FleetMix =
new Dictionary<string, double>();
870 foreach (
string id in cps.First()._FleetMix.Keys)
872 newCEP._FleetMix.Add(
id, cps.Select(p => p._FleetMix[
id]).Sum());
877 #region SpeedRotationalTable
878 double minSpeedRotational = cps.Select(p => p._speedPatternRotational.First()).Min();
879 double maxSpeedRotational = cps.Select(p => p._speedPatternRotational.Last()).Max();
881 newCEP._speedPatternRotational
886 newCEP._speedCurveRotational =
new List<double>();
887 newCEP._gearTransmissionCurve =
new List<double>();
889 for (
int i = 0; i < newCEP._speedPatternRotational.Count; i++)
891 newCEP._speedCurveRotational.Add(cps.Select(p => p.GetRotationalCoeffecient(newCEP._speedPatternRotational[i])).Sum());
893 newCEP._gearTransmissionCurve.Add(cps.Select(p => p.GetGearCoeffecient(newCEP._speedPatternRotational[i])).Sum());
897 #region NormalizingPower
900 if (newCEP.HeavyVehicle)
902 newCEP.NormalizingPower = newCEP.RatedPower;
907 newCEP.NormalizingPower = newCEP.DrivingPower;
913 double minNormPowerPatternFC = cps.Select(p => p._normalizedPowerPatternFCvalues.First()).Min();
914 double maxNormPowerPatternFC = cps.Select(p => p._normalizedPowerPatternFCvalues.Last()).Max();
916 newCEP._normalizedPowerPatternFCvalues
918 maxNormPowerPatternFC,
921 newCEP._cepCurveFCvalues =
new Dictionary<string, List<double>>();
922 newCEP._normedCepCurveFCvalues =
new Dictionary<string, List<double>>();
923 newCEP._powerPatternFCvalues =
new List<double>();
925 foreach (
string id in cps.First()._cepCurveFCvalues.Keys)
927 newCEP._cepCurveFCvalues.Add(
id,
new List<double>());
928 newCEP._normedCepCurveFCvalues.Add(
id,
new List<double>());
931 for (
int i = 0; i < newCEP._normalizedPowerPatternFCvalues.Count; i++)
933 foreach (
string id in newCEP._cepCurveFCvalues.Keys)
935 double newCepVal = cps.Select(p => p.GetNormedEmission(
id, newCEP._normalizedPowerPatternFCvalues[i],
double.MaxValue, Helper)).Sum();
936 newCEP._cepCurveFCvalues[id].Add(newCepVal * newCEP.RatedPower);
937 newCEP._normedCepCurveFCvalues[id].Add(newCepVal);
939 newCEP._powerPatternFCvalues.Add(newCEP._normalizedPowerPatternFCvalues[i] * newCEP.RatedPower);
944 double minNormPowerPattern = cps.Select(p => p._normailzedPowerPatternPollutants.First()).Min();
945 double maxNormPowerPattern = cps.Select(p => p._normailzedPowerPatternPollutants.Last()).Max();
947 newCEP._normailzedPowerPatternPollutants
952 newCEP._cepCurvePollutants =
new Dictionary<string, List<double>>();
953 newCEP._cepNormalizedCurvePollutants =
new Dictionary<string, List<double>>();
954 newCEP._powerPatternPollutants =
new List<double>();
956 foreach (
string id in cps.First()._cepCurvePollutants.Keys)
958 newCEP._cepCurvePollutants.Add(
id,
new List<double>());
959 newCEP._cepNormalizedCurvePollutants.Add(
id,
new List<double>());
962 for (
int i = 0; i < newCEP._normailzedPowerPatternPollutants.Count; i++)
964 foreach (
string id in newCEP._cepCurvePollutants.Keys)
968 double newCepVal = cps.Select(p => p.GetNormedEmission(
id, newCEP._normailzedPowerPatternPollutants[i],
double.MaxValue, Helper)).Sum();
969 newCEP._cepCurvePollutants[id].Add(newCepVal * newCEP.RatedPower);
970 newCEP._cepNormalizedCurvePollutants[id].Add(newCepVal);
974 newCEP._cepCurvePollutants[id].Add(cps.Select(p => p.GetEmission(
id, newCEP._normailzedPowerPatternPollutants[i] * p.NormalizingPower,
double.MaxValue, Helper)).Sum());
975 newCEP._cepNormalizedCurvePollutants[id].Add(cps.Select(p => p.GetNormedEmission(
id, newCEP._normailzedPowerPatternPollutants[i],
double.MaxValue, Helper)).Sum());
978 newCEP._powerPatternPollutants.Add(newCEP._normailzedPowerPatternPollutants[i] * newCEP.NormalizingPower);
983 newCEP._idlingValueFCvalues =
new Dictionary<string, double>();
984 newCEP._idlingValuesPollutants =
new Dictionary<string, double>();
986 foreach (
string id in cps.First()._idlingValueFCvalues.Keys)
988 newCEP._idlingValueFCvalues.Add(
id, cps.Select(p => p._idlingValueFCvalues[
id]).Sum());
991 foreach (
string id in cps.First()._idlingValuesPollutants.Keys)
993 newCEP._idlingValuesPollutants.Add(
id, cps.Select(p => p._idlingValuesPollutants[
id]).Sum());
998 double minTragTable = cps.Select(p => p._nNormTable.First()).Min();
999 double maxTragTable = cps.Select(p => p._nNormTable.Last()).Max();
1006 newCEP._dragNormTable =
new List<double>();
1008 for (
int i = 0; i < newCEP._nNormTable.Count; i++)
1010 newCEP._dragNormTable.Add(cps.Select(p => p.GetDragCoeffecient(newCEP._nNormTable[i])).Sum());
1020 #region SingleValues
1021 CEP newCEP =
new CEP(cp1.HeavyVehicle,
1022 d * cp1._massVehicle,
1023 d * cp1._vehicleLoading,
1024 d * cp1._vehicleMassRot,
1025 d * cp1._crossSectionalArea,
1027 d * cp1._resistanceF0,
1028 d * cp1._resistanceF1,
1029 d * cp1._resistanceF2,
1030 d * cp1._resistanceF3,
1031 d * cp1._resistanceF4,
1035 d * cp1._engineIdlingSpeed,
1036 d * cp1._engineRatedSpeed,
1037 d * cp1._effectiveWheelDiameter,
1043 #region Fleetmix and Fueltype
1044 newCEP.FuelType = cp1.FuelType;
1045 newCEP._FleetMix =
new Dictionary<string, double>();
1046 foreach (
string id in cp1._FleetMix.Keys)
1048 if (newCEP.FuelType ==
id)
1049 newCEP._FleetMix.Add(newCEP.FuelType, d);
1051 newCEP._FleetMix.Add(
id, 0);
1056 #region SpeedRotationalTable
1057 newCEP._speedPatternRotational =
new List<double>(cp1._speedPatternRotational);
1058 newCEP._speedCurveRotational =
new List<double>(cp1._speedCurveRotational.Select(p => p * d));
1059 newCEP._gearTransmissionCurve =
new List<double>(cp1._gearTransmissionCurve.Select(p => p * d));
1062 #region NormalizingPower
1065 if (newCEP.HeavyVehicle)
1067 newCEP.NormalizingPower = newCEP.RatedPower;
1072 newCEP.NormalizingPower = newCEP.DrivingPower;
1078 newCEP._powerPatternFCvalues =
new List<double>(cp1._powerPatternFCvalues.Select(p => p * d));
1079 newCEP._normalizedPowerPatternFCvalues =
new List<double>(cp1._normalizedPowerPatternFCvalues);
1080 newCEP._cepCurveFCvalues =
new Dictionary<string, List<double>>();
1081 newCEP._normedCepCurveFCvalues =
new Dictionary<string, List<double>>();
1083 foreach (
string id in cp1._cepCurveFCvalues.Keys)
1085 newCEP._cepCurveFCvalues.Add(
id,
new List<double>(cp1._cepCurveFCvalues[
id].Select(p => p * d)));
1086 newCEP._normedCepCurveFCvalues.Add(
id,
new List<double>(cp1._normedCepCurveFCvalues[
id].Select(p => p * d)));
1091 newCEP._powerPatternPollutants =
new List<double>(cp1._normailzedPowerPatternPollutants.Select(p => p * newCEP.NormalizingPower));
1092 newCEP._normailzedPowerPatternPollutants =
new List<double>(cp1._normailzedPowerPatternPollutants);
1093 newCEP._cepCurvePollutants =
new Dictionary<string, List<double>>();
1094 newCEP._cepNormalizedCurvePollutants =
new Dictionary<string, List<double>>();
1096 foreach (
string id in cp1._cepCurvePollutants.Keys)
1098 newCEP._cepCurvePollutants.Add(
id,
new List<double>(cp1._cepCurvePollutants[
id].Select(p => p * d)));
1099 newCEP._cepNormalizedCurvePollutants.Add(
id,
new List<double>(cp1._cepNormalizedCurvePollutants[
id].Select(p => p * d)));
1103 #region IdlingValues
1104 newCEP._idlingValueFCvalues =
new Dictionary<string, double>();
1105 newCEP._idlingValuesPollutants =
new Dictionary<string, double>();
1107 foreach (
string id in cp1._idlingValueFCvalues.Keys)
1109 newCEP._idlingValueFCvalues.Add(
id,
1110 cp1._idlingValueFCvalues[
id] * d);
1113 foreach (
string id in cp1._idlingValuesPollutants.Keys)
1115 newCEP._idlingValuesPollutants.Add(
id,
1116 cp1._idlingValuesPollutants[
id] * d);
1121 newCEP._nNormTable =
new List<double>(cp1._nNormTable);
1122 newCEP._dragNormTable =
new List<double>(cp1._dragNormTable.Select(p => p * d));