Using results from ODEProblem while it is running

question
diffeq

#1

Hello all,

I’m currently studying the documentation of DifferentialEquations.jl and trying to port my older computational neuroscience codes for using it instead of my own, less elegant and performant, ODE solvers. While doing this, I stumbled upon the following question: is it possible to access and use the results returned from the solver as soon as the current step is returned (instead of waiting for the problem to finish)?

I’m looking for a way to e.g. plot in real-time the voltage levels of a simulated neuron, which seems like a simple enough task and one that’s probably trivial to do using already existing Julia packages but I can’t figure out how. Does it have to do anything with callbacks? Thanks in advance.

Cross-posted in https://stackoverflow.com/questions/48652964/using-results-from-odeproblem-while-it-is-running


#2

Answered on StackOverflow. Basically, the way to solve this is to use the integrator interface which allows you to control the building of the solution step-by-step, and this has an iterator interface that can be exploited to make it easier.


#3

Fantastic, thank you. This is exactly what I was looking for.