diff --git a/VectoCore/VectoCore/Models/SimulationComponent/Impl/Gearbox.cs b/VectoCore/VectoCore/Models/SimulationComponent/Impl/Gearbox.cs index 86c5c945cb8242a1236396b93a8b5e373081235e..ddee69f230ceab4e21e7b991f53853f1b512ab5b 100644 --- a/VectoCore/VectoCore/Models/SimulationComponent/Impl/Gearbox.cs +++ b/VectoCore/VectoCore/Models/SimulationComponent/Impl/Gearbox.cs @@ -29,7 +29,9 @@ * Martin Rexeis, rexeis@ivt.tugraz.at, IVT, Graz University of Technology */ +using System.Linq; using TUGraz.VectoCommon.Exceptions; +using TUGraz.VectoCommon.InputData; using TUGraz.VectoCommon.Models; using TUGraz.VectoCommon.Utils; using TUGraz.VectoCore.Configuration; @@ -139,9 +141,15 @@ namespace TUGraz.VectoCore.Models.SimulationComponent.Impl Gear = gear; var inAngularVelocity = outAngularVelocity * ModelData.Gears[gear.Gear].Ratio; var torqueLossResult = ModelData.Gears[gear.Gear].LossMap.GetTorqueLoss(outAngularVelocity, outTorque); + CurrentState.TorqueLossResult = torqueLossResult; var inTorque = outTorque / ModelData.Gears[gear.Gear].Ratio + torqueLossResult.Value; + if (DataBus.PowertrainInfo.ElectricMotorPositions.Any(x => x.IsOneOf(PowertrainPosition.HybridP2, PowertrainPosition.HybridP2_5))) { + // if there is an electric motor after the transmission, initialize the EM first + NextComponent.Initialize(inTorque, inAngularVelocity); + } + if (!inAngularVelocity.IsEqual(0)) { var alpha = ModelData.Inertia.IsEqual(0) ? 0.SI<PerSquareSecond>()