@sh.add_function(dsp, outputs=['motors_maximums_powers'])
def define_motors_maximums_powers(
motor_p4_front_maximum_powers, motor_p4_rear_maximum_powers,
motor_p3_front_maximum_powers, motor_p3_rear_maximum_powers,
motor_p2_maximum_powers, engine_speeds_parallel, final_drive_speeds_in,
motor_p2_planetary_maximum_power_function, planetary_ratio,
motor_p2_planetary_speed_ratio, motor_p1_maximum_power_function,
motor_p1_speed_ratio, motor_p0_maximum_power_function,
motor_p0_speed_ratio):
"""
Defines maximum powers of electric motors [kW].
:param motor_p4_front_maximum_powers:
Maximum power vector of motor P4 front [kW].
:type motor_p4_front_maximum_powers: numpy.array
:param motor_p4_rear_maximum_powers:
Maximum power vector of motor P4 rear [kW].
:type motor_p4_rear_maximum_powers: numpy.array
:param motor_p3_front_maximum_powers:
Maximum power vector of motor P3 front [kW].
:type motor_p3_front_maximum_powers: numpy.array
:param motor_p3_rear_maximum_powers:
Maximum power vector of motor P3 rear [kW].
:type motor_p3_rear_maximum_powers: numpy.array
:param motor_p2_maximum_powers:
Maximum power vector of motor P2 [kW].
:type motor_p2_maximum_powers: numpy.array
:param engine_speeds_parallel:
Hypothetical engine speed in parallel mode [RPM].
:type engine_speeds_parallel: numpy.array
:param final_drive_speeds_in:
Final drive speed in [RPM].
:type final_drive_speeds_in: numpy.array
:param motor_p2_planetary_maximum_power_function:
Maximum power function of planetary motor P2.
:type motor_p2_planetary_maximum_power_function: function
:param planetary_ratio:
Fundamental planetary speed ratio [-].
:type planetary_ratio: float
:param motor_p2_planetary_speed_ratio:
Ratio between planetary motor P2 speed and planetary speed [-].
:type motor_p2_planetary_speed_ratio: float
:param motor_p1_maximum_power_function:
Maximum power function of motor P1.
:type motor_p1_maximum_power_function: function
:param motor_p1_speed_ratio:
Ratio between motor P1 speed and engine speed [-].
:type motor_p1_speed_ratio: float
:param motor_p0_maximum_power_function:
Maximum power function of motor P0.
:type motor_p0_maximum_power_function: function
:param motor_p0_speed_ratio:
Ratio between motor P0 speed and engine speed [-].
:type motor_p0_speed_ratio: float
:return:
Maximum powers of electric motors [kW].
:rtype: numpy.array
"""
es, p2_powers = engine_speeds_parallel, motor_p2_maximum_powers
planet_f = motor_p2_planetary_maximum_power_function
from ..electrics.motors.planet import calculate_planetary_speeds_in as func
ps = func(es, final_drive_speeds_in, planetary_ratio)
return np.column_stack((
motor_p4_front_maximum_powers, motor_p4_rear_maximum_powers,
motor_p3_front_maximum_powers, motor_p3_rear_maximum_powers, p2_powers,
planet_f(ps * motor_p2_planetary_speed_ratio),
motor_p1_maximum_power_function(es * motor_p1_speed_ratio),
motor_p0_maximum_power_function(es * motor_p0_speed_ratio)
))