diff --git a/src/constructors.jl b/src/constructors.jl index 65fef2d..3500130 100644 --- a/src/constructors.jl +++ b/src/constructors.jl @@ -303,12 +303,12 @@ function Train(file, type = :YAML) transportType = :freight # "freight" or "passenger" for resistance calculation v_limit = 140 # in m/s (default 504 km/h) a_braking = 0 # in m/s^2, todo: implement as function - f_Rtd0 = 0 # coefficient for basic resistance due to the traction units driving axles (in ‰) - f_Rtc0 = 0 # coefficient for basic resistance due to the traction units carring axles (in ‰) - F_Rt2 = 3000 # coefficient for air resistance of the traction units (in N) - f_Rw0 = 0 # coefficient for the consists basic resistance (in ‰) - f_Rw1 = 0 # coefficient for the consists resistance to rolling (in ‰) - f_Rw2 = 0 # coefficient fo the consistsr air resistance (in ‰) + f_Rtd0 = 0 # coefficient for basic resistance due to the traction unit's driving axles (in ‰) + f_Rtc0 = 0 # coefficient for basic resistance due to the traction unit's carring axles (in ‰) + f_Rt2 = 0 # coefficient for air resistance of the traction unit (in ‰) + f_Rw0 = 0 # coefficient for the consist's basic resistance (in ‰) + f_Rw1 = 0 # coefficient for the consist's resistance to rolling (in ‰) + f_Rw2 = 0 # coefficient for the consist's air resistance (in ‰) F_v_pairs = [] # [v in m/s, F_T in N] ## load from file @@ -520,6 +520,7 @@ function Train(file, type = :YAML) id = train["id"] haskey(train, "UUID") ? uuid = parse(UUID, train["UUID"] ) : nothing transportType == :freight ? a_braking = -0.225 : a_braking = -0.375 # set a default a_braking value depending on the train type + #TODO: add source: Brünger, Dahlhaus, 2014 p. 74 (see formulary.jl) ## set the variables for all vehicles for vehicle in vehicles @@ -553,7 +554,7 @@ function Train(file, type = :YAML) haskey(loco, "a_braking") ? a_braking = loco["a_braking"] : nothing haskey(loco, "base_resistance") ? f_Rtd0 = loco["base_resistance"] : nothing haskey(loco, "rolling_resistance") ? f_Rtc0 = loco["rolling_resistance"] : nothing - haskey(loco, "air_resistance") ? F_Rt2 = loco["air_resistance"] * g * m_loco : nothing + haskey(loco, "air_resistance") ? f_Rt2 = loco["air_resistance"] : nothing haskey(loco, "mass_traction") ? m_td = loco["mass_traction"] * 1000 : m_td = m_t haskey(loco, "rotation_mass") ? ξ_loco = loco["rotation_mass"] : nothing m_tc = m_loco- m_td @@ -607,7 +608,7 @@ function Train(file, type = :YAML) ξ_train, ξ_loco, ξ_cars, transportType, v_limit, a_braking, - f_Rtd0, f_Rtc0, F_Rt2, f_Rw0, f_Rw1, f_Rw2, + f_Rtd0, f_Rtc0, f_Rt2, f_Rw0, f_Rw1, f_Rw2, F_v_pairs ) @@ -674,7 +675,7 @@ function createCharacteristicSection(id::Integer, s_entry::Real, section::Dict, for POI in path.poi s_poi = POI[:station] if POI[:measure] == "rear" - s_poi -= s_trainLength + s_poi += s_trainLength end if s_entry < s_poi && s_poi < s_exit push!(pointsOfInterest, (s_poi, POI[:label]) ) diff --git a/src/formulary.jl b/src/formulary.jl index f0df586..a6961b6 100644 --- a/src/formulary.jl +++ b/src/formulary.jl @@ -55,15 +55,15 @@ function calcTractionUnitResistance(v::AbstractFloat, train::Train) # equation is based on [Wende:2003, page 151] f_Rtd0 = train.f_Rtd0 # coefficient for basic resistance due to the traction units driving axles (in ‰) f_Rtc0 = train.f_Rtc0 # coefficient for basic resistance due to the traction units carring axles (in ‰) - F_Rt2 = train.F_Rt2 # coefficient for air resistance of the traction units (in N) + f_Rt2 = train.f_Rt2 # coefficient for air resistance of the traction unit (in ‰) m_td = train.m_td # mass on the traction unit's driving axles (in kg) m_tc = train.m_tc # mass on the traction unit's carrying axles (in kg) - F_R_tractionUnit = f_Rtd0/1000 * m_td * g + f_Rtc0/1000 * m_tc * g + F_Rt2 * ((v + Δv_air) /v00)^2 # vehicle resistance of the traction unit (in N) # /1000 because of the unit ‰ - # TODO: use calcForceFromCoefficient? F_R_tractionUnit = calcForceFromCoefficient(f_Rtd0, m_td) + calcForceFromCoefficient(f_Rtc0, m_tc) + F_Rt2 * ((v + Δv_air) /v00)^2 # vehicle resistance of the traction unit (in N) + + F_R_tractionUnit = f_Rtd0/1000 * m_td * g + f_Rtc0/1000 * m_tc * g + f_Rt2/1000 * (m_td+m_tc) * g * ((v + Δv_air) /v00)^2 # vehicle resistance of the traction unit (in N) # /1000 because of the unit ‰ + # TODO: use calcForceFromCoefficient? F_R_tractionUnit = calcForceFromCoefficient(f_Rtd0, m_td) + calcForceFromCoefficient(f_Rtc0, m_tc) + calcForceFromCoefficient(f_Rt2, m_td+m_tc) * ((v + Δv_air) /v00)^2 # vehicle resistance of the traction unit (in N) return F_R_tractionUnit - #TODO: same variable name like in the rest of the tool? return R_traction - #TODO: just one line? return train.f_Rtd0/1000*train.m_td*g+train.f_Rtc0/1000*train.m_tc*g+train.F_Rt2*((v+train.Δv_air)/v00)^2 # /1000 because of the unit ‰ + #TODO: same variable name like in the rest of TrainRuns? return R_traction end #function calcTractionUnitResistance """ diff --git a/src/types.jl b/src/types.jl index 89e9e1a..fd1c840 100644 --- a/src/types.jl +++ b/src/types.jl @@ -45,10 +45,10 @@ struct Train a_braking::Real # in m/s^2 # coefficients for the vehicle resistance - # for the traction unit (F_Rt=f_Rtd0*m_td*g+f_Rtc0*m_tc*g+F_Rt2*((v+Δv_air)/v00)^2) + # for the traction unit (F_Rt=f_Rtd0*m_td*g+f_Rtc0*m_tc*g+f_Rt2*m_loco*g*((v+Δv_air)/v00)^2) f_Rtd0::Real # coefficient for basic resistance due to the traction units driving axles (in ‰) f_Rtc0::Real # coefficient for basic resistance due to the traction units carring axles (in ‰) - F_Rt2::Real # coefficient for air resistance of the traction units (in N) + f_Rt2::Real # coefficient for air resistance of the traction units (in ‰) # for the consist (set of wagons) (F_Rw=m_w*g*(f_Rw0+f_Rw1*v/v00+f_Rw2*((v+Δv_air)/v00)^2)) f_Rw0::Real # coefficient for the consists basic resistance (in ‰) diff --git a/test/data/trains/freight.yaml b/test/data/trains/freight.yaml index c23db6f..9e0025b 100644 --- a/test/data/trains/freight.yaml +++ b/test/data/trains/freight.yaml @@ -37,7 +37,7 @@ vehicles: rotation_mass: 1.09 # source: "Railway Timetabling & Operations" by Hansen, et al., 2014, p. 71 for the traction unit base_resistance: 2.2 # source: "Fahrdynamik des Schienenverkehrs" by Wende, 2003, p. 151 for "4-achsige Diesellokomot." -> 2.2 ‰ to 3.5 ‰ - air_resistance: 0.01 # source: "Fahrdynamik des Schienenverkehrs" by Wende, 2003, p. 151 for "MittelfUhrerstand" -> 5000 N to 10000 N; modified for the used formula + air_resistance: 10 # source: "Fahrdynamik des Schienenverkehrs" by Wende, 2003, p. 151 for "MittelfUhrerstand" -> 5000 N to 10000 N; modified for the used formula tractive_effort: - [0.0, 186940] diff --git a/test/data/trains/local.yaml b/test/data/trains/local.yaml index 5c380e8..306e637 100644 --- a/test/data/trains/local.yaml +++ b/test/data/trains/local.yaml @@ -9,12 +9,12 @@ trains: vehicles: - name: Siemens Desiro Classic # source: https://de.wikipedia.org/wiki/Siemens_Desiro_Classic - id: DB_BR_642 + id: DB_BR_642 UUID: c915c80d-c63d-490b-879f-c481e4b62b55 picture: https://commons.wikimedia.org/wiki/File:Liesel_28-11-10_642_055-8_im_Bahnhof_Scharfenstein.JPG power_type: diesel # source: https://de.wikipedia.org/wiki/Siemens_Desiro_Classic vehicle_type: multiple unit # source: https://de.wikipedia.org/wiki/Siemens_Desiro_Classic - + length: 41.7 # source: https://de.wikipedia.org/wiki/Siemens_Desiro_Classic mass: 68.0 # source: https://de.wikipedia.org/wiki/Siemens_Desiro_Classic load_limit: 20.0 # source: https://de.wikipedia.org/wiki/Siemens_Desiro_Classic @@ -26,7 +26,7 @@ vehicles: rotation_mass: 1.08 # source: "Fahrdynamik des Schienenverkehrs" by Wende, 2003, p. 13 for "Zug, überschlägliche Berechnung" base_resistance: 3.0 # source: "Fahrdynamik des Schienenverkehrs" by Wende, 2003, p. 151 for "f_WL0" -> 2.5 ‰ to 3.5 ‰ rolling_resistance: 1.4 # source: "Fahrdynamik des Schienenverkehrs" by Wende, 2003, p. 151 for "f_WW0" -> 1.2 ‰ to 1.6 ‰ - air_resistance: 0.0039 # source: the closest parameters are used: "Fahrdynamik des Schienenverkehrs" by Wende, 2003, p. 151 for "Fzg. vierachsig, abgerundeter Kopf" plus "Sektion bei Mehrteiligkeit" -> 2200 N + 400 N + air_resistance: 3.9 # source: the closest parameters are used: "Fahrdynamik des Schienenverkehrs" by Wende, 2003, p. 151 for "Fzg. vierachsig, abgerundeter Kopf" plus "Sektion bei Mehrteiligkeit" -> 2200 N + 400 N # tractive effort as pairs of speed and tractive effort tractive_effort: diff --git a/test/data/trains/longdistance.yaml b/test/data/trains/longdistance.yaml index 2369208..066b51c 100644 --- a/test/data/trains/longdistance.yaml +++ b/test/data/trains/longdistance.yaml @@ -54,7 +54,7 @@ vehicles: rotation_mass: 1.09 # source: "Railway Timetabling & Operations" by Hansen, et al., 2014, p. 71 for the traction unit base_resistance: 2.5 # source: "Fahrdynamik des Schienenverkehrs" by Wende, 2003, p. 151 for "4-achsige Diesellokomot." -> 2.2 ‰ to 3.5 ‰ - air_resistance: 0.006 # source: "Fahrdynamik des Schienenverkehrs" by Wende, 2003, p. 151 for "4-achsig, eckige Kopfform" with "Stromabnehmer" -> 5000 N to 6000 N; modified for the used formula + air_resistance: 6.0 # source: "Fahrdynamik des Schienenverkehrs" by Wende, 2003, p. 151 for "4-achsig, eckige Kopfform" with "Stromabnehmer" -> 5000 N to 6000 N; modified for the used formula tractive_effort: - [0.0, 300000]