@sh.add_function(
dsp, inputs=['times', 'has_motor_p4_front'],
outputs=['motor_p4_front_powers']
)
@sh.add_function(
dsp, inputs=['times', 'has_motor_p4_rear'], outputs=['motor_p4_rear_powers']
)
def default_motor_p4_powers(times, has_motor_p4):
"""
Return zero power if the vehicle has not a motor P4 [kW].
:param times:
Time vector [s].
:type times: numpy.array
:param has_motor_p4:
Has the vehicle a motor in P4?
:type has_motor_p4: bool
:return:
Power at motor P4 [kW].
:rtype: numpy.array
"""
if not has_motor_p4:
return np.zeros_like(times, float)
return sh.NONE