-
Notifications
You must be signed in to change notification settings - Fork 45
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
core: add etcs loa logic to etcs braking simulator
Signed-off-by: Erashin <[email protected]>
- Loading branch information
Showing
3 changed files
with
258 additions
and
7 deletions.
There are no files selected for viewing
37 changes: 37 additions & 0 deletions
37
core/envelope-sim/src/main/kotlin/fr/sncf/osrd/envelope_sim/etcs/Constants.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,43 @@ | ||
package fr.sncf.osrd.envelope_sim.etcs | ||
|
||
/** | ||
* National Default Value: permission to inhibit the compensation of the speed measurement accuracy. | ||
* See Subset referenced in ETCSBrakingSimulator: table in Appendix A.3.2. | ||
*/ | ||
const val qNvinhsmicperm = false | ||
|
||
/** | ||
* Estimated acceleration during tBerem, worst case scenario (aEst2 is between 0 and 0.4), expressed | ||
* in m/s². See Subset referenced in ETCSBrakingSimulator: §3.13.9.3.2.9. | ||
*/ | ||
const val aEst2 = 0.4 | ||
|
||
/** See Subset referenced in ETCSBrakingSimulator: table in Appendix A.3.1. */ | ||
const val dvEbiMin = 7.5 / 3.6 // m/s | ||
const val dvEbiMax = 15.0 / 3.6 // m/s | ||
const val vEbiMin = 110.0 / 3.6 // m/s | ||
const val vEbiMax = 210.0 / 3.6 // m/s | ||
const val tWarning = 2.0 // s | ||
const val tDriver = 4.0 // s | ||
const val mRotatingMax = 15.0 // % | ||
const val mRotatingMin = 2.0 // % | ||
|
||
fun vUra(speed: Double): Double { | ||
return if (speed <= 30 / 3.6) 2 / 3.6 | ||
// vUra(30km/h) = 2km/h & vUra(500km/h) = 12km/h with a linear interpolation in between | ||
// this gives the following equation : y = (x + 64) / 47, still in km/h | ||
else ((speed + 64) / 47) / 3.6 | ||
} | ||
|
||
/** See Subset referenced in ETCSBrakingSimulator: §3.13.9.3.2.10. */ | ||
fun vDelta0(speed: Double): Double { | ||
return if (!qNvinhsmicperm) vUra(speed) else 0.0 | ||
} | ||
|
||
/** See Subset referenced in ETCSBrakingSimulator: §3.13.9.2.3. */ | ||
fun dvEbi(speed: Double): Double { | ||
return if (speed <= vEbiMin) dvEbiMin | ||
else if (speed < vEbiMax) | ||
(dvEbiMax - dvEbiMin) / (vEbiMax - vEbiMin) * (speed - vEbiMin) + dvEbiMin | ||
else dvEbiMax | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters