What is the difference between scipy.integrate.odeint and scipy.integrate.ode?

StackOverflow https://stackoverflow.com/questions/22850908

  •  27-06-2023
  •  | 
  •  

Вопрос

I have read the docs for these here, but it just states that odeint is "an integrator with a simpler interface based on lsoda from ODEPACK"

What is the actual difference? Under what circumstances is using one more appropriate than the other?

Это было полезно?

Решение

If you can solve your problem with odeint, I would recommend that. It is simply a function that integrates an ode using lsoda.

If you want a lot more options, ode is a class with many methods and solvers:

Другие советы

I was wondering about the same question, and I found later that there is an other API available in scipy.integrate. The method is clearly explained in the documentation.

It could interest people comparing odeint (odeintw for complex) and ode (complex_ode for complex).

It is called scipy.integrate.solve_ivp, available from scipy v1.0.0 : https://scipy.github.io/devdocs/generated/scipy.integrate.solve_ivp.html#scipy.integrate.solve_ivp In this solver, LSODA cant handle complex but BDF is faster in my case.

Лицензировано под: CC-BY-SA с атрибуция
Не связан с StackOverflow
scroll top