From 435a6f87050e50902769e7209478af3bc611e159 Mon Sep 17 00:00:00 2001
From: Markus Quaritsch <markus.quaritsch@tugraz.at>
Date: Tue, 12 Sep 2017 16:02:00 +0200
Subject: [PATCH] remove double accounting of gearbox inertia loss during
 dry-run search

---
 .../VectoCore/Models/SimulationComponent/Impl/Gearbox.cs  | 8 ++------
 1 file changed, 2 insertions(+), 6 deletions(-)

diff --git a/VectoCore/VectoCore/Models/SimulationComponent/Impl/Gearbox.cs b/VectoCore/VectoCore/Models/SimulationComponent/Impl/Gearbox.cs
index 6682c9725a..976eeaf6ab 100644
--- a/VectoCore/VectoCore/Models/SimulationComponent/Impl/Gearbox.cs
+++ b/VectoCore/VectoCore/Models/SimulationComponent/Impl/Gearbox.cs
@@ -319,11 +319,7 @@ namespace TUGraz.VectoCore.Models.SimulationComponent.Impl
 			inTorque += inertiaTorqueLossOut / ModelData.Gears[Gear].Ratio;
 
 			if (dryRun) {
-				var inertiaTorqueLossIn = avgOutAngularVelocity.IsEqual(0, 1e-9)
-					? 0.SI<NewtonMeter>()
-					: Formulas.InertiaPower(outAngularVelocity, PreviousState.OutAngularVelocity, ModelData.Inertia, dt) /
-					avgOutAngularVelocity / ModelData.Gears[Gear].Ratio;
-				var dryRunResponse = NextComponent.Request(absTime, dt, inTorque + inertiaTorqueLossIn, inAngularVelocity, true);
+				var dryRunResponse = NextComponent.Request(absTime, dt, inTorque, inAngularVelocity, true);
 				dryRunResponse.GearboxPowerRequest = outTorque * (PreviousState.OutAngularVelocity + outAngularVelocity) / 2.0;
 				return dryRunResponse;
 			}
@@ -431,4 +427,4 @@ namespace TUGraz.VectoCore.Models.SimulationComponent.Impl
 			base.DoCommitSimulationStep();
 		}
 	}
-}
\ No newline at end of file
+}
-- 
GitLab