How to get additional information from "scipy.integrate.ode" solvers?

Asked

Viewed 28 times

2

I am comparing different solvers ( dopri5, dop853, Vode, etc) of "scipy.integrate.ode" and I would like to know if there is any way to get information such as: number of iterations, number of steps used, simulation time, ...

I know how to get this kind of information in "scipy.integrate.odeint" using, for example, "infodict". However, I have found no way to do this for the other solvers I am testing. By the way, to find out the necessary time, I’m using "time.clock()" as below (I don’t know if there’s a better way to do this) :

time_start_RK4 = time.clock()                       

solver = ode(reactor_ode)
solver.set_integrator('dopri5')
solver.set_initial_value(Initial_conditions, t0)


solution_RK4 = np.empty((Nt, 8*N))
solution_RK4[0, :] = Initial_conditions
k = 1


while solver.successful() and solver.t < tf:
   solver.integrate(t[k])
   solution_RK4[k] = solver.y
   k += 1

time_elapsed_RK4 = (time.clock() - time_start_RK4)  

print(time_elapsed_RK4, 's')

Thank you very much in advance!

No answers

Browser other questions tagged

You are not signed in. Login or sign up in order to post.