Solve_ivp 使用 sequence.The 请求数组设置数组元素具有不均匀形状 after1dimensions.Thedetected 形状为 (4,)+不均匀

Solve_ivp setting an array element with a sequence.The requested array has a inhomogen shape after1dimensions.Thedetected shape was(4,)+inhomogeneous

我对 4 个 ODE 方程组使用 solve_ivp,但它给了我这个错误。可能是因为我需要的 solve_ivp 中的 y0 是 4 项(初始值:x0,y0,w0,z0),我像数组一样输入它。如何在求解器中输入这些初始值?如果我尝试像列表一样放置会发生相同的错误。 我写了一个我的代码示例(太长了,写不完)

def funct(iv,t):
    a=iv[0]
    b=iv[1]
    c=iv[2]
    c=iv[3]
    # ODE
    dxdt=...
    dydt=...
    dwdt=...
    dzdt=...
    ODES=[dxdt,dydt,dwdt,dzdt]
    return ODES
x0=1
y0=2
w0=3 
z0=4 
initial_values=np.array([x0,y0,w0,z0]) #*******
t_s = np.linspace(0,100,1001)
#Integración del modelo
inputs = (D,E,F,G,H,J,K)
solut = odeint(funct, initial_values, t_s)


 

根据文档:https://docs.scipy.org/doc/scipy/reference/generated/scipy.integrate.solve_ivp.html

solut = solve_ivp(funct, t_s, initial_values)

这是正确的顺序。