extend carFollowModel "Rail" with custom configuration via XML
Introduction
- currently, hard-coded trainTypes like "RB425" or "ICE3" exist for carFollowModel "Rail"
- this proposal extends the carFollowModel "Rail" with a flexible configuration via XML
- the trainType "custom" is introduced and configured via parameters or tables in the XML file
Theory and assumptions
- the acceleration of trains is speed dependant
- traction force is mainly limited by friction at lower speeds
- traction force is mainly limited by power at higher speeds
- traction force can be approximated with two parameters maximum traction and maximum power
- resistance force can be approximated with a quadratic equation
A: Train dynamics from equations
requires trainType custom and the following parameters
- vehicleMass
- massFactor
- maximumPower
- maximumTraction
- constantResistanceCoefficient
- linearResistanceCoefficient
- quadraticResistanceCoefficient
XML example
<vType id="tractionFromEquation" vClass="rail" carFollowModel="Rail" trainType="custom" accel="1" decel="1" >
<!-- existing attributes -->
<param key="maximumPower" value="2350000"/>
<param key="vehicleMass" value="114000"/>
<!-- new attributes -->
<param key="maximumTraction" value="150"/>
<param key="massFactor" value="1.05"/>
<param key="constantResistanceCoefficient" value="1670"/>
<param key="linearResistanceCoefficient" value="0.03"/>
<param key="quadraticResistanceCoefficient" value="0.28"/>
</vType>
Equations for traction and resistance forces
equation for traction force in N
traction = min(maximumPower/speed*3.6, maximumTraction)
equation for resistance force in N
resistance = quadraticResistanceCoefficient*speed**2 + linearResistanceCoefficient*speed + constantResistanceCoefficient
B:Train dynamics from tables
requires trainType custom and the following parameters
- vehicleMass
- massFactor
- speedTable
- child traction
- child resistance
speed values inbetween are interpolated
XML example
<vType id="tractionFromTable" vClass="rail" carFollowModel="Rail" trainType="custom" accel="1" decel="1" >
<!-- existing attributes -->
<param key="vehicleMass" value="114000"/>
<!-- new attributes -->
<param key="massFactor" value="1.05"/>
<param key="speedTable" value="0"/>
<param key="traction" value="150000"/>
<param key="resistance" value="2600"/>
<param key="speedTable" value="50"/>
<param key="traction" value="150000"/>
<param key="resistance" value="4900"/>
<param key="speedTable" value="100"/>
<param key="traction" value="84000"/>
<param key="resistance" value="9700"/>
</vType>
Units
Proposed physical units
- [speed] = km/h
- [maximumPower] = W
- [vehicleMass] = kg
- [massFactor] = 1
- [maximumTraction] = N
- [quadraticResistanceCoefficient] = N*h²/km²
- [linearResistanceCoefficient] = N*h/km
- [constantResistanceCoefficient] = N
Notes on implementation
- this proposal is intended only for carFollowModel="Rail" and trainType="custom"
- if both additional parameters and table are given, table is used
- vType decel value is used as before
- vType accel value is overwritten by speed dependant acceleration from table or equation
Discussion
The accel value could be used to estimate maximumTraction:
maximumTraction = vehicleMass*massFactor*accel
The speed could be given in m/s instead of km/h, but this seems more uncommon.
AFAIK param keys have to be unique within the entity for which they are defined. The example shows multiple use of "speedTable", "traction", "resistance". The easy and ugly solution would be to concatenate all values of the same key to a single value.
So you mean something like this?
<param key="speedValues" value="0 50 100"/>
<param key="tractionValues" value="150000 150000 84000"/>
<param key="resistanceValues" value="2600 4900 9700"/>
@behrisch @ritzerp needs somebody for the C++ part of the work but wants to contribute by writing tests or similar.
@bcoueraud87 you were assigned to #13489, do you still want to work on this?
Loading all the new values from <param> might speed up implementation a bit but has the disadvantage of preventing schema validation. Since its already common for carFollowModels to have plenty of parameters (i.e. 17 for EIDM) we could easily add 6 for the equation style (mass already exists) and another 3 for the value tables.
@bcoueraud87 you were assigned to #13489, do you still want to work on this?
No thank you.
by convention, the value tables for resistance and traction use speed in km/h whereas sumo uses m/s almost everywhere. @behrisch , @ritzerp Should we rather break convention or consistency here?
@ritzerp, it looks as if your example gives maximumTraction in kN rather than N. I actually find this more practical (also using kW for maximumPower instead of W). For consistency, this would also imply scaling the resistance coefficients so that the formula returns kN.
@behrisch would your rather have the pure SI units though?
some implementation notes:
- renamed some attributes (see new custom tests)
- all train types permit overwriting traction or resistance with tables/curves (only custom demands it)
- if tables and curves are given a warning is issued but curves are used
- at the moment speedTable is in km/h, maxPower and maxTraction in kN but the resistance coefficients are scaled to N (to shorten the input). I'm expecting a discussion and eventual changes to this
After a short discussion the current preference is m/s and kN everywhere
Sorry for late reply. I think I prefer consistency within SUMO and use m/s. I also support the decision to use kN, since forces are quite high for trains. As long as it is documented, this should be fine.