我正在尝试使用scipy odeint解决ODE(dx ^ 2 / dt ^ 2 = -4(x ^ 2 + y ^ 2)^(3/2)),但是我无法使其正常工作。这是我的代码:
import numpy as np
from scipy.integrate import odeint
def system(x,t,y):
x1 = x[0]
x2 = x[1]
y1 = y
dx1_dt = x2
dx2_dt = -4*(x1**2+y1**2)**(3/2)
dx_dt = [dx1_dt,dx2_dt]
return dx_dt
x_0 = [2,3]
y_0 = [8,6]
t = np.linspace(0,1,30)
x_solved = odeint(system,x_0,args=(y_0[0]))
我收到此错误:
odepack.error: Extra arguments must be in a tuple
但是我将额外的参数作为元组传递:args=(y_0[0])
。我究竟做错了什么?谢谢!