@sh.add_function(
dsp, outputs=['service_battery_electric_powers_supply_threshold']
)
def define_service_battery_electric_powers_supply_threshold(
service_battery_capacity, service_battery_nominal_voltage):
"""
Identifies the service battery electric powers supply threshold [kW] that
define when the the service battery is not charging.
:param service_battery_capacity:
Service battery capacity [Ah].
:type service_battery_capacity: float
:param service_battery_nominal_voltage:
Service battery nominal voltage [V].
:type service_battery_nominal_voltage: float
:return:
Service battery not charging power threshold [kW].
:rtype: float
"""
d = dfl.functions.define_service_battery_electric_powers_supply_threshold
c = max(-service_battery_capacity * 36 * d.min_soc, d.min_current)
return c * service_battery_nominal_voltage / 1e3