# MTK: how to get all observed and unknown variable as a dataframe

**URL:** https://discourse.julialang.org/t/mtk-how-to-get-all-observed-and-unknown-variable-as-a-dataframe/116250
**Category:** Modelling & Simulations
**Created:** [June 26, 2024, 9:23am UTC](https://discourse.julialang.org/t/mtk-how-to-get-all-observed-and-unknown-variable-as-a-dataframe/116250 "2024-06-26T09:23:54Z")
**Posts on this page:** 2
**Page:** 1

<div class="post-metadata">

### Author: ![wangyunyueyueniao](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/wangyunyueyueniao/32/44789_2.png) [@wangyunyueyueniao](https://discourse.julialang.org/u/wangyunyueyueniao)
#### Post date: [June 26, 2024, 9:23am UTC](https://discourse.julialang.org/t/mtk-how-to-get-all-observed-and-unknown-variable-as-a-dataframe/116250/1 "2024-06-26T09:23:54Z")

</div>

As the documentation said, a solution can be exported to a dataframe of unkowns. Also I am able to export a couple of observed variables as long as there name is known. But now I want to export **all** of the observed and unkown variables to dataframe, with their name as colume. Is there any method to achieve this?

---

<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: [June 29, 2024, 2:23am UTC](https://discourse.julialang.org/t/mtk-how-to-get-all-observed-and-unknown-variable-as-a-dataframe/116250/2 "2024-06-29T02:23:13Z")

</div>

```julia
using SymbolicIndexingInterface as SII
sol[SII.all_variable_symbols(sol)]

```

would generate the full time series of all unknowns + observed. If you solved with `saveat` it should be evenly spaced already. Just `DataFrame` and that and use `SII.all_variable_symbols` to set the header.

We can give that a nicer utility function sometime in the future but that should just be a few lines of code for what you need for now.
