# ModelingToolkit & DifferentialEquations -- \`save\_idxs\`?

**URL:** <https://discourse.julialang.org/t/modelingtoolkit-differentialequations-save-idxs/96709>\
**Category:** Modelling & Simulations\
**Created:** [March 28, 2023, 12:20pm UTC](https://discourse.julialang.org/t/modelingtoolkit-differentialequations-save-idxs/96709 "2023-03-28T12:20:07Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![BLI](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/bli/32/37206_2.png) [@BLI](https://discourse.julialang.org/u/BLI)\
**Post date:** [March 28, 2023, 12:20pm UTC](https://discourse.julialang.org/t/modelingtoolkit-differentialequations-save-idxs/96709/1 "2023-03-28T12:20:07Z")

</div>

Coding my own models using DifferentialEquations solvers, it is possible to specify keyword `save_idxs` to specify which variables are saved.

What if I write the model using MTK instead?

- Will `save_idxs` only work with a list of positive integers referring to the `states(sys)` vector of variables? Or…
- Is there a way to specify saving any variable, both `states` and `observed`? Or,
- Should this be done after computing the solution?

---

<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:** [March 28, 2023, 1:15pm UTC](https://discourse.julialang.org/t/modelingtoolkit-differentialequations-save-idxs/96709/2 "2023-03-28T13:15:41Z")

</div>

This is being worked on. You’ll see a few open unmerged PRs in SciMLBase and ModelingToolkit.jl on it. Basically, it should be solved rather soon but it is still open.
