Returns the maximum profile velocity at displacement s using ds and lastVel.
the current displacement
the change in displacement from the last profile velocity
the last profile velocity