@@ -1976,7 +1976,7 @@ public override void Initialize()
19761976
19771977 for (int i = 0; i < SteamEngines.Count; i++)
19781978 {
1979- if (SteamEngines[i].MaxIndicatedHorsePowerHP == 0 && SteamEngines.Count == 0 && MaxIndicatedHorsePowerHP != 0)
1979+ if (SteamEngines[i].MaxIndicatedHorsePowerHP == 0 && SteamEngines.Count == 1 && MaxIndicatedHorsePowerHP != 0)
19801980 // if MaxIHP is not set in ENG file, then set a default
19811981 {
19821982 SteamEngines[i].MaxIndicatedHorsePowerHP = MaxIndicatedHorsePowerHP;
@@ -1985,16 +1985,14 @@ public override void Initialize()
19851985 {
19861986 // Max IHP = (Max TE x Speed) / 375.0, use a factor of 0.85 to calculate max TE
19871987 SteamEngines[i].MaxIndicatedHorsePowerHP = MaxSpeedFactor * (SteamEngines[i].MaxTractiveEffortLbf * MaxLocoSpeedMpH) / 375.0f; // To be checked what MaxTractive Effort is for the purposes of this formula.
1988+ MaxIndicatedHorsePowerHP += SteamEngines[i].MaxIndicatedHorsePowerHP;
19881989 }
1989-
1990- MaxIndicatedHorsePowerHP += SteamEngines[i].MaxIndicatedHorsePowerHP;
19911990 }
19921991
1993-
19941992 // Check to see if MaxIHP is in fact limited by the boiler
19951993 if (MaxIndicatedHorsePowerHP > MaxBoilerOutputHP)
19961994 {
1997- MaxIndicatedHorsePowerHP = MaxBoilerOutputHP; // Set maxIHp to limit set by boiler
1995+ // MaxIndicatedHorsePowerHP = MaxBoilerOutputHP; // Set maxIHp to limit set by boiler - No need to limit IHP, naturally limited by steam production?????
19981996 ISBoilerLimited = true;
19991997 }
20001998 else
@@ -6098,6 +6096,14 @@ protected override void UpdateTractiveForce(float elapsedClockSeconds, float loc
60986096 MotiveForceN += SteamEngines[i].TractiveForceN;
60996097 }
61006098
6099+ // Temporary code to compare TE and IHP
6100+
6101+ SteamEngines[i].CompareTractiveForceN = N.FromLbf((SteamEngines[i].NumberCylinders / 2.0f) * (Me.ToIn(SteamEngines[i].CylindersDiameterM) * Me.ToIn(SteamEngines[i].CylindersDiameterM) * Me.ToIn(SteamEngines[i].CylindersStrokeM) / (2.0f * Me.ToIn(SteamEngines[i].AttachedAxle.WheelRadiusM))) * (SteamEngines[i].MeanEffectivePressurePSI * CylinderEfficiencyRate) * MotiveForceGearRatio);
6102+
6103+ SteamEngines[i].CompareIndicatedHorsePower = (N.ToLbf(SteamEngines[i].TractiveForceN) * pS.TopH(Me.ToMi(absSpeedMpS))) / 375.0f;
6104+
6105+
6106+
61016107 // Set Max Power equal to max IHP
61026108 MaxPowerW += W.FromHp(SteamEngines[i].MaxIndicatedHorsePowerHP);
61036109
@@ -6293,9 +6299,9 @@ public override void AdvancedAdhesion(float elapsedClockSeconds)
62936299 float TotalWheelMomentofInertia = WheelMomentInertia + AxleMomentInertia; // Total MoI for generic wheelset
62946300 float TotalMomentInertia = TotalWheelMomentofInertia;
62956301 axle.InertiaKgm2 = TotalMomentInertia;
6296- axle.DampingNs = axle .AxleWeightN / 200;
6302+ axle.DampingNs = linkedEngine.AttachedAxle .AxleWeightN / 200;
62976303 // Calculate internal resistance - IR = 3.8 * diameter of cylinder^2 * stroke * dia of drivers (all in inches) - This should reduce wheel force
6298- axle.FrictionN = N.FromLbf(3.8f * Me.ToIn(linkedEngine.CylindersDiameterM) * Me.ToIn(linkedEngine.CylindersDiameterM) * Me.ToIn(linkedEngine.CylindersStrokeM) / (Me.ToIn(axle .WheelRadiusM * 2.0f)));
6304+ axle.FrictionN = N.FromLbf(3.8f * Me.ToIn(linkedEngine.CylindersDiameterM) * Me.ToIn(linkedEngine.CylindersDiameterM) * Me.ToIn(linkedEngine.CylindersStrokeM) / (Me.ToIn(linkedEngine.AttachedAxle .WheelRadiusM * 2.0f)));
62996305 }
63006306
63016307 else // normal locomotive
@@ -6312,10 +6318,10 @@ public override void AdvancedAdhesion(float elapsedClockSeconds)
63126318 float AxleMomentInertia = (linkedEngine.AttachedAxle.WheelWeightKg * AxleRadiusM * AxleRadiusM) / 2.0f;
63136319 float TotalWheelMomentofInertia = WheelMomentInertia + AxleMomentInertia; // Total MoI for generic wheelset
63146320
6315- SteamDrvWheelWeightLbs = Kg.ToLb(DrvWheelWeightKg / axle.NumberWheelAxles ); // Calculate the weight per axle (used in MSTSLocomotive for friction calculatons)
6321+ SteamDrvWheelWeightLbs = Kg.ToLb(linkedEngine.AttachedAxle.WheelWeightKg / linkedEngine.AttachedAxle.NumAxles ); // Calculate the weight per axle (used in MSTSLocomotive for friction calculatons)
63166322
63176323 // The moment of inertia needs to be increased by the number of wheel sets
6318- TotalWheelMomentofInertia *= axle.NumberWheelAxles ;
6324+ TotalWheelMomentofInertia *= linkedEngine.AttachedAxle.NumAxles ;
63196325
63206326 // the inertia of the coupling rods can also be added
63216327 // Assume rods weigh approx 1500 lbs
@@ -6331,7 +6337,7 @@ public override void AdvancedAdhesion(float elapsedClockSeconds)
63316337 axle.InertiaKgm2 = TotalMomentInertia;
63326338 axle.DampingNs = axle.AxleWeightN / 200;
63336339 // Calculate internal resistance - IR = 3.8 * diameter of cylinder^2 * stroke * dia of drivers (all in inches) - This should reduce wheel force
6334- axle.FrictionN = N.FromLbf(3.8f * Me.ToIn(linkedEngine.CylindersDiameterM) * Me.ToIn(linkedEngine.CylindersDiameterM) * Me.ToIn(linkedEngine.CylindersStrokeM) / (Me.ToIn(axle .WheelRadiusM * 2.0f)));
6340+ axle.FrictionN = N.FromLbf(3.8f * Me.ToIn(linkedEngine.CylindersDiameterM) * Me.ToIn(linkedEngine.CylindersDiameterM) * Me.ToIn(linkedEngine.CylindersStrokeM) / (Me.ToIn(linkedEngine.AttachedAxle .WheelRadiusM * 2.0f)));
63356341
63366342 }
63376343
@@ -7775,7 +7781,9 @@ public override string GetDebugStatus()
77757781 Simulator.Catalog.GetString("Drawbar"),
77767782 FormatStrings.FormatPower(W.FromHp(DrawbarHorsePowerHP), IsMetric, false, false),
77777783 Simulator.Catalog.GetString("BlrLmt"),
7778- ISBoilerLimited ? Simulator.Catalog.GetString("Yes") : Simulator.Catalog.GetString("No"));
7784+ ISBoilerLimited ? Simulator.Catalog.GetString("Yes") : Simulator.Catalog.GetString("No")
7785+
7786+ );
77797787
77807788 if (SteamEngines.Count > 1)
77817789 {
@@ -7788,10 +7796,27 @@ public override string GetDebugStatus()
77887796 Simulator.Catalog.GetString("TheorTE"),
77897797 FormatStrings.FormatForce(N.FromLbf(SteamEngines[i].MaxTractiveEffortLbf), IsMetric),
77907798 Simulator.Catalog.GetString("TE"),
7791- FormatStrings.FormatForce(SteamEngines[i].TractiveForceN, IsMetric));
7799+ FormatStrings.FormatForce(SteamEngines[i].TractiveForceN, IsMetric)
7800+
7801+ );
7802+
77927803 }
77937804 }
77947805
7806+ for (int i = 0; i < SteamEngines.Count; i++)
7807+ {
7808+ status.AppendFormat("{0}\t{1}\t{2}\t{3}\t{4}\t{5}\t{6}\n",
7809+ Simulator.Catalog.GetString("ForceCom:"),
7810+ Simulator.Catalog.GetString("Eng#:"),
7811+ i + 1,
7812+ Simulator.Catalog.GetString("CompTE"),
7813+ FormatStrings.FormatForce(SteamEngines[i].CompareTractiveForceN, IsMetric),
7814+ Simulator.Catalog.GetString("CompIHP"),
7815+ FormatStrings.FormatPower(W.FromHp(SteamEngines[i].CompareIndicatedHorsePower), IsMetric, false, false)
7816+ );
7817+ }
7818+
7819+
77957820 status.AppendFormat("{0}\t{1}\t{2}\t{3}\t{4}\t{5}\t{6}\t{7}\t{8}\t{9}\t{10}\t{11}\t{12}\n",
77967821 Simulator.Catalog.GetString("ForceTot:"),
77977822 Simulator.Catalog.GetString("TheorTE"),
@@ -7850,7 +7875,7 @@ public override string GetDebugStatus()
78507875 Simulator.Catalog.GetString("Slip"),
78517876 SteamEngines[i].AttachedAxle.IsWheelSlip ? Simulator.Catalog.GetString("Yes") : Simulator.Catalog.GetString("No"),
78527877 Simulator.Catalog.GetString("WheelM"),
7853- FormatStrings.FormatMass(SteamEngines[i].AttachedAxle.WheelWeightKg , IsMetric),
7878+ FormatStrings.FormatMass(Kg.FromLb(SteamDrvWheelWeightLbs) , IsMetric),
78547879 Simulator.Catalog.GetString("FoA"),
78557880 SteamEngines[i].CalculatedFactorOfAdhesion);
78567881 }
@@ -8127,7 +8152,7 @@ public void SteamStartGearBoxIncrease()
81278152 // Check to see if MaxIHP is in fact limited by the boiler
81288153 if (MaxIndicatedHorsePowerHP > MaxBoilerOutputHP)
81298154 {
8130- MaxIndicatedHorsePowerHP = MaxBoilerOutputHP; // Set maxIHp to limit set by boiler
8155+ // MaxIndicatedHorsePowerHP = MaxBoilerOutputHP; // Set maxIHp to limit set by boiler
81318156 ISBoilerLimited = true;
81328157 }
81338158 else
@@ -8168,7 +8193,7 @@ public void SteamStartGearBoxIncrease()
81688193 // Check to see if MaxIHP is in fact limited by the boiler
81698194 if (MaxIndicatedHorsePowerHP > MaxBoilerOutputHP)
81708195 {
8171- MaxIndicatedHorsePowerHP = MaxBoilerOutputHP; // Set maxIHp to limit set by boiler
8196+ // MaxIndicatedHorsePowerHP = MaxBoilerOutputHP; // Set maxIHp to limit set by boiler
81728197 ISBoilerLimited = true;
81738198 }
81748199 else
@@ -8231,7 +8256,7 @@ public void SteamStartGearBoxDecrease()
82318256 // Check to see if MaxIHP is in fact limited by the boiler
82328257 if (MaxIndicatedHorsePowerHP > MaxBoilerOutputHP)
82338258 {
8234- MaxIndicatedHorsePowerHP = MaxBoilerOutputHP; // Set maxIHp to limit set by boiler
8259+ // MaxIndicatedHorsePowerHP = MaxBoilerOutputHP; // Set maxIHp to limit set by boiler
82358260 ISBoilerLimited = true;
82368261 }
82378262 else
0 commit comments