Skip to content

Commit

Permalink
Reduce wheel inertia calculations
Browse files Browse the repository at this point in the history
  • Loading branch information
cesarBLG committed Apr 3, 2022
1 parent 541f82c commit da23e7b
Showing 1 changed file with 5 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -2578,18 +2578,14 @@ public void AdvancedAdhesion(float elapsedClockSeconds)
//Compute axle inertia from parameters if possible
if (AxleInertiaKgm2 <= 0) // if no axleinertia value supplied in ENG file, calculate axleinertia value.
{
if (WheelAxles.Count > 0 && DriverWheelRadiusM > 0)
if (LocoNumDrvAxles > 0 && DriverWheelRadiusM > 0)
{
float upperLimit = 2.0f * WheelAxles.Count * (15000.0f * DriverWheelRadiusM - 2900.0f);
upperLimit = upperLimit < 100.0f ? 100.0f : upperLimit;

float lowerLimit = WheelAxles.Count * (9000.0f * DriverWheelRadiusM - 1750.0f);
lowerLimit = lowerLimit < 100.0f ? 100.0f : lowerLimit;

AxleInertiaKgm2 = (upperLimit - lowerLimit) / (5000000.0f) * MaxPowerW + lowerLimit;
float radiusSquared = DriverWheelRadiusM * DriverWheelRadiusM;
float wheelMass = 500 * radiusSquared / (0.5f * 0.5f);
AxleInertiaKgm2 = LocoNumDrvAxles * wheelMass * radiusSquared + 500;
}
else
AxleInertiaKgm2 = 32000.0f;
AxleInertiaKgm2 = 2000.0f;
}
//Limit the inertia to 40000 kgm2
LocomotiveAxle.InertiaKgm2 = Math.Min(AxleInertiaKgm2, 40000);
Expand Down

0 comments on commit da23e7b

Please sign in to comment.