Compute the max acceleration that a vehicle could possibly achieve?

Hi, I’m hoping to compute a safe longitudinal distance between vehicles, for which I need to compute the max acceleration first.
This maximum possible acceleration of a vehicle should be based on the vehicle’s physical capabilities (like RPM), not just what the vehicle shows in its current movement.
However, I don’t think the “get max acceleration” function works for this case. Is there a more accurate way?
Thanks!