From d31c8aaf56f869df1ef38aa0d97921421b4e9b41 Mon Sep 17 00:00:00 2001 From: Markus Quaritsch <markus.quaritsch@tugraz.at> Date: Thu, 14 Feb 2019 08:49:21 +0100 Subject: [PATCH] removed testcases for VTP cycle validation (no longer used) --- .../Models/Declaration/DeclarationData.cs | 2 - .../SimulationComponent/Impl/VTPCycle.cs | 16 +-- .../VTPCycleValidationTest.cs | 118 ------------------ 3 files changed, 1 insertion(+), 135 deletions(-) diff --git a/VectoCore/VectoCore/Models/Declaration/DeclarationData.cs b/VectoCore/VectoCore/Models/Declaration/DeclarationData.cs index f712f454e0..110f19c87b 100644 --- a/VectoCore/VectoCore/Models/Declaration/DeclarationData.cs +++ b/VectoCore/VectoCore/Models/Declaration/DeclarationData.cs @@ -521,8 +521,6 @@ namespace TUGraz.VectoCore.Models.Declaration public static readonly PerSecond WheelSpeedZeroTolerance = 0.1.RPMtoRad(); public static readonly PerSecond MaxWheelSpeedDifferenceStandstill = 1.RPMtoRad(); - public static readonly NewtonMeter MaxWheelTorqueDifference = 1000.SI<NewtonMeter>(); - public static readonly PerSecond MinFanSpeed = 20.RPMtoRad(); public static readonly PerSecond MaxFanSpeed = 4000.RPMtoRad(); diff --git a/VectoCore/VectoCore/Models/SimulationComponent/Impl/VTPCycle.cs b/VectoCore/VectoCore/Models/SimulationComponent/Impl/VTPCycle.cs index 7db487b01a..dc72734e8a 100644 --- a/VectoCore/VectoCore/Models/SimulationComponent/Impl/VTPCycle.cs +++ b/VectoCore/VectoCore/Models/SimulationComponent/Impl/VTPCycle.cs @@ -91,8 +91,6 @@ namespace TUGraz.VectoCore.Models.SimulationComponent.Impl foreach (var entry in Data.Entries) { VerifyWheelSpeeds(entry); - //VerifyWheelTorque(entry); // no thresholds defined in legislation - VerifyFanSpeed(hasElectricFan, entry); } @@ -149,19 +147,7 @@ namespace TUGraz.VectoCore.Models.SimulationComponent.Impl } } - private void VerifyWheelTorque(DrivingCycleData.DrivingCycleEntry entry) - { - var torqueRatio = entry.TorqueWheelRight.IsEqual(0, 1e-9) && entry.TorqueWheelLeft.IsEqual(0, 1e-9) ? 0 : - Math.Max(entry.TorqueWheelLeft / entry.TorqueWheelRight, entry.TorqueWheelRight / entry.TorqueWheelLeft); - var torqueDiff = VectoMath.Abs(entry.TorqueWheelLeft - entry.TorqueWheelRight); - if (torqueRatio > DeclarationData.VTPMode.WheelTorqueDifferenceFactor && - torqueDiff > DeclarationData.VTPMode.MaxWheelTorqueDifference) { - Log.Error( - "Torque difference (L/R) too high! t: {0} tq_left: {1}, tq_right: {2}", entry.Time, entry.TorqueWheelLeft, - entry.TorqueWheelRight); - } - } - + private void VerifyWheelSpeeds(DrivingCycleData.DrivingCycleEntry entry) { if (!entry.WheelSpeedLeft.IsEqual(0.RPMtoRad(), DeclarationData.VTPMode.WheelSpeedZeroTolerance) && diff --git a/VectoCore/VectoCoreTest/Models/SimulationComponent/VTPCycleValidationTest.cs b/VectoCore/VectoCoreTest/Models/SimulationComponent/VTPCycleValidationTest.cs index 973055cd74..aac7d72921 100644 --- a/VectoCore/VectoCoreTest/Models/SimulationComponent/VTPCycleValidationTest.cs +++ b/VectoCore/VectoCoreTest/Models/SimulationComponent/VTPCycleValidationTest.cs @@ -175,124 +175,6 @@ namespace TUGraz.VectoCore.Tests.Models.SimulationComponent } - - [TestCase()] - public void TestWheelTorqueRatioExceeds_Left() - { - SetupLogging(); - - var torque = 300; - - var cycleEntries = string.Format( - @" 0 , 0, 600, 400, {0}, {0} , 50 , 50 , 100, 3 - 0.5 , 0, 600, 400, {0}, {0} , 50 , 50 , 100, 3 - 1 , 0, 600, 400, {0}, {1} , 50 , 50 , 100, 3 - 1.5 , 0, 600, 400, {1}, {1} , 50 , 50 , 100, 3 - ", torque, torque * DeclarationData.VTPMode.WheelTorqueDifferenceFactor * 1.1); - - var container = new VehicleContainer(ExecutionMode.Declaration) { - RunData = new VectoRunData() { - Aux = new List<VectoRunData.AuxData>() - } - }; - var cycle = InputDataHelper.InputDataAsStream(Header, cycleEntries.Split('\n')); - var cycleData = DrivingCycleDataReader.ReadFromDataTable(VectoCSVFile.ReadStream(cycle), "VTP Cycle", false); - var vtpCycle = new VTPCycle(container, cycleData); - - vtpCycle.VerifyInputData(); - - Assert.AreEqual(1, LogList.Count); - Assert.IsTrue(LogList[0].Contains("Torque difference")); - } - - - [TestCase()] - public void TestWheelTorqueRatioExceeds_Right() - { - SetupLogging(); - - var torque = 300; - - var cycleEntries = string.Format( - @" 0 , 0, 600, 400, {0}, {0} , 50 , 50 , 100, 3 - 0.5 , 0, 600, 400, {0}, {0} , 50 , 50 , 100, 3 - 1 , 0, 600, 400, {1}, {0} , 50 , 50 , 100, 3 - 1.5 , 0, 600, 400, {1}, {1} , 50 , 50 , 100, 3 - ", torque, torque * DeclarationData.VTPMode.WheelTorqueDifferenceFactor * 1.1); - - var container = new VehicleContainer(ExecutionMode.Declaration) { - RunData = new VectoRunData() { - Aux = new List<VectoRunData.AuxData>() - } - }; - var cycle = InputDataHelper.InputDataAsStream(Header, cycleEntries.Split('\n')); - var cycleData = DrivingCycleDataReader.ReadFromDataTable(VectoCSVFile.ReadStream(cycle), "VTP Cycle", false); - var vtpCycle = new VTPCycle(container, cycleData); - - vtpCycle.VerifyInputData(); - - Assert.AreEqual(1, LogList.Count); - Assert.IsTrue(LogList[0].Contains("Torque difference")); - } - - [TestCase()] - public void TestWheelTorqueDiffExceeds_Left() - { - SetupLogging(); - - var torque = 30; //0.95*DeclarationData.VTPMode.WheelTorqueZeroTolerance.Value(); - - var cycleEntries = string.Format( - @" 0 , 0, 600, 400, {0}, {0} , 50 , 50 , 100, 3 - 0.5 , 0, 600, 400, {0}, {0} , 50 , 50 , 100, 3 - 1 , 0, 600, 400, {0}, {1} , 50 , 50 , 100, 3 - 1.5 , 0, 600, 400, {1}, {1} , 50 , 50 , 100, 3 - ", torque, torque + DeclarationData.VTPMode.MaxWheelTorqueDifference.Value() * 1.1); - - var container = new VehicleContainer(ExecutionMode.Declaration) { - RunData = new VectoRunData() { - Aux = new List<VectoRunData.AuxData>() - } - }; - var cycle = InputDataHelper.InputDataAsStream(Header, cycleEntries.Split('\n')); - var cycleData = DrivingCycleDataReader.ReadFromDataTable(VectoCSVFile.ReadStream(cycle), "VTP Cycle", false); - var vtpCycle = new VTPCycle(container, cycleData); - - vtpCycle.VerifyInputData(); - - Assert.AreEqual(1, LogList.Count); - Assert.IsTrue(LogList[0].Contains("Torque difference ")); - } - - [TestCase()] - public void TestWheelTorqueDiffExceeds_Right() - { - SetupLogging(); - - var torque = 30; //0.95 * DeclarationData.VTPMode.WheelTorqueZeroTolerance.Value(); - - var cycleEntries = string.Format( - @" 0 , 0, 600, 400, {0}, {0} , 50 , 50 , 100, 3 - 0.5 , 0, 600, 400, {0}, {0} , 50 , 50 , 100, 3 - 1 , 0, 600, 400, {1}, {0} , 50 , 50 , 100, 3 - 1.5 , 0, 600, 400, {1}, {1} , 50 , 50 , 100, 3 - ", torque, torque + DeclarationData.VTPMode.MaxWheelTorqueDifference.Value() * 1.1); - - var container = new VehicleContainer(ExecutionMode.Declaration) { - RunData = new VectoRunData() { - Aux = new List<VectoRunData.AuxData>() - } - }; - var cycle = InputDataHelper.InputDataAsStream(Header, cycleEntries.Split('\n')); - var cycleData = DrivingCycleDataReader.ReadFromDataTable(VectoCSVFile.ReadStream(cycle), "VTP Cycle", false); - var vtpCycle = new VTPCycle(container, cycleData); - - vtpCycle.VerifyInputData(); - - Assert.AreEqual(1, LogList.Count); - Assert.IsTrue(LogList[0].Contains("Torque difference")); - } - [TestCase()] public void TestFanSpeedTooLow() { -- GitLab