0

我有一个耦合 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

提前干杯!

4

0 回答 0