I am currently working a project that involves solving the classical motion equations for particular energies to very high precision. I am using NDSolve and essentially have the process automated. However, my issue is that after solving the trajectory for the first energy Math_Kernel will be taking up over 1.3 GB of RAM so every subsequent calculations takes much longer to do.
I have figured out a way to save the results onto my harddrive, however even after I Remove the variables and do
Unprotect[In, Out]; Clear[In, Out]; Protect[In, Out]
most of the memory is still be used. The only way I have figured out to clear it is to Quit the kernel, which is fine if I'm on hand. However I would like to see Mathematica to solve for several different energies on its own and using Quit will drop it out of whatever loop its running in.
Does anyone know how to clear this memory that is being taken up in a way that can be automated as part of the code?
Thanks in Advance