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

towed rolling stocks don't forward rolling resistance values in the right unit #9657

Closed
eckter opened this issue Nov 8, 2024 · 2 comments · Fixed by #9666
Closed

towed rolling stocks don't forward rolling resistance values in the right unit #9657

eckter opened this issue Nov 8, 2024 · 2 comments · Fixed by #9666
Assignees
Labels
area:editoast Work on Editoast Service kind:bug Something isn't working severity:critical Critical severity bug

Comments

@eckter
Copy link
Contributor

eckter commented Nov 8, 2024

What happened?

When sending an stdcm request for a given rolling stock with no towed rolling stock, the rolling resistance have this value (in the payload editoast -> core):

        "rolling_resistance": {
            "type": "davis",
            "A": 2200.0,
            "B": 64.8,
            "C": 5.832
        },

Same rolling stock but with a towed rolling stock:

        "rolling_resistance": {
            "type": "davis",
            "A": 2200000.0,
            "B": 233280.0,
            "C": 75582.72
        },

Unsurprisingly, we always fail to find a solution. This happens for any value in the towed rolling stock data.

What did you expect to happen?

Values with the same order of magnitude as before

How can we reproduce it (as minimally and precisely as possible)?

Run any kind of request with a towed rolling stock (and weight and such otherwise it's ignored). Check the payloads received by core (can be done by setting LOG_STDCM_REQUESTS=true

On which environments the bug occurs?

Local, Recette (SNCF), Dev (SNCF)

On which browser the bug occurs?

Firefox

OSRD version (top right corner Account button > Informations)

8461f3e

@eckter eckter added area:editoast Work on Editoast Service kind:bug Something isn't working severity:critical Critical severity bug labels Nov 8, 2024
@woshilapin woshilapin self-assigned this Nov 8, 2024
@woshilapin
Copy link
Contributor

woshilapin commented Nov 8, 2024

TLDR: we might have some unit problems combined with incorrect formulas (mostly due to incorrect units).

Our original data for rolling resistance on traction engines are in the following units:

  • solid friction: daN
  • viscosity friction: daN/(km/h)
  • aerodynamic friction: daN/(km/h)²

Then we use our internal tool to convert these into International System of Unit (SI) which means N, m and s. So here are the units inserted in the database through editoast:

  • solid friction: N
  • viscosity friction: N/(m/s)
  • aerodynamic friction: N/(m/s)²

And finally, these values are combined with those of "towed rolling stocks" to produce a total rolling resistance to send for an STDCM request with the following formula:

  • $totalSolidFriction = tractionEngine[solidFriction] * tractionEngine[mass] + towed[solidFriction] * (towed[mass] - tractionEngine[mass])$
  • $totalViscosityFriction = tractionEngine[viscosityFriction] * tractionEngine[mass] + towed[viscosityFriction] * (towed[mass] - tractionEngine[mass])$
  • $totalAerodynamicFriction = tractionEngine[aerodynamicFriction] * tractionEngine[mass] + towed[aerodynamicFriction] * (towed[mass] - tractionEngine[mass])$

⚠ If you followed all along, here are the problems $tractionEngine[solidFriction]$ is multiplied by $tractionEngine[mass]$ but it shouldn't because the former's unity is "N", not "N/kg". Same for $towed[solidFriction]$.

However, by an interesting hasard, the data of rolling resistance we have for towed rolling stocks have the following units:

  • solid friction: daN/t
  • viscosity friction: (daN/t)/(km/h)
  • aerodynamic friction: (daN/t)/(km/h)²

So that means our formula are partly correct for the towed part.

⚠ But another problem is that we store both rolling resistance (for rolling stocks and for towed rolling stocks, so with different units) with the same struct RollingResistance in editoast. This struct has comment on which units are used but obviously, it is partly wrong because we store 2 different kind of units with the same struct.

After discussion with @flomonster, we will introduce a struct RollingResistancePerWeight for towed rolling stocks. And therefore, here are the formula we're going to use.

  • $totalSolidFriction = tractionEngine[solidFriction] + towed[solidFrictionPerWeight] * (towed[mass] - tractionEngine[mass])$
  • $totalViscosityFriction = tractionEngine[viscosityFriction] + towed[viscosityFrictionPerWeight] * (towed[mass] - tractionEngine[mass])$
  • $totalAerodynamicFriction = tractionEngine[aerodynamicFriction] + towed[aerodynamicFrictionPerWeight] * (towed[mass] - tractionEngine[mass])$

cc @axrolld : is the summary sound for you?

@axrolld
Copy link
Contributor

axrolld commented Nov 12, 2024

Thanks so much for investigating ! I guess we didn't catch that mistake in the original PR...

The formulas you suggest at then end are correct for the units we are manipulating. The original formula was built for data per ton of RS so it was partly inapropriate.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area:editoast Work on Editoast Service kind:bug Something isn't working severity:critical Critical severity bug
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants