DifferentialEquations.jl icon indicating copy to clipboard operation
DifferentialEquations.jl copied to clipboard

Allow symbolic indices to be passed to the `save_idxs` kwarg of `solve`

Open jonathanfischer97 opened this issue 8 months ago • 1 comments

Can't use symbolic indices to parameterize solve(;save_idxs = ...)

  • Often I want to just save an observed variable when solving an ODEProblem, to save on memory during large batch solves.
  • Currently that isn't possible because the observed variable is rightfully not included within u, but computed lazily via the solution.
    • Resorted to defining my own tedious save_func(u, t, integrator) callback, forcing me to redefine my observable equations in terms of u[idx].
  • If I still want to symbolically index the ODESolution for my observed variable, I have to save all of the variables during solve, which is a lot of waste for larger systems.

Would be nice to be able to pass in symbols to solve to be saved, like solve(odeprob, alg; save_idxs = [:obs, ...]

Basically, I'd like solve to handle symbolic indices from an ODESystem just like remake and solution indexing already do.

jonathanfischer97 avatar Jun 06 '24 20:06 jonathanfischer97