Optimizing a simple random walk simulation

Spot on, I’ve already been through all these papers :slight_smile:

Happy to believe you here, but at the same time I’m not knowledgeable enough in the field (yet) to go ahead and do something different from them.

I’ve already used an even less efficient matlab version of the code above, which has given “okay” results, and I posted this thread mostly because I really want to get better at julia, and understand how to eliminate those pesky allocations.

I do appreciate your advice though, and I’ll definitely do some extra research on the topic at some point!

1 Like

So, some more lit references: The thing with the sphere is called “random walk on spheres”. Allegedly reflection works across Robin boundaries, somehow, just as well as across Neumann boundaries (TIL).

There is also a large theory of “walk-on-boundary” algorithms. These are more complicated than I can grok in 5 minutes, so you’ll need to ask somebody else.

2 Likes