This is a very general question I have about aborting a running computation but keeping what was already generated.
Let's say that I perform a numerical optimization over a list of parameters. Mathematica can take quite some time to go over the whole list of parameters. Let's say I want to abort for some reason.
Is there a way to abort but keep what was already calculated?
Do[res[p] = NMinimize[...], {p, parameterList}]
would save the results inres
. Instead of making definitions, you could also add each result to a list or association. $\endgroup$append
in other "languages". I will give it a try. Thank you very much, @MichaelE2! $\endgroup$