New answers tagged

0

I managed to work a partial solution by putting NotebookDelete[NextCell[]]; NotebookDelete[NextCell[]]; In the end of the For loop.


0

Are you interested in rapidly summing primes? or was that just an example to illustrate a ParallelSum question? If you want fast methods for summing primes please see this question and its answers. Please note that the following is a much faster way to sum the sequence of 4 adjacent primes, the fourth example in your question. With[{m = 10000}, ...


3

You can use the internal, undocumented function Parallel`Developer`KernelID to do this: LaunchKernels[3]; Parallel`Developer`KernelID /@ Kernels[] {1, 2, 3} Close kernels and try again: CloseKernels[]; LaunchKernels[4]; Parallel`Developer`KernelID /@ Kernels[] {4, 5, 6, 7}


2

Here is a working serial version of your problem: AbsoluteTiming[ myDataSerial = {}; initialConditions = Flatten[#, 1] &@ Table[{i, j}, {i, 0., 3(*10*), 0.1}, {j, 0., 3(*10*), 0.1}]; myEvent = WhenEvent[x[t] == 0.8, AppendTo[myDataSerial, t]]; Map[NDSolve[{x''[t] == -x[t], {x[0], x'[0]} == #, myEvent}, x, {t, 0, 10}] &, ...


Top 50 recent answers are included