Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

core: add ETCS SVL logic to ETCS braking simulator #10402

Open
wants to merge 2 commits into
base: dev
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -111,6 +111,10 @@ public double getMinGrade(double begin, double end) {
// TODO: Optimise method by adding in a cache.
int indexBegin = getIndexBeforePos(begin);
int indexEnd = getIndexBeforePos(end);
// TODO: Remove if we extend path properties until last SvL > path.length.
if (indexBegin == indexEnd && indexBegin == gradePositions.length - 1)
// Take last grade value in this case
return gradeValues[gradeValues.length - 1];
var lowestGradient = gradeValues[indexBegin];
for (int i = indexBegin; i < indexEnd; i++) {
var grad = gradeValues[i];
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
package fr.sncf.osrd.envelope_sim;

import static fr.sncf.osrd.envelope_sim.TrainPhysicsIntegrator.GRAVITY_ACCELERATION;
import static fr.sncf.osrd.envelope_sim.etcs.ConstantsKt.mRotatingMax;
import static fr.sncf.osrd.envelope_sim.etcs.ConstantsKt.mRotatingMin;
import static fr.sncf.osrd.envelope_sim.etcs.ConstantsKt.M_ROTATING_MAX;
import static fr.sncf.osrd.envelope_sim.etcs.ConstantsKt.M_ROTATING_MIN;

import fr.sncf.osrd.railjson.schema.rollingstock.RJSEtcsBrakeParams;

Expand Down Expand Up @@ -64,7 +64,7 @@ static double getMaxEffort(double speed, TractiveEffortPoint[] tractiveEffortCur
* mRotating (Max or Min) is in %, as seen in ERA braking curves simulation tool v5.1.
*/
static double getGradientAcceleration(double grade) {
var mRotating = grade >= 0 ? mRotatingMax : mRotatingMin;
var mRotating = grade >= 0 ? M_ROTATING_MAX : M_ROTATING_MIN;
return -GRAVITY_ACCELERATION * grade / (1000.0 + 10.0 * mRotating);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,43 +11,49 @@ package fr.sncf.osrd.envelope_sim.etcs
* National Default Value: permission to inhibit the compensation of the speed measurement accuracy.
* See Subset 026: table in Appendix A.3.2.
*/
const val qNvinhsmicperm = false
const val Q_NVINHSMICPERM = false

/**
* National Default Value: permission to follow release speed at 40km/h near the EoA. See Subset
* 026: table in Appendix A.3.2.
*/
const val NATIONAL_RELEASE_SPEED = 40.0 / 3.6 // m/s

/**
* Estimated acceleration during tBerem, worst case scenario (aEst2 is between 0 and 0.4), expressed
* in m/s². See Subset 026: §3.13.9.3.2.9.
*/
const val aEst2 = 0.4
const val A_EST_2 = 0.4

/** See Subset 026: 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 // %
const val DV_EBI_MIN = 7.5 / 3.6 // m/s
const val DV_EBI_MAX = 15.0 / 3.6 // m/s
const val V_EBI_MIN = 110.0 / 3.6 // m/s
const val V_EBI_MAX = 210.0 / 3.6 // m/s
const val T_WARNING = 2.0 // s
const val T_DRIVER = 4.0 // s
const val M_ROTATING_MIN = 2.0 // %
const val M_ROTATING_MAX = 15.0 // %

/** See Subset 041: §5.3.1.2. */
const val vUraMinLimit = 30 / 3.6 // m/s
const val vUraMaxLimit = 500 / 3.6 // m/s
const val vUraMin = 2 / 3.6 // m/s
const val vUraMax = 12 / 3.6 // m/s
const val V_URA_MIN_LIMIT = 30 / 3.6 // m/s
const val V_URA_MAX_LIMIT = 500 / 3.6 // m/s
const val V_URA_MIN = 2 / 3.6 // m/s
const val V_URA_MAX = 12 / 3.6 // m/s

/** See Subset 041: §5.3.1.2. */
fun vUra(speed: Double): Double {
return interpolateLinearSpeed(speed, vUraMinLimit, vUraMaxLimit, vUraMin, vUraMax)
return interpolateLinearSpeed(speed, V_URA_MIN_LIMIT, V_URA_MAX_LIMIT, V_URA_MIN, V_URA_MAX)
}

/** See Subset 026: §3.13.9.3.2.10. */
fun vDelta0(speed: Double): Double {
return if (!qNvinhsmicperm) vUra(speed) else 0.0
return if (!Q_NVINHSMICPERM) vUra(speed) else 0.0
}

/** See Subset 026: §3.13.9.2.3. */
fun dvEbi(speed: Double): Double {
return interpolateLinearSpeed(speed, vEbiMin, vEbiMax, dvEbiMin, dvEbiMax)
return interpolateLinearSpeed(speed, V_EBI_MIN, V_EBI_MAX, DV_EBI_MIN, DV_EBI_MAX)
}

/**
Expand Down
Loading
Loading