Trax3 3.1.0
trax track library
Loading...
Searching...
No Matches
TractionForceCharacteristic.h
1// trax track library
2// AD 2014
3//
4// "It's all over and I'm standin' pretty
5// In this dust that was a city."
6//
7// Nena
8//
9// Copyright (c) 2025 Trend Redaktions- und Verlagsgesellschaft mbH
10// Copyright (c) 2019 Marc-Michael Horstmann
11//
12// Permission is hereby granted to any person obtaining a copy of this software
13// and associated source code (the "Software"), to use, view, and study the
14// Software for personal or internal business purposes, subject to the following
15// conditions:
16//
17// 1. Redistribution, modification, sublicensing, or commercial use of the
18// Software is NOT permitted without prior written consent from the copyright
19// holder.
20//
21// 2. The Software is provided "AS IS", without warranty of any kind, express
22// or implied.
23//
24// 3. All copies of the Software must retain this license notice.
25//
26// For further information, please contact: horstmann.marc@trendverlag.de
27
28#pragma once
29
30#include "trax/Configuration.h"
31#include "trax/Units.h"
32
33namespace trax{
34
35
59 struct TractionForceCharacteristic{
60
62 enum class TractionType : char{
63 unknown = 0,
68 speedsteps,
69 other,
70 };
71
72 static dclspc std::unique_ptr<TractionForceCharacteristic> Make( TractionType type = TractionType::speedsteps, Velocity vmax = 0_mIs, Velocity vtransit = 0_mIs ) noexcept;
73
74 virtual TractionType GetTractionType() const noexcept = 0;
75
86 virtual One operator()( Velocity velocity ) const noexcept = 0;
87
88
92 virtual decltype(Power{}/Force{}) MaximumPowerFraction() const noexcept = 0;
93
94
97 virtual Velocity MaximumVelocity() const noexcept = 0;
98
99
101 virtual void AddSpeedStep( Velocity velocity, One value ) = 0;
102
103
105 virtual void GetSpeedSteps( std::vector<std::pair<Velocity,One>>& speedsteps ) const = 0;
106
107 virtual ~TractionForceCharacteristic() = default;
108 TractionForceCharacteristic( const TractionForceCharacteristic& ) = delete;
109 TractionForceCharacteristic( TractionForceCharacteristic&& ) = delete;
110 TractionForceCharacteristic& operator=( const TractionForceCharacteristic& ) = delete;
111 TractionForceCharacteristic& operator=( TractionForceCharacteristic&& ) = delete;
112 protected:
113 TractionForceCharacteristic() = default;
114 };
115
116}
Value< Dimension< 1, 0, -1 > > Velocity
Velocity.
Definition DimensionedValues.h:331
Value< Dimension< 0, 0, 0 > > One
Dimensionless value.
Definition DimensionedValues.h:319
Value< Dimension< 1, 1, -2 > > Force
Force.
Definition DimensionedValues.h:333
Value< Dimension< 2, 1, -3 > > Power
Power.
Definition DimensionedValues.h:339
constexpr Real _mIs(Velocity v) noexcept
Dimensionated Values conversion functions.
Definition DimensionedValues.h:1395
STL namespace.
Namespace of all the trax track libraries classes and methods.
Definition Collection.h:17
TractionType
Some exemplaric traction types.
Definition TractionForceCharacteristic.h:62
@ steam
hyperbolic decline from the start
Definition TractionForceCharacteristic.h:67
@ hydrodynamic
continuous linear gear settings
Definition TractionForceCharacteristic.h:65
@ electric
constant traction force followed by hyperbolic decline
Definition TractionForceCharacteristic.h:66
@ mechanic
mechanical gear with different discrete gear settings
Definition TractionForceCharacteristic.h:64
virtual Velocity MaximumVelocity() const noexcept=0
virtual void AddSpeedStep(Velocity velocity, One value)=0
Add a velocity/value pair to the characteristic.
virtual decltype(Power{}/Force{}) MaximumPowerFraction() const noexcept=0
virtual void GetSpeedSteps(std::vector< std::pair< Velocity, One > > &speedsteps) const =0
Get all the speedsteps.