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?
The primary advantage is that solve_ivp offers several methods for solving differential equations whereas odeint is restricted to one. We get started by setting up our system of differential equations and some parameters of the simulation.
Computes the derivative of y at t. If the signature is callable(t, y, ...) , then the argument tfirst must be set True . Initial condition on y (can be a vector). A sequence of time points for which to solve for y.
The odeint (ordinary differential equation integration) library is a collection of advanced numerical algorithms to solve initial-value problems of ordinary differential equations. It is written in C++ using modern programming techniques to provide high generality at optimal performance.
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:
scipy.integrate.ode
scipy.integrate.ode.integrate
scipy.integrate.ode.set_f_params
scipy.integrate.ode.set_initial_value
scipy.integrate.ode.set_integrator
scipy.integrate.ode.set_jac_params
scipy.integrate.ode.set_solout
scipy.integrate.ode.successful
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With