# Track variables within DifferentialEquations.jl function

**URL:** <https://discourse.julialang.org/t/track-variables-within-differentialequations-jl-function/35777>\
**Category:** New to Julia\
**Created:** [March 9, 2020, 10:57pm UTC](https://discourse.julialang.org/t/track-variables-within-differentialequations-jl-function/35777 "2020-03-09T22:57:40Z")\
**Posts on this page:** 3\
**Page:** 2

<div class="post-metadata">

**Author:** ![t-anton](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/t-anton/32/38981_2.png) [@t-anton](https://discourse.julialang.org/u/t-anton)\
**Post date:** [August 21, 2022, 1:02pm UTC](https://discourse.julialang.org/t/track-variables-within-differentialequations-jl-function/35777/21 "2022-08-21T13:02:59Z")

</div>

Hi @ChrisRackauckas, I am translating an R package into Julia. The R package uses lsoda, and after I applied @erlebach approach, I’ve got “LSODA is not compatible with callbacks.”

**BTW, is there an elegant example of how to track variables within DifferentialEquations.jl with “saveat” and events?** For example, in my package, I need to show all variables (with states) at each time step as an output.

---

<div class="post-metadata">

**Author:** ![ChrisRackauckas](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/chrisrackauckas/32/77_2.png) [@ChrisRackauckas](https://discourse.julialang.org/u/ChrisRackauckas)\
**Post date:** [August 21, 2022, 2:04pm UTC](https://discourse.julialang.org/t/track-variables-within-differentialequations-jl-function/35777/22 "2022-08-21T14:04:27Z")

</div>

> [@t-anton](#):
>
> The R package uses lsoda, and after I applied @erlebach approach, I’ve got “LSODA is not compatible with callbacks.”

Just don’t use LSODA? The error message is saying you should use a more capable solver, like TRBDF2 or Rodas5 or etc.

> [@t-anton](#):
>
> **BTW, is there an elegant example of how to track variables within DifferentialEquations.jl with “saveat” and events?** For example, in my package, I need to show all variables (with states) at each time step as an output.

The tutorials on events show saving whatever’s needed.

I would need a more concrete question in order to give more concrete help. And it would be better if these questions were in their own thread.

---

<div class="post-metadata">

**Author:** ![t-anton](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/t-anton/32/38981_2.png) [@t-anton](https://discourse.julialang.org/u/t-anton)\
**Post date:** [August 21, 2022, 7:19pm UTC](https://discourse.julialang.org/t/track-variables-within-differentialequations-jl-function/35777/24 "2022-08-21T19:19:14Z")

</div>

Thanks for a quick answer. I posted a question as a new thread.

[Previous page](https://discourse.julialang.org/t/track-variables-within-differentialequations-jl-function/35777.md?page=1)
