Code development platform for open source projects from the European Union institutions :large_blue_circle: EU Login authentication by SMS will be completely phased out by mid-2025. To see alternatives please check here

Skip to content
Snippets Groups Projects
Commit 562a302c authored by Markus Quaritsch's avatar Markus Quaritsch
Browse files

gearbox: fix: inertia loss is 0 if angularvelocity is 0

parent 102b3612
No related branches found
No related tags found
No related merge requests found
......@@ -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;
......
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