Code development platform for open source projects from the European Union institutions :large_blue_circle: EU Login authentication by SMS has been phased out. To see alternatives please check here

Skip to content
Snippets Groups Projects
Commit 1ef96c69 authored by Markus Quaritsch's avatar Markus Quaritsch
Browse files

handle case of simulation runs with no wheel power available - ignore calculation of k_vehline

parent 0e1d1aef
No related branches found
No related tags found
No related merge requests found
......@@ -193,6 +193,7 @@ namespace TUGraz.VectoCore.OutputData
return _vehLine[fuel.FuelType];
}
if (Data.AsEnumerable().Any(r => r.Field<SI>(ModalResultField.P_wheel_in.GetName()) != null)) {
double k, d, r;
VectoMath.LeastSquaresFitting(
GetValues(
......@@ -207,6 +208,9 @@ namespace TUGraz.VectoCore.OutputData
return _vehLine[fuel.FuelType];
}
return null;
}
public void CalculateAggregateValues()
{
var duration = Duration;
......
......@@ -444,7 +444,10 @@ namespace TUGraz.VectoCore.OutputData
row[FcCol(Fields.K_ENGLINE, suffix)] = correction.ConvertToGramPerKiloWattHour();
row[FcCol(Fields.K_VEHLINE, suffix)] = modData.VehicleLineSlope(fuel).ConvertToGramPerKiloWattHour();
var vehLine = modData.VehicleLineSlope(fuel);
if (vehLine != null) {
row[FcCol(Fields.K_VEHLINE, suffix)] = vehLine.ConvertToGramPerKiloWattHour();
}
var fcEssCorr = fcModSum + correction * workESS;
row[FcCol(Fields.FCESS_H_CORR, suffix)] = duration != null ? (fcEssCorr / duration).ConvertToGrammPerHour() : null;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment