mirror of
https://github.com/MaSzyna-EU07/maszyna.git
synced 2026-11-21 10:55:01 +01:00
feat(track): unevenness waves shaped by the track spectra of FRA and ORE B176 (#426)
* feat(track): unevenness waves shaped by the track spectra of FRA and ORE B176 The waves were 5-42 m sideways and 8-83 m vertically, with the long ones cut down, so a short wavelength carried a large share and the ride and the rails looked busy. They are now 7-90 m sideways and 8-110 m vertically, about the bands D1-D3 of EN 13848, each wave standing for a band of the spectrum S ~ Wc^2 / (W^2 (W^2 + Wc^2)), Wc = 0.8245 rad/m, the shape the FRA and the ORE B176 (German) spectra share: the longer a wave, the higher it is. The "uneven" value keeps its meaning, the peak deviation of a rail on a 10 m chord as PLK Id-14 measures it, so the values in sceneries stay as they are. Since the chord sees the long waves less, the amplitudes are calibrated again, and apart for the vertical and the sideways waves: stray_per_mm becomes stray_up_per_mm 0.00229 and stray_side_per_mm 0.0031, and cross_share 0.35. A track at "uneven 18" measures 18 mm vertically, 17 sideways, 15 of twist, +-10 of gauge, 21 of cross level and J 5.7 against the Id-14 limits for 80 km/h. A rail now goes up to about 5 cm off its design over the long waves, so the bound of the test goes from 40 to 60 mm; the short waves the cab shakes on are smaller, the sideways bend under the axles about 30% less. Every scenery with unevenness looks and rides differently after this. No release has unevenness yet. The grading tool follows the vertical waves; on Baltyk the pantograph keeps within 0.6 cm of the wire up to the product 1150 of the vertical value and the speed (925 before). * test(track): bound the sideways offset of an uneven track off its design The longer waves move the track about 4.5 cm sideways off its design at "uneven 18" (2 cm before), and nothing checked or stated it. The Id-14 test now bounds the peak sideways offset of the middle of the track below 5 cm, next to the vertical one, so a later change of the shares can't double it unnoticed. The doc gives the figure, and names platform edges and level crossing panels among what a rail moves away from. --------- Co-authored-by: maj00r <maj00r@host>
This commit is contained in:
@@ -63,7 +63,8 @@ TEST_CASE("uneven track: the cab keeps what the ride on the track doesn't stand
|
||||
TEST_CASE("uneven track: measures as the Id-14 limits for its value")
|
||||
{
|
||||
// appendix 1, class C at 80 km/h: 18 mm vertically, 17 mm sideways, 16 mm of twist on 5 m, gauge +10/-8 mm, 20 mm of cross level, J = 5.3
|
||||
auto const amplitude{track_uneven::stray_per_mm * 18.0 * 1000.0}; // mm
|
||||
auto const amplitude{track_uneven::stray_up_per_mm * 18.0 * 1000.0}; // mm
|
||||
auto const sideways{track_uneven::stray_side_per_mm * 18.0 * 1000.0}; // mm
|
||||
double const gauge{1.435};
|
||||
double const step{0.5};
|
||||
int const steps{4000};
|
||||
@@ -76,6 +77,7 @@ TEST_CASE("uneven track: measures as the Id-14 limits for its value")
|
||||
double level{0.0};
|
||||
double j{0.0};
|
||||
double away{0.0};
|
||||
double aside{0.0};
|
||||
for (int line = 0; line < lines; ++line)
|
||||
{
|
||||
auto const heading{glm::pi<double>() * (line + 0.37) / lines};
|
||||
@@ -85,6 +87,7 @@ TEST_CASE("uneven track: measures as the Id-14 limits for its value")
|
||||
std::array<std::vector<double>, 2> up;
|
||||
std::array<std::vector<double>, 2> side;
|
||||
std::vector<double> middle;
|
||||
std::vector<double> across_middle;
|
||||
for (int i = 0; i < steps; ++i)
|
||||
{
|
||||
auto const point{start + along * (i * step)};
|
||||
@@ -93,9 +96,11 @@ TEST_CASE("uneven track: measures as the Id-14 limits for its value")
|
||||
auto const sign{rail == 0 ? 1.0 : -1.0};
|
||||
auto const stray{track_uneven::field(point + across * (sign * 0.5 * gauge))};
|
||||
up[rail].push_back((stray.y - sign * 0.5 * track_uneven::level(point, across)) * amplitude);
|
||||
side[rail].push_back(glm::dot(stray, across) * amplitude);
|
||||
side[rail].push_back(glm::dot(stray, across) * sideways);
|
||||
}
|
||||
middle.push_back(track_uneven::field(point).y * amplitude);
|
||||
auto const centre{track_uneven::field(point)};
|
||||
middle.push_back(centre.y * amplitude);
|
||||
across_middle.push_back(glm::dot(centre, across) * sideways);
|
||||
}
|
||||
std::vector<double> verticals;
|
||||
std::vector<double> horizontals;
|
||||
@@ -120,6 +125,7 @@ TEST_CASE("uneven track: measures as the Id-14 limits for its value")
|
||||
wander += peak(gauges) / lines;
|
||||
level += peak(levels) / lines;
|
||||
away += peak(middle) / lines;
|
||||
aside += peak(across_middle) / lines;
|
||||
j += (deviation(verticals) + deviation(horizontals) + deviation(twists) + 0.5 * deviation(gauges)) / 3.5 / lines;
|
||||
}
|
||||
CHECK(vertical == doctest::Approx(18.0).epsilon(0.1));
|
||||
@@ -128,7 +134,11 @@ TEST_CASE("uneven track: measures as the Id-14 limits for its value")
|
||||
CHECK(wander == doctest::Approx(10.0).epsilon(0.2));
|
||||
CHECK(level == doctest::Approx(20.0).epsilon(0.1));
|
||||
CHECK(j == doctest::Approx(5.3).epsilon(0.2));
|
||||
CHECK(away < 40.0); // the long waves go past the 15 mm off the survey marks of appendix 1a
|
||||
// the long waves go past the 15 mm off the survey marks of appendix 1a: most of the height of a track spectrum is in them, the 10 m chord
|
||||
// hardly sees them
|
||||
CHECK(away < 60.0);
|
||||
// and sideways: about 4.5 cm, which a platform edge or the panels of a level crossing laid on the design are off the rails by
|
||||
CHECK(aside < 50.0);
|
||||
}
|
||||
|
||||
TEST_CASE("uneven track: a place strays the same every time")
|
||||
@@ -136,11 +146,11 @@ TEST_CASE("uneven track: a place strays the same every time")
|
||||
// no random numbers: changing these changes how every uneven track in every scenery looks
|
||||
glm::dvec3 const place{1234.5, 0.0, -678.9};
|
||||
auto const stray{track_uneven::field(place)};
|
||||
CHECK(stray.x == doctest::Approx(0.309777548158).epsilon(1e-9));
|
||||
CHECK(stray.y == doctest::Approx(0.311350299745).epsilon(1e-9));
|
||||
CHECK(stray.z == doctest::Approx(-0.328429734019).epsilon(1e-9));
|
||||
CHECK(track_uneven::level(place, {1.0, 0.0, 0.0}) == doctest::Approx(0.53 * -0.178598957983).epsilon(1e-9));
|
||||
CHECK(track_uneven::level(place, {0.0, 0.0, 1.0}) == doctest::Approx(0.53 * -0.868291889902).epsilon(1e-9));
|
||||
CHECK(stray.x == doctest::Approx(0.158385385505).epsilon(1e-9));
|
||||
CHECK(stray.y == doctest::Approx(0.356190053667).epsilon(1e-9));
|
||||
CHECK(stray.z == doctest::Approx(0.200372098150).epsilon(1e-9));
|
||||
CHECK(track_uneven::level(place, {1.0, 0.0, 0.0}) == doctest::Approx(0.35 * -0.178598957983).epsilon(1e-9));
|
||||
CHECK(track_uneven::level(place, {0.0, 0.0, 1.0}) == doctest::Approx(0.35 * -0.868291889902).epsilon(1e-9));
|
||||
}
|
||||
|
||||
TEST_CASE("uneven track: tracks laid towards each other meet at one cant")
|
||||
|
||||
@@ -38,10 +38,10 @@ CURVE_STEP = 1.0 / 2500.0 # a difference of curvature that counts as a change,
|
||||
RISE = 0.0273 * 4.5 # how fast pressure lifts a pantograph, m/s, by TDynamicObject::Update
|
||||
GAP_MOST = 0.006 # the gap to the wire allowed; at 0.01 m the voltage goes and the main breaker trips
|
||||
OVERSPEED = 1.1 # a driver can go this much over the speed of the track
|
||||
# as up_waves and the dip of the joints in world/TrackUneven.h
|
||||
STRAY_PER_MM, DIP_SHARE, DIP_REACH = 0.00145, 0.4, 3.0
|
||||
# as up_waves, stray_up_per_mm and the dip of the joints in world/TrackUneven.h
|
||||
STRAY_PER_MM, DIP_SHARE, DIP_REACH = 0.00229, 0.4, 3.0
|
||||
GOLDEN = math.pi * (3.0 - math.sqrt(5.0))
|
||||
UP_WAVES = [(2 * math.pi / length * math.cos(GOLDEN * i), 2 * math.pi / length * math.sin(GOLDEN * i), GOLDEN * (i + 1), share) for i, (length, share) in enumerate(zip((8.3, 11.9, 16.7, 23.9, 37.1, 47.3, 61.9, 83.3), (.14, .19, .22, .22, .23, .23, .23, .23)))]
|
||||
UP_WAVES = [(2 * math.pi / length * math.cos(GOLDEN * i), 2 * math.pi / length * math.sin(GOLDEN * i), GOLDEN * (i + 1), share) for i, (length, share) in enumerate(zip((8.0, 11.6, 16.9, 24.6, 35.8, 52.0, 75.6, 110.0), (.0761, .1058, .1393, .176, .2175, .2651, .3215, .3887)))]
|
||||
TOKEN = re.compile(r"//[^\n]*|\S+")
|
||||
NUMBER = re.compile(r"^[-+]?(\d+(\.\d*)?|\.\d+)([eE][-+]?\d+)?$")
|
||||
|
||||
|
||||
@@ -46,15 +46,17 @@ A track with `uneven 18` measures as follows (`tests/unit/test_track_uneven.cpp`
|
||||
| parameter | result | Id-14 |
|
||||
|--------------------------|--------|-----------|
|
||||
| vertical irregularities | 18 mm | 18 mm |
|
||||
| horizontal irregularities | 19 mm | 17 mm |
|
||||
| horizontal irregularities | 17 mm | 17 mm |
|
||||
| twist on a 5 m base | 15 mm | 16 mm |
|
||||
| gauge | ±10 mm | +10/-8 mm |
|
||||
| cross level | 20 mm | 20 mm |
|
||||
| J index | 6.1 | 5.3 |
|
||||
| cross level | 21 mm | 20 mm |
|
||||
| J index | 5.7 | 5.3 |
|
||||
|
||||
Id-14 only gives the scale of the value: how a track at that value measures. What the waves look like follows the track spectra of the literature, see "How it works".
|
||||
|
||||
## How it works
|
||||
|
||||
Unevenness is a displacement field that depends on the position on the map, made of waves 5-42 m long. Vertically there are fewer short waves, so the rails come near the peak value more often, and there are also waves of 47-83 m: they hardly count on the 10 m chord, the body rises and falls on them, and a pantograph keeps up with them. Nothing in it is random: one place bends the same way on every run. A track that is moved gets the waves of its new place.
|
||||
Unevenness is a displacement field that depends on the position on the map, made of waves 7-90 m long sideways and 8-110 m long vertically, about the bands D1-D3 of EN 13848. Their heights follow the shape of the track spectra of the US FRA and of ORE B176 (the German spectrum): a power spectral density of `Wc² / (W² (W² + Wc²))`, `Wc = 0.8245 rad/m`, so the longer a wave, the higher it is. Most of the height is in the long waves: they hardly count on the 10 m chord, the body rises and falls on them slowly, and the cab hardly feels them. At `uneven 18` a track goes up to about 5 cm up or down and about 4.5 cm sideways off its design over the long waves, and the short ones of 7-10 m, the ones the cab shakes on, are a few millimetres. Nothing in it is random: one place bends the same way on every run. A track that is moved gets the waves of its new place.
|
||||
|
||||
Each component joins separately:
|
||||
|
||||
@@ -67,7 +69,7 @@ The ends of joined paths meet in the middle between them, with one vector across
|
||||
|
||||
The rails, the top of the ballast, `sleepermodel`, the axles, the roll of the body and the cab shake follow the unevenness. The slope of the ballast takes up the difference, and its foot stays as designed, on the ground.
|
||||
|
||||
Models from includes (e.g. switch drives and timbers), the terrain and the catenary don't follow it, so at large values a rail shifts away from such a model by a few centimetres.
|
||||
Models from includes (e.g. switch drives and timbers), platform edges, level crossing panels, the terrain and the catenary don't follow it, so at large values a rail shifts away from such a model by a few centimetres, sideways up to about 4.5 cm at `uneven 18`.
|
||||
|
||||
On a track with unevenness the track itself shakes the cab, in place of two of the sources of shake that were there before, as far as it has something to put in their place. It goes by the track under the vehicle, and on a switch by the path set and what its joined tracks allow. Dips at the joints and cross level replace nothing, as they don't shake the cab all the way along or sideways. On tracks with no unevenness everything works as before.
|
||||
|
||||
@@ -83,7 +85,7 @@ On a track with unevenness the track itself shakes the cab, in place of two of t
|
||||
|
||||
This is about the cab only. The physics, derailment included, and the noise of the wheels still use the lateral acceleration.
|
||||
|
||||
A pantograph rises at the rate set by the pressure, about 0.14 m/s, and a gap to the wire over 1 cm cuts the voltage and trips the main breaker. Unevenness adds to this at high speed. On the tracks of Bałtyk a simulation gives a gap of 0.6 cm when the vertical value times the speed in km/h is 925, for example 8 mm at 120 km/h, 13 mm at 70 km/h and 23 mm at 40 km/h. The values in the Id-14 table are higher than that. The wire alone can do it too: at `tor0290` on Bałtyk it rises by about 1%, so a pantograph keeps up to about 46 km/h there, and above that the breaker trips on a straight track as well.
|
||||
A pantograph rises at the rate set by the pressure, about 0.14 m/s, and a gap to the wire over 1 cm cuts the voltage and trips the main breaker. Unevenness adds to this at high speed. On the tracks of Bałtyk a simulation gives a gap of 0.6 cm when the vertical value times the speed in km/h is 1150, for example 9.6 mm at 120 km/h, 16 mm at 70 km/h and 29 mm at 40 km/h. The values in the Id-14 table are higher than that. The wire alone can do it too: at `tor0290` on Bałtyk it rises by about 1%, so a pantograph keeps up to about 46 km/h there, and above that the breaker trips on a straight track as well.
|
||||
|
||||
The physics takes the curve radius and the grade from the design, so unevenness doesn't change them. It adds only the cross level towards derailment, about 0.06 m/s² at `uneven 18` against a threshold of about 3.2 m/s².
|
||||
|
||||
|
||||
@@ -433,8 +433,10 @@ Math3D::vector3 TSegment::GetPoint(double const fDistance) const
|
||||
|
||||
glm::dvec3 TSegment::stray( glm::dvec3 const &Point, track_uneven::amounts const &Amount, double const Distance ) const {
|
||||
auto const field { track_uneven::field( Point ) };
|
||||
glm::dvec3 result { field.x * Amount.side, field.y * Amount.up, field.z * Amount.side };
|
||||
result *= track_uneven::stray_per_mm;
|
||||
glm::dvec3 result {
|
||||
field.x * Amount.side * track_uneven::stray_side_per_mm,
|
||||
field.y * Amount.up * track_uneven::stray_up_per_mm,
|
||||
field.z * Amount.side * track_uneven::stray_side_per_mm };
|
||||
result.y -= pOwner->joint_dip( Distance );
|
||||
return result;
|
||||
}
|
||||
@@ -469,7 +471,7 @@ void TSegment::settle_vertex( gfx::basic_vertex &Vertex, glm::dvec3 const &Origi
|
||||
return;
|
||||
}
|
||||
auto const amount { pOwner->uneven_at( Distance, m_setting.path ) };
|
||||
Vertex.position.y -= static_cast<float>( share * track_uneven::stray_per_mm * amount.cross * track_uneven::level( Origin + glm::dvec3 { Position }, glm::dvec3 { Parallel } ) * across / gauge );
|
||||
Vertex.position.y -= static_cast<float>( share * track_uneven::stray_up_per_mm * amount.cross * track_uneven::level( Origin + glm::dvec3 { Position }, glm::dvec3 { Parallel } ) * across / gauge );
|
||||
Vertex.position += glm::vec3 { share * stray( Origin + glm::dvec3 { Vertex.position }, amount, Distance ) };
|
||||
}
|
||||
|
||||
@@ -507,7 +509,7 @@ void TSegment::RaPositionGet(double const fDistance, glm::dvec3 &position, glm::
|
||||
auto const gauge { std::max( std::abs( pOwner->fTrackWidth ), 0.1f ) };
|
||||
glm::dvec3 const across { -std::cos( rotation.z ), 0.0, -std::sin( rotation.z ) };
|
||||
auto const amount { pOwner->uneven_at( fDistance, m_setting.path ) };
|
||||
rotation.x += static_cast<float>( track_uneven::stray_per_mm * (
|
||||
rotation.x += static_cast<float>( track_uneven::stray_up_per_mm * (
|
||||
amount.up * track_uneven::roll( position, across, gauge )
|
||||
+ amount.cross * track_uneven::level( position, across ) / gauge ) );
|
||||
position += track_uneven::across_only( stray( position, amount, fDistance ), across );
|
||||
|
||||
@@ -20,13 +20,16 @@ http://mozilla.org/MPL/2.0/.
|
||||
#include <glm/gtc/constants.hpp>
|
||||
|
||||
// Track unevenness: a displacement field over the plan of the scenery, so everything at one place moves together: joined tracks, the
|
||||
// paths of a switch, sleepers, axles. Waves 5-42 m long, shares after the German track spectrum with the long waves cut down; up and down to 83 m.
|
||||
// The "uneven" value is the peak deviation of a rail on a 10 m chord, as in PLK Id-14 appendix 1; see test_track_uneven.cpp.
|
||||
// paths of a switch, sleepers, axles. Waves 7-90 m long sideways and 8-110 m up and down, about the bands D1-D3 of EN 13848. Their amplitudes
|
||||
// follow the shape of the track spectra of FRA and ORE B176, S ~ Wc^2 / (W^2 (W^2 + Wc^2)) with Wc = 0.8245 rad/m: the longer a wave, the
|
||||
// higher it is. The "uneven" value only sets the scale: the peak deviation of a rail on a 10 m chord, as PLK Id-14 appendix 1 measures it;
|
||||
// see test_track_uneven.cpp.
|
||||
namespace track_uneven {
|
||||
|
||||
inline constexpr float most { 100.f }; // largest value of the attributes, mm
|
||||
inline constexpr double stray_per_mm { 0.00145 }; // field amplitude per mm of "uneven", m
|
||||
inline constexpr double cross_share { 0.53 }; // share of the field amplitude the rails settle apart by
|
||||
inline constexpr double stray_up_per_mm { 0.00229 }; // amplitude of the field up and down per mm of "uneven", m
|
||||
inline constexpr double stray_side_per_mm { 0.0031 }; // amplitude of the field sideways per mm of "uneven", m
|
||||
inline constexpr double cross_share { 0.35 }; // share of the vertical amplitude the rails settle apart by
|
||||
inline constexpr double fade { 20.0 }; // length over which a track goes from the value at its end to its own, m
|
||||
inline constexpr double dip_share { 0.4 }; // joint dip depth per mm of "uneven", mm
|
||||
inline constexpr double dip_reach { 3.0 }; // reach of the dip on each side of a joint, m
|
||||
@@ -182,12 +185,12 @@ wave_set<Count> make_waves( double const Turn, std::array<double, Count> const &
|
||||
return result;
|
||||
}
|
||||
|
||||
inline constexpr std::array<double, 8> wave_lengths { 5.3, 7.1, 9.7, 13.1, 17.9, 23.9, 31.7, 41.9 };
|
||||
inline constexpr std::array<double, 8> wave_shares { 0.0721, 0.0997, 0.1344, 0.1703, 0.1549, 0.1386, 0.1226, 0.1074 };
|
||||
// each wave stands for a band of the spectrum, the lengths in a constant ratio, so its share goes as the square root of S(W) * W
|
||||
inline constexpr std::array<double, 8> wave_lengths { 7.0, 10.1, 14.5, 20.9, 30.1, 43.4, 62.5, 90.0 };
|
||||
inline constexpr std::array<double, 8> wave_shares { 0.0435, 0.0617, 0.082, 0.1045, 0.1294, 0.1579, 0.1909, 0.23 };
|
||||
|
||||
// fewer short ones than sideways: the rails come near the limit in the vertical more often, with the peak still at it.
|
||||
// The long ones hardly count on the 10 m chord: the body rises and falls on them, slowly enough for a pantograph to keep up
|
||||
inline wave_set<8> const up_waves { make_waves<8>( 0.0, { 8.3, 11.9, 16.7, 23.9, 37.1, 47.3, 61.9, 83.3 }, { 0.14, 0.19, 0.22, 0.22, 0.23, 0.23, 0.23, 0.23 } ) };
|
||||
// the same shape. The long ones hardly count on the 10 m chord and the cab hardly feels them: the body rises and falls on them
|
||||
inline wave_set<8> const up_waves { make_waves<8>( 0.0, { 8.0, 11.6, 16.9, 24.6, 35.8, 52.0, 75.6, 110.0 }, { 0.0761, 0.1058, 0.1393, 0.176, 0.2175, 0.2651, 0.3215, 0.3887 } ) };
|
||||
inline wave_set<8> const x_waves { make_waves( 1.1, wave_lengths, wave_shares ) };
|
||||
inline wave_set<8> const z_waves { make_waves( 2.3, wave_lengths, wave_shares ) };
|
||||
// the tilt along each axis of the plan. Long waves only: with the short ones the cross level reaching its limit would break the limit of twist
|
||||
|
||||
Reference in New Issue
Block a user