From 605846aea9b10ae7582e23efd99fe6498f96188c Mon Sep 17 00:00:00 2001
From: Michael Krisper <michael.krisper@tugraz.at>
Date: Wed, 9 Nov 2016 14:40:39 +0100
Subject: [PATCH] EngineAuxiliary: Fixed Bug at Start of Run (MeasuredSpeed)
 when v=0 and gear=0

---
 .../Models/SimulationComponent/Impl/EngineAuxiliary.cs         | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/VectoCore/VectoCore/Models/SimulationComponent/Impl/EngineAuxiliary.cs b/VectoCore/VectoCore/Models/SimulationComponent/Impl/EngineAuxiliary.cs
index 28237ca525..fe71ed5842 100644
--- a/VectoCore/VectoCore/Models/SimulationComponent/Impl/EngineAuxiliary.cs
+++ b/VectoCore/VectoCore/Models/SimulationComponent/Impl/EngineAuxiliary.cs
@@ -91,6 +91,9 @@ namespace TUGraz.VectoCore.Models.SimulationComponent.Impl
 		public NewtonMeter Initialize(NewtonMeter torque, PerSecond angularSpeed)
 		{
 			PreviousState.AngularSpeed = angularSpeed;
+			if (angularSpeed.IsEqual(0))
+				return 0.SI<NewtonMeter>();
+
 			return ComputePowerDemand(angularSpeed) / angularSpeed;
 		}
 
-- 
GitLab