Code development platform for open source projects from the European Union institutions

Skip to content
Snippets Groups Projects
Commit dcf2c363 authored by Markus QUARITSCH's avatar Markus QUARITSCH
Browse files

Gearbox: set torque loss to 0 if angular speed is 0. already done for...

Gearbox: set torque loss to 0 if angular speed is 0. already done for transmission component and gearbox when disengaged. added for engaged gear.
parent dd09cd94
No related branches found
No related tags found
No related merge requests found
......@@ -314,6 +314,9 @@ namespace TUGraz.VectoCore.Models.SimulationComponent.Impl
var avgInAngularVelocity = (PreviousState.InAngularVelocity + inAngularVelocity) / 2.0;
var avgOutAngularVelocity = (PreviousState.OutAngularVelocity + outAngularVelocity) / 2.0;
var inTorqueLossResult = ModelData.Gears[Gear].LossMap.GetTorqueLoss(avgOutAngularVelocity, outTorque);
if (avgOutAngularVelocity.IsEqual(0, 1e-9)) {
inTorqueLossResult.Value = 0.SI<NewtonMeter>();
}
var inTorque = !avgInAngularVelocity.IsEqual(0)
? outTorque * (avgOutAngularVelocity / avgInAngularVelocity)
: outTorque / ModelData.Gears[Gear].Ratio;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment