diff --git a/VectoCoreTest/Models/SimulationComponentData/FullLoadCurveTest.cs b/VectoCoreTest/Models/SimulationComponentData/FullLoadCurveTest.cs index 8a57981ddd50348ee45f4ede4f56fe32064f5afb..a7af940fb06cdda86472d3ed5ea99e9fe297466f 100644 --- a/VectoCoreTest/Models/SimulationComponentData/FullLoadCurveTest.cs +++ b/VectoCoreTest/Models/SimulationComponentData/FullLoadCurveTest.cs @@ -176,5 +176,33 @@ namespace TUGraz.VectoCore.Tests.Models.SimulationComponentData var runData = new VectoRunData { GearboxData = gearboxData, EngineData = engineData, AxleGearData = axleGearData }; Assert.IsFalse(runData.IsValid()); } + + /// <summary> + /// [VECTO-190] + /// </summary> + [TestMethod] + public void TestSortingFullLoadEntries() + { + var fldEntries = new[] { + "600,1282,-148,0.6 ", + "799.9999999,1791,-149,0.6 ", + "560,1180,-149,0.6 ", + "1000,2300,-160,0.6 ", + "1599.999999,2079,-235,0.49 ", + "1200,2300,-179,0.6 ", + "1800,1857,-264,0.25 ", + "1400,2300,-203,0.6 ", + "2000.000001,1352,-301,0.25 ", + "2100,1100,-320,0.25 ", + }; + + var fldCurve = + EngineFullLoadCurve.Create( + VectoCSVFile.ReadStream(InputDataHelper.InputDataAsStream("n [U/min],Mfull [Nm],Mdrag [Nm],<PT1> [s]", fldEntries))); + + Assert.AreEqual(1180, fldCurve.FullLoadStationaryTorque(560.RPMtoRad()).Value(), Tolerance); + Assert.AreEqual(1352, fldCurve.FullLoadStationaryTorque(2000.RPMtoRad()).Value(), Tolerance); + Assert.AreEqual(1231, fldCurve.FullLoadStationaryTorque(580.RPMtoRad()).Value(), Tolerance); + } } } \ No newline at end of file diff --git a/VectoCoreTest/Models/SimulationComponentData/GearboxDataTest.cs b/VectoCoreTest/Models/SimulationComponentData/GearboxDataTest.cs index 736a0a47919bdcc83d4592fe029b511d28ce43c8..9fc32ba7d813b1fe6a72000e2a1c9cf2d225c7e7 100644 --- a/VectoCoreTest/Models/SimulationComponentData/GearboxDataTest.cs +++ b/VectoCoreTest/Models/SimulationComponentData/GearboxDataTest.cs @@ -316,6 +316,25 @@ namespace TUGraz.VectoCore.Tests.Models.SimulationComponentData Assert.AreEqual(1100.0, fullLoadCurve.FullLoadStationaryTorque(2100.RPMtoRad()).Value()); } + /// <summary> + /// VECTO-190 + /// </summary> + [TestMethod] + public void TestFullLoadSorting() + { + var gbxFLDString = new[] { + "600, 1000", + "2400, 2000", + "1000, 500" + }; + + var dataGbx = VectoCSVFile.ReadStream(InputDataHelper.InputDataAsStream("n [U/min],Mfull [Nm]", gbxFLDString)); + var gbxFLD = FullLoadCurve.Create(dataGbx, true); + + var maxTorque = gbxFLD.FullLoadStationaryTorque(800.RPMtoRad()); + Assert.AreEqual(750, maxTorque.Value()); + } + protected PerSecond SpeedToAngularSpeed(double v, double r) { return ((60 * v) / (2 * r * Math.PI / 1000)).RPMtoRad();