0

I have a system of coupled ODEs that I'm trying to solve as an initial value problem using scipy.integrate.odeint. However, every time I run odeint, I get the error

 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)

I'm pretty sure I know the reason for this. The value of one of my derivatives goes to infinity at the point where the error is coming about. However, this is unavoidable in the problem I'm trying to solve. I am wondering if there is a way to make odeint behave in a more civilised way when it gets to this infinity rather than just refusing to work and producing a nonsense output (shown in the picture) scipy getting upset.

Cheers in advance!

mgmf46
  • 145
  • 1
  • 1
  • 10
  • Could you show the coupled ODE? My guess is that you'll have some kind of analysis of the expected behaviour of your system around the divergence to mitigate your issue. scipy can't really with this automatically. – Joey Dumont Feb 08 '20 at 05:26
  • Hi Joey, thank you so much for your advice. The trouble is, the equations are sort of beyond horrible, so I don't particularly want to have to analyse them directly. If Scipy can't really help with this, then I'll have to try elsewhere - thank you for your advice! – mgmf46 Feb 12 '20 at 09:36

0 Answers0