@sh.add_function(dsp, outputs=['r_dynamic'], weight=13)
def identify_r_dynamic_v4(
times, velocities, accelerations, r_wheels, engine_speeds_out,
gear_box_ratios, final_drive_ratios, idle_engine_speed, stop_velocity,
plateau_acceleration, change_gear_window_width, on_engine):
"""
Identifies the dynamic radius of the wheels [m].
:param times:
Time vector [s].
:type times: numpy.array
:param velocities:
Vehicle velocity [km/h].
:type velocities: numpy.array
:param accelerations:
Vehicle acceleration [m/s2].
:type accelerations: numpy.array
:param r_wheels:
Radius of the wheels [m].
:type r_wheels: float
:param engine_speeds_out:
Engine speed [RPM].
:type engine_speeds_out: numpy.array
:param gear_box_ratios:
Gear box ratios [-].
:type gear_box_ratios: dict[int, float | int]
:param final_drive_ratios:
Final drive ratios [-].
:type final_drive_ratios: dict[int, float | int]
:param idle_engine_speed:
Engine speed idle median and std [RPM].
:type idle_engine_speed: (float, float)
:param stop_velocity:
Maximum velocity to consider the vehicle stopped [km/h].
:type stop_velocity: float
:param plateau_acceleration:
Maximum acceleration to be at constant velocity [m/s2].
:type plateau_acceleration: float
:param change_gear_window_width:
Time window used to apply gear change filters [s].
:type change_gear_window_width: float
:param on_engine:
If the engine is on [-].
:type on_engine: numpy.array
:return:
Dynamic radius of the wheels [m].
:rtype: float
"""
return identify_r_dynamic_v3(
times[on_engine], velocities[on_engine], accelerations[on_engine],
r_wheels, engine_speeds_out[on_engine], gear_box_ratios,
final_drive_ratios, idle_engine_speed, stop_velocity,
plateau_acceleration, change_gear_window_width
)