1
$\begingroup$

I am having some outputs from NDSolve of the form

{{x→InterpolatingFunction[…], y→InterpolatingFunction, … }}

and the evaluation of the respective commands can take a very long time. So I would like the data to also be available once I close and reopen Mathematica and the notebook.

I know that I could manually export the raw data of each of these solutions into separate files, and then read it in again into the file.

But I find this a bit cumbersome, and it also ruins the nice feature of the output of NDSolve to be immediately ready for use in Plot routines, etc..

So my question is: Is there a way to just store these NDSolve outputs with the notebook, so that next time I open it up it is immediately available to me?

If not so. What would be the smartest and most efficient way to do instead?

Thanks a lot for your insights!

$\endgroup$
6
  • 1
    $\begingroup$ Look up Iconize $\endgroup$
    – Carl Woll
    Commented Jun 5, 2019 at 16:18
  • $\begingroup$ @CarlWoll I tried that out now, and that is a great solution, thank you so much! There is one downside to it though: The saving and opening of the file now takes a much longer time than before. But I suppose the reasons for that are obvious, and one just cannot have one's cake and eat it at the same time. : ) Thanks again! $\endgroup$
    – Britzel
    Commented Jun 5, 2019 at 17:08
  • $\begingroup$ You could also investigate PersistentValue, PersistentObject and Once, as these functions won't store anything in the notebook. $\endgroup$
    – Carl Woll
    Commented Jun 5, 2019 at 17:37
  • $\begingroup$ Perhaps this related problem here could help you. $\endgroup$
    – partial81
    Commented Jun 5, 2019 at 20:02
  • $\begingroup$ Check this out also $\endgroup$
    – dearN
    Commented Jun 5, 2019 at 23:00

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.