Internal working of scipy.integrate.ode

非 Y 不嫁゛ 提交于 2019-12-05 19:32:08

The message means that the method reached the number of steps specified by nsteps parameter. Since you asked about internals, I looked into the Fortran source, which offers this explanation:

-1 means an excessive amount of work (more than MXSTEP steps) was done on this call, before completing the requested task, but the integration was otherwise successful as far as T. (MXSTEP is an optional input and is normally 500.)

The conditional statement that brings up the error is this "GO TO 500".

According to LutzL, for your ODE the solver chooses step size 2e-4, which means 5000000 steps to integrate up to 1000. Your options are:

  • try such a large value of nsteps (which translates to MXSTEP in aforementioned Fortran routine)
  • reduce error tolerance
  • run a for loop, as you already do.
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!