@sh.add_function(dsp, outputs=['gears'], weight=sh.inf(1, 0), inputs=[
'correct_gear', 'MGS', 'times', 'velocities', 'accelerations',
'motive_powers'
])
def prediction_gears_gsm_v1(
correct_gear, gsm, times, velocities, accelerations, motive_powers):
"""
Predicts gears with a gear shifting model (mgs) [-].
:param correct_gear:
A function to correct the gear predicted.
:type correct_gear: callable
:param gsm:
A gear shifting model (cmv or gspv or dtgs).
:type gsm: MSG
: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 motive_powers:
Motive power [kW].
:type motive_powers: numpy.array
:return:
Predicted gears.
:rtype: numpy.array
"""
gears = gsm.predict(
times, velocities, accelerations, motive_powers,
correct_gear=correct_gear
)
return gears