@sh.add_function(dsp, outputs=['velocity_speed_ratios'])
def calculate_velocity_speed_ratios(speed_velocity_ratios):
"""
Calculates velocity speed (or speed velocity) ratios of the gear box
[km/(h*RPM) or h*RPM/km].
:param speed_velocity_ratios:
Constant speed velocity (or velocity speed) ratios of the gear box
[h*RPM/km or km/(h*RPM)].
:type speed_velocity_ratios: dict[int | float]
:return:
Constant velocity speed (or speed velocity) ratios of the gear box
[km/(h*RPM) or h*RPM/km].
:rtype: dict
"""
def _inverse(v):
if v <= 0:
return dfl.INF
elif v >= dfl.INF:
return 0.0
else:
return 1 / v
return {k: _inverse(v) for k, v in speed_velocity_ratios.items()}