Message Boards Message Boards

0 Replies
7 Total Likes
View groups...
Share this post:

Walking randomly on a torus

Posted 10 years ago

2D random walk generally is simple:

walk = Accumulate[RandomReal[{-.1, .1}, {100, 2}]];
Graphics[Line[walk], Frame -> True]

enter image description here

Confinement to square region {{0,1},{0,1}} would be simple in principle with Mod[walk,1] (periodic boundary conditions) but visualizing will be hard due to cross-boundary lines running in the wrong direction:

Graphics[Line[Mod[walk, 1]], Frame -> True]

enter image description here

I think it is logical, for periodic boundary conditions, to place the walk on a torus ( with arbitrary radiuses ):

map[?_, ?_] = CoordinateTransformData["Toroidal" -> "Cartesian", 
              "Mapping", {r, ?, ?}] /. {\[FormalA] -> 1, r -> 2 Log[2]}

enter image description here

walk = Accumulate[RandomReal[{-.1, .1}, {10^4, 2}]];
Graphics3D[{Opacity[.5], Line[map @@@ walk]}, SphericalRegion -> True]

enter image description here

POSTED BY: Vitaliy Kaurov
Reply to this discussion
Community posts can be styled and formatted using the Markdown syntax.
Reply Preview
or Discard

Group Abstract Group Abstract