有人能给我一些建议吗,如何在Python中解决一个带有时间延迟的常微分方程(ODE)?使用scipy.integrate.odeint似乎无法实现。我正在寻找的应该类似于:
# the constants in the equation
b = 1/50
d = 1/75
a = 0.8
G = 10 ** (-2)
tau = 0.5
u = [b, d, tau, a, G]
# enter initial conditions
N0 = 0.1
No0 = 10
w = [N0, No0]
def logistic(w, t, u):
N, No = w
b, d, tau, a, G = u
dNdt = b * (No(t) - N(t) ) * (N(t) / No(t) ) - d * N(t - tau)
dNodt = G * (a * No(t) - N(t) ) * (N(t) / No(t) )
return [dNdt, dNodt]
# create timescale
# create timescale
stoptime = 1000.0
numpoints = 10000
t = np.linspace(0, stoptime, numpoints)
# in my previous code I would use scipy.integrate.odeint here to integrate my
# equations, but with a time-delay that doesn't work (I think)
soln = ...
N(t)、N(t-tau)等是函数的时间参数。是否存在解决这些类型方程的好库?非常感谢!