diff --git a/VectoCore/VectoCore/Models/SimulationComponent/Impl/Gearbox.cs b/VectoCore/VectoCore/Models/SimulationComponent/Impl/Gearbox.cs index 4b0121463b6377c7933718887bd2518b6a1f5e6d..9f46216ef167ea2d65bb41b8b9be24f94c940f9b 100644 --- a/VectoCore/VectoCore/Models/SimulationComponent/Impl/Gearbox.cs +++ b/VectoCore/VectoCore/Models/SimulationComponent/Impl/Gearbox.cs @@ -378,8 +378,9 @@ namespace TUGraz.VectoCore.Models.SimulationComponent.Impl : 0.SI<NewtonMeter>(); inTorque += CurrentState.InertiaTorqueLossOut / ModelData.Gears[Gear].Ratio; - var inertiaTorqueLossIn = - Formulas.InertiaPower(outAngularVelocity, PreviousState.OutAngularVelocity, ModelData.Inertia, dt) / + 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); dryRunResponse.GearboxPowerRequest = outTorque * (PreviousState.OutAngularVelocity + outAngularVelocity) / 2.0;