You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
@@ -191,6 +191,11 @@ public static Interpolator SteamHeatBoilerFuelUsageGalukpH()
191
191
publicboolHasPassengerCapacity=false;
192
192
publicboolHasInsideView=false;
193
193
publicfloatCarHeightAboveSeaLevelM;
194
+
publicfloatWagonNumBogies;
195
+
publicfloatCarBogieCentreLengthM;
196
+
publicfloatCarBodyLengthM;
197
+
publicfloatCarCouplerFaceLengthM;
198
+
publicfloatDerailmentCoefficient;
194
199
195
200
publicfloatMaxHandbrakeForceN;
196
201
publicfloatMaxBrakeForceN=89e3f;
@@ -514,7 +519,7 @@ public Direction Direction
514
519
publicfloatDynamicBrakeForceN=0f;// Raw dynamic brake force for diesel and electric locomotives
515
520
516
521
// Derailment variables
517
-
publicfloatWagonVerticalDerailForceN;// Vertical force of wagon/car - essentially determined by the weight
522
+
publicfloatTotalWagonVerticalDerailForceN;// Vertical force of wagon/car - essentially determined by the weight
518
523
publicfloatTotalWagonLateralDerailForceN;
519
524
publicfloatLateralWindForceN;
520
525
publicfloatWagonFrontCouplerAngleRad;
@@ -523,7 +528,7 @@ public Direction Direction
523
528
publicfloatAdjustedWagonRearCouplerAngleRad;
524
529
publicfloatWagonFrontCouplerCurveExtM;
525
530
publicfloatWagonRearCouplerCurveExtM;
526
-
// public float WagonVerticalForceN; // Vertical force of wagon/car - essentially determined by the weight
531
+
publicfloatWagonCouplerAngleDerailRad;
527
532
528
533
529
534
publicboolBuffForceExceeded;
@@ -585,6 +590,7 @@ public Direction Direction
585
590
protectedfloatSuperelevationM;// Super elevation on the curve
586
591
protectedfloatUnbalancedSuperElevationM;// Unbalanced superelevation, read from MSTS Wagon File
587
592
protectedfloatSuperElevationTotalM;// Total superelevation
593
+
publicfloatSuperElevationAngleRad;
588
594
protectedboolIsMaxSafeCurveSpeed=false;// Has equal loading speed around the curve been exceeded, ie are all the wheesl still on the track?
589
595
publicboolIsCriticalMaxSpeed=false;// Has the critical maximum speed around the curve been reached, is the wagon about to overturn?
590
596
publicboolIsCriticalMinSpeed=false;// Is the speed less then the minimum required for the wagon to travel around the curve
@@ -1093,30 +1099,25 @@ public virtual void UpdateTunnelForce()
1093
1099
1094
1100
publicvoidUpdateTrainDerailmentRisk()
1095
1101
{
1096
-
// Train will derail if lateral forces on the train exceed the vertical forces holding the train on the railway track.
1097
-
// Typically the train is most at risk when travelling around a curve
1098
-
1099
-
// Based upon ??????
1100
-
1101
-
// Calculate Lateral forces
1102
-
1103
-
foreach(varwinWheelAxles)
1102
+
// Calculate coupler angle when travelling around curve
1103
+
// To achieve an accurate coupler angle calculation the following length need to be calculated. These values can be included in the ENG/WAG file for greatest accuracy, or alternatively OR will
1104
+
// calculate some default values based upon the length of the car specified in the "Size" statement. This value may however be inaccurate, and sets the "visual" distance for placement of the
1105
+
// animated coupler. So often it is a good idea to add the values in the WAG file.
1106
+
1107
+
varOverhangThisCarM=0.5f*(CarBodyLengthM-CarBogieCentreLengthM);// Vehicle overhang - B
1108
+
varBogieDistanceThisCarM=0.5f*CarBogieCentreLengthM;// 0.5 * distance between bogie centres - A
@@ -1345,9 +1401,6 @@ public string GetCurveDirection()
1345
1401
}
1346
1402
1347
1403
1348
-
1349
-
1350
-
1351
1404
#region Calculate permissible speeds around curves
1352
1405
/// <summary>
1353
1406
/// Reads current curve radius and computes the maximum recommended speed around the curve based upon the
@@ -1441,7 +1494,7 @@ public virtual void UpdateCurveSpeedLimit()
1441
1494
1442
1495
SuperelevationM=MathHelper.Clamp(SuperelevationM,0.0001f,0.150f);// If superelevation is greater then 6" (150mm) then limit to this value, having a value of zero causes problems with calculations
1443
1496
1444
-
floatSuperElevationAngleRad=(float)Math.Sinh(SuperelevationM);// Total superelevation includes both balanced and unbalanced superelevation
1497
+
SuperElevationAngleRad=(float)Math.Sinh(SuperelevationM);// Total superelevation includes both balanced and unbalanced superelevation
1445
1498
1446
1499
MaxCurveEqualLoadSpeedMps=(float)Math.Sqrt((SuperelevationM*GravitationalAccelerationMpS2*CurrentCurveRadius)/TrackGaugeM);// Used for calculating curve resistance
1447
1500
@@ -2168,6 +2221,8 @@ public void AddBogie(float offset, int matrix, int id, string bogie, int numBogi
2168
2221
Parts[id].bogie=true;//identify this is a bogie, will be used for hold rails on track
0 commit comments