python-3.x - 如何处理 scipy odeint 中的无限导数?
问题描述
我有一个耦合 ODE 系统,我试图使用scipy.integrate.odeint
. 但是,每次我运行时odeint
,我都会收到错误消息
lsoda-- at t(=r1) and step size h(=r2), the error
test failed repeatedly or with abs(h) = hmin
in above, r1 = 0.2351321589734D+00 r2 = 0.1000000000000D-05
ODEintWarning: Repeated error test failures (internal error). Run with full_output = 1 to get quantitative information.
warnings.warn(warning_msg, ODEintWarning)
我很确定我知道这其中的原因。在错误发生的地方,我的一个导数的值变为无穷大。但是,这在我试图解决的问题中是不可避免的。我想知道是否有办法让 odeint 在达到这个无穷大时以更文明的方式表现,而不是仅仅拒绝工作并产生无意义的输出(如图所示)scipy getting wrong。
提前干杯!
解决方案
推荐阅读
- xml - 如何在 xslt 文件中使用外部 xml 架构?
- ios - 从 viewDidDisappear 但不是从按钮 Swift 4 调用函数时出现 Fond nil 错误
- flutter - 如何使用流畅的动画从页面视图中删除页面?
- ios - Swift 4:点击具有单独类的单元格时的新视图控制器
- javascript - 如何在 App.js 中使用 navigation.js 在 react native
- xml - 如何在 XML Schema 中声明一个引用元素的必需属性?
- python - python中的简单函数队列
- javascript - 安全地将混合型铸造成合适的流动型
- html - 谷歌招聘信息的实施
- html - 调整大小时保持图像对齐