Skip to content

Commit 1fb1ba8

Browse files
committed
Fix steam locomotive adhesion bug
1 parent 2f57132 commit 1fb1ba8

File tree

1 file changed

+3
-14
lines changed

1 file changed

+3
-14
lines changed

Source/Orts.Simulation/Simulation/RollingStocks/MSTSSteamLocomotive.cs

Lines changed: 3 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -5196,20 +5196,9 @@ protected override void UpdateTractiveForce(float elapsedClockSeconds, float t,
51965196
float reciprocatingInertiaAngleFactor = 0;
51975197
float connectRodInertiaAngleFactor = 0;
51985198

5199-
// Calculate the "angle variation factors" for the Inertia
5200-
// Account for the position of the crosshead position. In other words it depends upon whether the Rods and Reciporating gear is above or below the axle.
5201-
if (crankAngleRad > 0 && crankAngleRad < Math.PI)
5202-
{
5203-
// forward stroke
5204-
reciprocatingInertiaAngleFactor = (cos + ((CrankRadiusFt / ConnectRodLengthFt) * (float)Math.Cos(2 * crankAngleRad)));
5205-
connectRodInertiaAngleFactor = (cos + ((CrankRadiusFt * RodCoGFt) / (ConnectRodLengthFt * ConnectRodLengthFt)) * (float)Math.Cos(2 * crankAngleRad));
5206-
}
5207-
else
5208-
{
5209-
// reverse stroke
5210-
reciprocatingInertiaAngleFactor = (cos - ((CrankRadiusFt / ConnectRodLengthFt) * (float)Math.Cos(2 * crankAngleRad)));
5211-
connectRodInertiaAngleFactor = (cos - ((CrankRadiusFt * RodCoGFt) / (ConnectRodLengthFt * ConnectRodLengthFt)) * (float)Math.Cos(2 * crankAngleRad));
5212-
}
5199+
// Calculate the "angle variation factors" for the Inertia
5200+
reciprocatingInertiaAngleFactor = (cos + ((CrankRadiusFt / ConnectRodLengthFt) * (float)Math.Cos(2 * crankAngleRad)));
5201+
connectRodInertiaAngleFactor = (cos + ((CrankRadiusFt * RodCoGFt) / (ConnectRodLengthFt * ConnectRodLengthFt)) * (float)Math.Cos(2 * crankAngleRad));
52135202

52145203
// Calculate the speed factor to allow for variation in speed
52155204
// Adjust the above factor to allow for the speed of rotation on the parts - based upon Eq 8 (pg 21)

0 commit comments

Comments
 (0)