@@ -196,6 +196,7 @@ public static Interpolator SteamHeatBoilerFuelUsageGalukpH()
196
196
public float CarBodyLengthM ;
197
197
public float CarCouplerFaceLengthM ;
198
198
public float DerailmentCoefficient ;
199
+ public float CarAirHoseLengthM ;
199
200
200
201
public float MaxHandbrakeForceN ;
201
202
public float MaxBrakeForceN = 89e3f ;
@@ -1277,15 +1278,11 @@ public void UpdateTrainDerailmentRisk()
1277
1278
}
1278
1279
1279
1280
// Calculate airhose angles and height
1280
- var airhoselengthM = 1.0f ; // 2' = 600mm - Note if air hose length is less then coupler distance then NaN occurs
1281
- var rearairhoseheightadjustmentreferenceM = ( float ) Math . Sqrt ( ( float ) Math . Pow ( airhoselengthM , 2 ) - ( float ) Math . Pow ( CouplerDistanceThisCarM , 2 ) ) ;
1282
- var frontairhoseheightadjustmentreferenceM = ( float ) Math . Sqrt ( ( float ) Math . Pow ( airhoselengthM , 2 ) - ( float ) Math . Pow ( CouplerDistanceBehindCarM , 2 ) ) ;
1281
+ var rearairhoseheightadjustmentreferenceM = ( float ) Math . Sqrt ( ( float ) Math . Pow ( CarAirHoseLengthM , 2 ) - ( float ) Math . Pow ( CouplerDistanceThisCarM , 2 ) ) ;
1282
+ var frontairhoseheightadjustmentreferenceM = ( float ) Math . Sqrt ( ( float ) Math . Pow ( CarAirHoseLengthM , 2 ) - ( float ) Math . Pow ( CouplerDistanceBehindCarM , 2 ) ) ;
1283
1283
1284
- RearAirHoseHeightAdjustmentM = ( float ) Math . Sqrt ( ( float ) Math . Pow ( airhoselengthM , 2 ) - ( float ) Math . Pow ( ( CouplerDistanceThisCarM + CouplerSlackM / 2.0f ) , 2 ) ) ;
1285
- CarBehind . FrontAirHoseHeightAdjustmentM = ( float ) Math . Sqrt ( ( float ) Math . Pow ( airhoselengthM , 2 ) - ( float ) Math . Pow ( ( CouplerDistanceBehindCarM + CouplerSlackM / 2.0f ) , 2 ) ) ;
1286
- // Trace.TraceInformation("Rear AirHose Heights - CarID {0} R {1} length {2} CouplerDistance {3} Slack {4}", CarID, RearAirHoseHeightAdjustmentM, airhoselengthM, CouplerDistanceThisCarM, CouplerSlackM / 2.0f);
1287
-
1288
- // Trace.TraceInformation("Front AirHose Heights - CarID {0} F {1} length {2} CouplerDistance {3} Slack {4}", CarID, CarBehind.FrontAirHoseHeightAdjustmentM, airhoselengthM, CouplerDistanceBehindCarM, CouplerSlackM / 2.0f);
1284
+ RearAirHoseHeightAdjustmentM = ( float ) Math . Sqrt ( ( float ) Math . Pow ( CarAirHoseLengthM , 2 ) - ( float ) Math . Pow ( ( CouplerDistanceThisCarM + CouplerSlackM / 2.0f ) , 2 ) ) ;
1285
+ CarBehind . FrontAirHoseHeightAdjustmentM = ( float ) Math . Sqrt ( ( float ) Math . Pow ( CarAirHoseLengthM , 2 ) - ( float ) Math . Pow ( ( CouplerDistanceBehindCarM + CouplerSlackM / 2.0f ) , 2 ) ) ;
1289
1286
1290
1287
// refererence adjustment heights to rest position
1291
1288
if ( RearAirHoseHeightAdjustmentM >= rearairhoseheightadjustmentreferenceM )
@@ -1306,15 +1303,11 @@ public void UpdateTrainDerailmentRisk()
1306
1303
CarBehind . FrontAirHoseHeightAdjustmentM = frontairhoseheightadjustmentreferenceM - CarBehind . FrontAirHoseHeightAdjustmentM ;
1307
1304
}
1308
1305
1309
- var rearairhoseangleadjustmentreferenceRad = ( float ) Math . Cos ( CouplerDistanceThisCarM / airhoselengthM ) ;
1310
- var frontairhoseangleadjustmentreferenceRad = ( float ) Math . Cos ( CouplerDistanceBehindCarM / airhoselengthM ) ;
1311
-
1312
- RearAirHoseAngleAdjustmentRad = ( float ) Math . Cos ( ( CouplerDistanceThisCarM + CouplerSlackM / 2.0f ) / airhoselengthM ) ;
1313
- CarBehind . FrontAirHoseAngleAdjustmentRad = ( float ) Math . Cos ( ( CouplerDistanceBehindCarM + CouplerSlackM / 2.0f ) / airhoselengthM ) ;
1306
+ var rearairhoseangleadjustmentreferenceRad = ( float ) Math . Cos ( CouplerDistanceThisCarM / CarAirHoseLengthM ) ;
1307
+ var frontairhoseangleadjustmentreferenceRad = ( float ) Math . Cos ( CouplerDistanceBehindCarM / CarAirHoseLengthM ) ;
1314
1308
1315
- // Trace.TraceInformation("Angle Adjustment Rear - CarID {0} Adj {1} CouplerDist {2} Slack {3} Length {4} Ref {5}", CarID, RearAirHoseAngleAdjustmentRad, CouplerDistanceThisCarM, CouplerSlackM / 2.0f, airhoselengthM, rearairhoseangleadjustmentreferenceRad);
1316
-
1317
- // Trace.TraceInformation("Angle Adjustment Front - CarID {0} Adj {1} CouplerDist {2} Slack {3} Length {4} Ref {5}", CarID, CarBehind.FrontAirHoseAngleAdjustmentRad, CouplerDistanceBehindCarM, CouplerSlackM / 2.0f, airhoselengthM, frontairhoseangleadjustmentreferenceRad);
1309
+ RearAirHoseAngleAdjustmentRad = ( float ) Math . Cos ( ( CouplerDistanceThisCarM + CouplerSlackM / 2.0f ) / CarAirHoseLengthM ) ;
1310
+ CarBehind . FrontAirHoseAngleAdjustmentRad = ( float ) Math . Cos ( ( CouplerDistanceBehindCarM + CouplerSlackM / 2.0f ) / CarAirHoseLengthM ) ;
1318
1311
1319
1312
// refererence adjustment angles to rest position
1320
1313
if ( RearAirHoseAngleAdjustmentRad >= rearairhoseangleadjustmentreferenceRad )
@@ -1335,8 +1328,6 @@ public void UpdateTrainDerailmentRisk()
1335
1328
CarBehind . FrontAirHoseAngleAdjustmentRad = frontairhoseangleadjustmentreferenceRad - CarBehind . FrontAirHoseAngleAdjustmentRad ;
1336
1329
}
1337
1330
1338
- // Trace.TraceInformation("CarID {0} FrontAdj {1} RearAdj {2}", CarID, CarBehind.FrontAirHoseAngleAdjustmentRad, RearAirHoseAngleAdjustmentRad);
1339
-
1340
1331
}
1341
1332
1342
1333
// Train will derail if lateral forces on the train exceed the vertical forces holding the train on the railway track.
0 commit comments