如何在scipy积分器“dopri5”中确定步长和步数?

2024-09-30 16:24:29 发布

您现在位置:Python中文网/ 问答频道 /正文

我已经用python编写了使用scipy integrator dopri5求解微分方程的代码。我经常在集成失败时出错。然后,我试图改变步数,但我再次得到的错误,步长变得太小。当我设置nsteps=1时,错误显示需要更多的步骤。 我不知道我错在哪里?如何解决这个问题?你知道吗

Warning (from warnings module):
self.messages.get(istate, unexpected_istate_msg)))
UserWarning: dopri5: step size becomes too small
state = ODE.integrate(0.0001)
File "/home/.local/lib/python3.6/site-packages/jitcode/_jitcode.py", line 644, in integrate
 return self.integrator.integrate(*args,**kwargs)
 packages/jitcode/integrator_tools.py", line 143, in integrate
    raise UnsuccessfulIntegration
jitcode.integrator_tools.UnsuccessfulIntegration

Tags: 代码inpyselfpackages错误lineintegrator