@sh.add_function(dsp, outputs=['motor_p2_planetary_maximum_power_function'])
def define_motor_p2_planetary_maximum_power_function(
motor_p2_planetary_maximum_power, motor_p2_planetary_rated_speed):
"""
Define the maximum power function of planetary motor P2.
:param motor_p2_planetary_maximum_power:
Maximum power of planetary motor P2 [kW].
:type motor_p2_planetary_maximum_power: float
:param motor_p2_planetary_rated_speed:
Rated speed of planetary motor P2 [RPM].
:type motor_p2_planetary_rated_speed: float
:return:
Maximum power function of planetary motor P2.
:rtype: function
"""
from .p4 import define_motor_p4_maximum_power_function as f
func = f(motor_p2_planetary_maximum_power, motor_p2_planetary_rated_speed)
def _maximum_power_function(speeds):
return func(np.abs(speeds))
return _maximum_power_function