@sh.add_function(dsp, outputs=['engine_speed_at_max_velocity'])
def calculate_engine_speed_at_max_velocity(
r_dynamic, final_drive_ratios, last_gear_box_ratio, maximum_velocity):
"""
Calculates the maximum velocity from full load curve.
:param r_dynamic:
Dynamic radius of the wheels [m].
:type r_dynamic: float | numpy.array
:param final_drive_ratios:
Final drive ratios [-].
:type final_drive_ratios: dict[int, float | int]
:param last_gear_box_ratio:
Gear box ratio of the last gear [-].
:type last_gear_box_ratio: float | numpy.array
:param maximum_velocity:
Maximum velocity [km/h].
:type maximum_velocity: float | numpy.array
:return:
Engine speed at maximum velocity [RPM].
:return: float
"""
speed = last_gear_box_ratio / calculate_last_gear_box_ratio(
r_dynamic, final_drive_ratios, 1, maximum_velocity
)
return speed