How to save intermediate result of calculations in Mathematica

Sometimes, one needs to make long-time pleriminary calculations in Mathematica to obtain expressions for further work. It is not convenien to make them every time when notebook opens again.

An easy (but may be machine-dependent) way is to use DumpSave function. How it works. For example, we have a few variables for save:

a = (E^(-(r^2/(2 ell^2 w[z,t]^2))) (\[Psi]^\[Prime])[t])/ell^2
b = (E^(-(r^2/(2 ell^2 w[z,t]^2))) \[Mu][t] \[Psi][t] (w^(0,1))[z,t])/(ell^2 w[z,t] (1+(ell^2 w[z,t]^2)/r^2))

Now save them into the notebook directory:

DumpSave[NotebookDirectory[]<>"", {a, b}];

Now one can clear the definition and load saved variables:

Clear[a, b]

Thanks to following links (see for additional information):


Leave a Reply