@sh.add_function(dsp, outputs=['drive_battery_model'])
def calibrate_drive_battery_model(
service_battery_model, initial_drive_battery_state_of_charge,
drive_battery_capacity, drive_battery_n_parallel_cells,
drive_battery_n_series_cells, drive_battery_currents,
dcdc_converter_efficiency, drive_battery_load, drive_battery_voltages):
"""
Calibrate the drive battery current model.
:param service_battery_model:
Service battery model.
:type service_battery_model: ServiceBatteryModel
:param initial_drive_battery_state_of_charge:
Initial state of charge of the drive battery [%].
:type initial_drive_battery_state_of_charge: float
:param drive_battery_capacity:
Drive battery capacity [Ah].
:type drive_battery_capacity: float
:param drive_battery_n_parallel_cells:
Number of battery cells in parallel [-].
:type drive_battery_n_parallel_cells: int
:param drive_battery_n_series_cells:
Number of battery cells in series [-].
:type drive_battery_n_series_cells: int
:param drive_battery_currents:
Drive battery current vector [A].
:type drive_battery_currents: numpy.array
:param dcdc_converter_efficiency:
DC/DC converter efficiency [-].
:type dcdc_converter_efficiency: float
:param drive_battery_load:
Drive electric load [kW].
:type drive_battery_load: float
:param drive_battery_voltages:
Drive battery voltage [V].
:type drive_battery_voltages: numpy.array
:return:
Drive battery current model.
:rtype: DriveBatteryModel
"""
return DriveBatteryModel(
service_battery_model, drive_battery_load,
initial_drive_battery_state_of_charge, drive_battery_capacity,
dcdc_converter_efficiency,
n_parallel_cells=drive_battery_n_parallel_cells,
n_series_cells=drive_battery_n_series_cells
).fit(drive_battery_currents, drive_battery_voltages)