From 7405aba19570bf4d0340e07103ddfd937a1f1371 Mon Sep 17 00:00:00 2001
From: Markus Quaritsch <markus.quaritsch@tugraz.at>
Date: Fri, 22 Feb 2019 13:52:48 +0100
Subject: [PATCH] optimize max. cardan torque preprocessor: reduce search
 target, reduce number of iterations

---
 .../SimulationComponent/Impl/MaxCardanTorquePreprocessor.cs  | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/VectoCore/VectoCore/Models/SimulationComponent/Impl/MaxCardanTorquePreprocessor.cs b/VectoCore/VectoCore/Models/SimulationComponent/Impl/MaxCardanTorquePreprocessor.cs
index a11671e6f3..bc9d2d0461 100644
--- a/VectoCore/VectoCore/Models/SimulationComponent/Impl/MaxCardanTorquePreprocessor.cs
+++ b/VectoCore/VectoCore/Models/SimulationComponent/Impl/MaxCardanTorquePreprocessor.cs
@@ -29,7 +29,7 @@ namespace TUGraz.VectoCore.Models.SimulationComponent.Impl {
 			var init = TestContainer.VehiclePort.Initialize(Data.GearshiftParameters.StartVelocity, 0.SI<Radian>());
 			var powertrainRatioWOGearbox = (Data.GearshiftParameters.StartVelocity / init.EngineSpeed * Data.GearboxData.Gears[1].Ratio).Cast<Meter>();
 
-			var engineSpeedSteps = (Data.EngineData.FullLoadCurves[0].N95hSpeed - Data.EngineData.IdleSpeed) / 250;
+			var engineSpeedSteps = (Data.EngineData.FullLoadCurves[0].N95hSpeed - Data.EngineData.IdleSpeed) / 100;
 
 			foreach (var gearData in Data.GearboxData.Gears) {
 				retVal[gearData.Key] = new List<KeyValuePair<PerSecond, NewtonMeter>>();
@@ -37,6 +37,7 @@ namespace TUGraz.VectoCore.Models.SimulationComponent.Impl {
 				for (var engineSpeed = Data.EngineData.IdleSpeed;
 					engineSpeed < Data.EngineData.FullLoadCurves[0].N95hSpeed;
 					engineSpeed += engineSpeedSteps) {
+
 					var maxTorque = Data.EngineData.FullLoadCurves[gearData.Key].FullLoadStationaryTorque(engineSpeed);
 					var vehicleSpeed = engineSpeed * powertrainRatioWOGearbox / gearData.Value.Ratio;
 
@@ -55,7 +56,7 @@ namespace TUGraz.VectoCore.Models.SimulationComponent.Impl {
 								return TestContainer.VehiclePort.Initialize(vehicleSpeed, g);
 							},
 							criterion: r => {
-								return ((r as AbstractResponse).EngineTorqueDemandTotal - maxTorque).Value();
+								return ((r as AbstractResponse).EngineTorqueDemandTotal - maxTorque).Value() / 1e5;
 							}
 						);
 						max = TestContainer.VehiclePort.Initialize(vehicleSpeed, grad);
-- 
GitLab