Imagine the following scenario:
We have 2 carts moving alone a track, initially at x velocity. They are spaced apart by y metres and are both z length.
When a cart passes a pre-determined point on the track, it starts to decelerate down to another velocity. If the deceleration value is too high (i.e. the cart decelerates too quickly), a collision may occur as the back of the cart could still be before the deceleration point, thus causing the second cart to collide with it.
How could we determine the most appropriate decel rate which doesn't cause a collision?
I'm not on any maths or physics course, and in all likelihood (assuming I haven't massively over complicated this) I'm not going to be familiar with what's need to solve the problem. If somebody could point me in the right direction, in terms of equation, etc, that would be extremely helpful and allow me to do my own research.