我正在尝试使用 SciPy 模拟一些动态模型。
我有模型定义:
def model(y, t, control_signal):
dy/dt = some_function_of_time_and_y
return dy
我定义了要模拟模型的时间戳列表:。我想使用为每个时间戳定义的值来模拟模型。我试图通过使用:t_list=np.linspace(0, 5, 100)control_signal
controls = [list_of_values]
scipy.integrate.odeint(model, 0, t_list, args=(controls))
但是我得到的似乎是我的被解释为模型的状态,而不是每个时间戳中的输入。如何为每个时间戳传递值?The size of the array returned by func (5) does not match the size of y0 (1).controlscontrols
谢谢!
一只名叫tom的猫
相关分类