@sh.add_function(dsp, outputs=['MVL'])
def calibrate_mvl(
gears, velocities, velocity_speed_ratios, idle_engine_speed,
stop_velocity):
"""
Calibrates the matrix velocity limits (upper and lower bound) [km/h].
:param gears:
Gear vector [-].
:type gears: numpy.array
:param velocities:
Vehicle velocity [km/h].
:type velocities: numpy.array
:param velocity_speed_ratios:
Constant velocity speed ratios of the gear box [km/(h*RPM)].
:type velocity_speed_ratios: dict[int | float]
:param idle_engine_speed:
Engine speed idle median and std [RPM].
:type idle_engine_speed: (float, float)
:param stop_velocity:
Maximum velocity to consider the vehicle stopped [km/h].
:type stop_velocity: float
:return:
Matrix velocity limits (upper and lower bound) [km/h].
:rtype: MVL
"""
mvl = MVL().fit(gears, velocities, velocity_speed_ratios, idle_engine_speed,
stop_velocity)
return mvl