Tanavit: 1
Proposal for an other train acceleration calculation : NOT to be included in "doc" branch without discussion
1 files changed, 32 insertions(+), 2 deletions(-)
orwell <orwell@bleipb.de> writes:
Hello
Sorry for this very late answer : I did not receive your comments in my
mailbox and just discover it.
Three months ago Orwell wrote :
> It also means that I am unwilling to change the movement logic at
this time, unless there is a real benefit in doing so.
I agree with your schema of speed and position calculation although I
think that using the position calculation derived from uniform acceleration
(https://en.wikipedia.org/wiki/Equations_of_motion#Constant_translational_acceleration_in_a_straight_line)
would provide a better result : in case of important acceleration the
a/2*t^2 term could be significant.
And you could always approximate a non uniformly accelerated motion as
the sum of a lot of small uniformly accelerated motion with a variable
acceleration.
What could be discussed is the value of dt and the value of the
{ac,de}celeration.
> What we can talk about is step 2, the calculation of a. Especially
for braking it is pretty unrealistic, since all wagons are assumed to
have the same weight (1) and the same braking capability (-3m/s²).
I guess this is not so far from real trains : I am pretty sure the
brakes are designed to stop the wagon on which they are put on the same
distance whatever is the wagon. Big and heavy wagon have big brakes and
small one have small brakes. If not designed such, some wagons would
stop before the other ones : brakes and couplings would be unnecessarily
stressed.
> The weight and acceleration/braking capabilities should be settable
for each wagon type, and for freight wagons the weight may even scale
with load.
It looks me an unnecessary complication : if you calculate a
decelaration for each wagon in a train, how will you calculate the whole
train deceleration ? You can not apply a different deceleration to each
wagon as this would dismantle the train.
This is true. Let me clarify what I meant by this:
According to Newton, F = m * a -> a = F / m. Obviously we cannot calculate plain acceleration for each wagon, instead we have to calculate and add up (1) the acceleration/brake force and (2) the mass of each wagon. In the end we have a = sum(F_i) / sum(m_i) for each wagon i.
Currently, the mass m of each wagon always equals 1 kg. For acceleration, each engine applies a force of 1.5 m/kg*s^2. For braking, each engine applies a force of -3 m/kg*s^2, thus resulting in an uniform deceleration of the train with -3 m/s^2.
See for reference http://git.bananach.space/advtrains.git/tree/advtrains/trainlogic.lua#n211
In the current implementation, the "braking curve" for LZB is determined for a hypothetical deceleration of -2 m/s^2, so that it is always a little above the actual braking capability of the train.
If I understand correctly, this is what you want to change to have more realistic acceleration and braking dynamics. I agree with you in this regard. We'd need a solid proposal how this should look like.
As long as we don't touch the actual LZB logic, I am fine with reworking the train acceleration and braking curves. We just need to ensure that LZB is provided with a realistic braking curve, and we need not change the core movement code.
Regards,
orwell
I don't exactly know trains drivers use brakes but I guess it is not
very different from braking a car : I adjust braking to stop where I
intend to.
My proposition aims to adjust the positive or negative acceleration from
the actual speed and the remaining distance to reach the expected speed
(which may be zero to stop or the max speed to run).
From what I understood, it does not change the way the speed and the
position are presently calculated.
Sincerely yours.
Hi Tanavit,
Am 09.04.22 um 20:39 schrieb Tanavit: