Code development platform for open source projects from the European Union institutions :large_blue_circle: EU Login authentication by SMS will be completely phased out by mid-2025. To see alternatives please check here

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

add rounding for tc data, engine fc entries on drag curve

parent 2b953301
No related branches found
No related tags found
No related merge requests found
......@@ -145,13 +145,13 @@ namespace TUGraz.VectoCore.Models.Declaration
foreach (var entry in clusterResult) {
var dragTorque = fullLoadCurve.DragLoadStationaryTorque(entry.RPMtoRad()).Value();
var newRow = denormalizedData.NewRow();
newRow[FuelConsumptionMapReader.Fields.EngineSpeed] = entry;
newRow[FuelConsumptionMapReader.Fields.Torque] = dragTorque;
newRow[FuelConsumptionMapReader.Fields.EngineSpeed] = Math.Round(entry, 2, MidpointRounding.AwayFromZero);
newRow[FuelConsumptionMapReader.Fields.Torque] = Math.Round(dragTorque, 2, MidpointRounding.AwayFromZero);
newRow[FuelConsumptionMapReader.Fields.FuelConsumption] = 0;
denormalizedData.Rows.Add(newRow);
var newRow2 = denormalizedData.NewRow();
newRow2[FuelConsumptionMapReader.Fields.EngineSpeed] = entry;
newRow2[FuelConsumptionMapReader.Fields.Torque] = dragTorque - 100;
newRow2[FuelConsumptionMapReader.Fields.EngineSpeed] = Math.Round(entry, 2, MidpointRounding.AwayFromZero);
newRow2[FuelConsumptionMapReader.Fields.Torque] = Math.Round(dragTorque - 100, 2, MidpointRounding.AwayFromZero);
newRow2[FuelConsumptionMapReader.Fields.FuelConsumption] = 0;
denormalizedData.Rows.Add(newRow2);
}
......
......@@ -63,30 +63,30 @@ namespace TUGraz.VectoCore.Models.Declaration
// stall point
var stallPt = retVal.NewRow();
stallPt[colSpeedRatio] = speedRatioStallPt * ratio;
stallPt[colTqRatio] = torqueRatioStallPt / speedRAtioOverrunPt / ratio;
stallPt[colRefTq] = refTorqueStallPt;
stallPt[colSpeedRatio] = Math.Round(speedRatioStallPt * ratio, 4, MidpointRounding.AwayFromZero);
stallPt[colTqRatio] = Math.Round(torqueRatioStallPt / speedRAtioOverrunPt / ratio, 2, MidpointRounding.AwayFromZero);
stallPt[colRefTq] = Math.Round(refTorqueStallPt;
retVal.Rows.Add(stallPt);
// intermediate point
var intermediatePt = retVal.NewRow();
intermediatePt[colSpeedRatio] = speedRatioIntermediatePt * ratio;
intermediatePt[colTqRatio] = torqueRatioIntermediatePt / ratio;
intermediatePt[colRefTq] = refTorqueStallPt * refTorqueIntermediatePtFactor;
intermediatePt[colSpeedRatio] = Math.Round(speedRatioIntermediatePt * ratio, 4, MidpointRounding.AwayFromZero);
intermediatePt[colTqRatio] = Math.Round(torqueRatioIntermediatePt / ratio, 2, MidpointRounding.AwayFromZero);
intermediatePt[colRefTq] = Math.Round(refTorqueStallPt * refTorqueIntermediatePtFactor, 2, MidpointRounding.AwayFromZero);
retVal.Rows.Add(intermediatePt);
//coupling point
var couplingPt = retVal.NewRow();
couplingPt[colSpeedRatio] = speedRatioCouplingPt * speedRAtioOverrunPt * ratio;
couplingPt[colTqRatio] = torqueRatioCouplingPt / speedRAtioOverrunPt / ratio;
couplingPt[colRefTq] = refTorqueStallPt * refTorqueCouplingPtFactor;
couplingPt[colSpeedRatio] = Math.Round(speedRatioCouplingPt * speedRAtioOverrunPt * ratio, 4, MidpointRounding.AwayFromZero);
couplingPt[colTqRatio] = Math.Round(torqueRatioCouplingPt / speedRAtioOverrunPt / ratio, 2, MidpointRounding.AwayFromZero);
couplingPt[colRefTq] = Math.Round(refTorqueStallPt * refTorqueCouplingPtFactor, 2, MidpointRounding.AwayFromZero);
retVal.Rows.Add(couplingPt);
// overrun point
var overrunPt = retVal.NewRow();
overrunPt[colSpeedRatio] = speedRAtioOverrunPt * ratio;
overrunPt[colTqRatio] = torqueRatioOverrunPt / speedRAtioOverrunPt / ratio;
overrunPt[colRefTq] = refTorqueStallPt * refTorqueOverrunPtFactor;
overrunPt[colSpeedRatio] = Math.Round(speedRAtioOverrunPt * ratio, 4, MidpointRounding.AwayFromZero);
overrunPt[colTqRatio] = Math.Round(torqueRatioOverrunPt / speedRAtioOverrunPt / ratio, 2, MidpointRounding.AwayFromZero);
overrunPt[colRefTq] = Math.Round(refTorqueStallPt * refTorqueOverrunPtFactor, 2, MidpointRounding.AwayFromZero);
retVal.Rows.Add(overrunPt);
return retVal;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment