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

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?

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.

1 Like