你好,我正在尝试用我的代码实现euler显式方法。 这是我的两个微分方程。 -dSdt=psS(1-((R+S)/K))-(C*S) -dRdt=prR(1-((R+S)/K))-(βSR)
如何显示曲线
谢谢你的回答
h = 0.5
t = np.linspace(0, 35, 35)
def S(t):
if(t <= 0):
return S0
else:
return funcS(t - h) + h * ps*funcS(t - h)*(1-((funcR(t - h) + funcS(t - h))/K)) - (C * funcS(t - h))
def R(t):
if(t == 0):
return R0
else:
return pr*funcR(t - h)*(1-((funcR(t - h) + funcS(t - h))/K)) - (beta*funcS(t - h)*funcR(t - h))
使用matplotlib尝试以下操作:
相关问题 更多 >
编程相关推荐