@sh.add_function(dsp, outputs=[
'service_battery_charging_statuses', 'service_battery_initialization_time'
], weight=1)
def identify_service_battery_charging_statuses_and_initialization_time(
times, accelerations, on_engine, alternator_electric_powers,
dcdc_converter_electric_powers, motive_powers,
service_battery_electric_powers_supply_threshold,
service_battery_starts_windows, service_battery_state_of_charges):
"""
Identifies the service battery charging statuses [-] and its initialization
time delta [s].
:param times:
Time vector [s].
:type times: numpy.array
:param alternator_electric_powers:
Alternator electric power [kW].
:type alternator_electric_powers: numpy.array
:param dcdc_converter_electric_powers:
DC/DC converter electric power [kW].
:type dcdc_converter_electric_powers: numpy.array
:param motive_powers:
Motive power [kW].
:type motive_powers: numpy.array
:param on_engine:
If the engine is on [-].
:type on_engine: numpy.array
:param service_battery_electric_powers_supply_threshold:
Service battery not charging power threshold [kW].
:type service_battery_electric_powers_supply_threshold: float
:param service_battery_starts_windows:
Service battery starts windows [-].
:type service_battery_starts_windows: numpy.array
:param accelerations:
Acceleration [m/s2].
:type accelerations: numpy.array
:param service_battery_state_of_charges:
State of charge of the service battery [%].
:type service_battery_state_of_charges: numpy.array
:return:
Service battery charging statuses (0: Discharge, 1: Charging, 2: BERS,
3: Initialization) [-] and its initialization time delta [s].
:rtype: numpy.array, float
"""
statuses = identify_service_battery_charging_statuses(
times, alternator_electric_powers, dcdc_converter_electric_powers,
motive_powers, on_engine,
service_battery_electric_powers_supply_threshold,
service_battery_starts_windows, 0
)
initialization_time = identify_service_battery_initialization_time(
alternator_electric_powers, motive_powers, accelerations,
service_battery_state_of_charges, statuses, times,
service_battery_electric_powers_supply_threshold
)
_set_alt_init_status(times, initialization_time, statuses)
return statuses, initialization_time