Random Walks of Tetrahedrons and Cubes - Ferris

Report 4 Downloads 68 Views
Random Walks of Tetrahedrons and Cubes J.F. Nystrom and J.C. Robinson Mathematics Department Ferris State University Big Rapids, MI 49307 USA Abstract We show how to design the value of the diffusion constant D for the random walk of a tetrahedron in a face-centered cubic lattice, and for the random walk of a cube in a Cartesian lattice. As in previous work in two-dimensions, by allowing Null moves and movements to locations in the lattice other than nearest neighbors, we can design the value of the diffusion constant D to a value larger that unity (the default) or to a value less than unity.

Keywords: random walk, tetrahedron, diffusion constant, three-dimensions

1

Introduction

Herein we report on our continued work on the controlled diffusion associated with the random walks of geometrical forms that was first introduced in [1]. In this paper we concentrate on three-dimensional random walks, and detail the random walk of a tetrahedron (Tet) in a face-centered cubic (FCC) lattice, and the random walk of a Cube in a regular Cartesian lattice. We present details on how a Tet can move within a FCC lattice, and show the design process wherein we can control the average diffusion (value) associated with a biased random walk of a Tet, and a biased random walk of a Cube. In order to make this paper self-contained, we review some of the basics associated with the statistics of random walks. For a random walk over vertexes of lattices in one-, two-, and three-dimensions, the average distance traveled, r, after t steps is well described by[2] < r2 >= D t , (1) where D is the diffusion constant. If each time stepped move is required to move to a nearest neighbor site a unit distance away, then for all unit spaced regular lattices in one-, two-, or three-dimensions we find statistically that D = 1 when Equation (1) is

averaged over a large number of independent trials for the same value of t. For each random walk, after t moves, the location of a Tet or Cube can be described by a vector t X

r=

ri ,

i=1

where each ri will be associated with one of four types of moves available to the Tet within the FCC lattice, or one of four types of moves available to the Cube within the Cartesian lattice. The average distance squared after t steps, < r2 >, for the random walk is then given as  !  t t X X < r2 > = (2) ri ·  rj  i=1

=

t X

ri2 + 2

i=1

j=1 t−1 X

t X

ri · rj .

i=1 j=i+1

For a large number of independent trials at the same value of t, the second term on the right-hand side of Equation (2) typically vanishes. Thus, < r2 > is determined by the squares of the lengths of the individual steps, ri2 , and the relative frequency thereof. We can combine Equation (1) and Equation (2) to obtain t X (3) < r2 >= ri2 = D t , i=1

which is valid in the averaged limit of a large number of trials at t steps. A random walk of a Tet will be setup so that the four vertexes of the tetrahedron are located at nodes of a FCC lattice. An example of how a Tet is oriented in a FCC lattice is shown in Figure 1. Since a FCC lattice (which can also be referred to as a isotropic vector matrix (IVM)[3]) can be viewed as an interconnected grid of tetrahedron and octahedron, when a Tet walks, it must walk around octahedral voids in the lattice. We restrict the possible

Figure 1: A Tet inside a FCC lattice. (Courtesy of R.W. Gray.) moves of the Tet to include only moves where the new and old location (of the Tet) have at minimum one vertex in common. As will become apparent shortly, the section of the FCC lattice surrounding the Tet in Figure 1 contains the complete range of locations in the lattice accessible in a single step of a random walk of a Tet. The random walk of a Cube is more straightforward since there are no voids in a Cartesian lattice inaccessible to a Cube. In this paper, we do not restrict a Tet or a Cube to unit length moves, and as we will show, this allows us to design diffusion constants with values > 1. Combine this with the fact that we will also allow a Null, allows us to design diffusion constants with values < 1. As mentioned in [1], the techniques contained herein could be applied to simulations which require a spatially-inhomogeneous diffusion constant. Some of these techniques, specifically those associated with the random of walk of a Tet, can also be viewed as a step towards the construction of a computational cosmography[4, 5, 6]; which is a cellular automata ideal which utilizes geometrical forms as the quantities upon which the rules are based in lieu of values at vertexes.

2

A Random Walk of a Tetrahedron

We describe how to design the diffusion constant for the random walk of a Tetrahedron (Tet) in a threedimensional FCC lattice. We introduce three bias parameters in order to design the diffusion constant, D, such that 0 < D ≤ 3. We show details of the

geometry and give parts of the algorithm which describes how to take a step of a random walk.

2.1

Methodology

The random walk starts with the Tetrahedron placed in a y-orientation inside a FCC lattice. Here, the orientation refers to the orientation of the edge of the tetrahedron with the highest z-value. See Figure 2 which shows a y-oriented Tet. The FCC lattice is embedded lattice with grid spacing √ in a Cartesian √ ∆x = 2/2, ∆y = 2/2, and ∆z = 1. This choice of grid spacing allows for unit valued ri2 distances. As it is, the lengths√of the edges of the tetrahedron in this grid are all 2 in length. During each step of the random walk, the body center of a Tet (currently in a y-orientation) can in general move in one of the following ways: 6 types of Edge moves: +z, -z, (+x+y), (-x+y), (+x-y), (-x-y). 12 types of Edge-Edge Common Vertex moves: (+x+y+z), (-x+y+z), . . . , (-x-y-z), +2y, ..., -2x. 4 types of Vertex moves: (+2y+z), (-2y+z), (+2x-z), (-2x-z). A Null move. The possible moves of a Tet during each step are shown in Figures 2 - 5. Figure 2 shows a Tet in a y-orientation before a step, or after a Null move. Figure 3 shows a Tet both before and after a possible Edge move, and this move takes the body-center of the Tet a distance r = 1 away from the initial position. Figure 4 shows a Tet both before and after a

Figure 2: Tet before a step or after a Null move (y-orientation). (Courtesy of R.W. Gray.)

Figure 3: Illustrating an Edge move (+z). (Courtesy of R.W. Gray.)

Figure 4: Illustrating an EECV move (+x − y + z). (Courtesy of R.W. Gray.)

Figure 5: Illustrating a Vertex move (−2y + z). (Courtesy of R.W. Gray.) possible Edge-Edge Common Vertex (EECV) move, and this move of the Tet a disp takes the body-center √ tance r = 1/2 + 1/2 + 1 = 2 away from the initial position. Figure 5 shows a Tet both before and after a possible Vertex move, and this move √ √ takes the body-center of the Tet a distance r = 2 + 1 = 3 away from the initial position. All Edge and Vertex moves change the orientation of the Tet, while EECV moves do not (change the orientation). We now develop an equation to model the diffusion constant D for a Tet walk as it is done in [1]. We introduce the use of three bias parameters: p, q and b, and construct a set of moves, t, based on the probability for each type of move. For the total t moves, let p ∗ q ∗ b represent the number of Null moves, let 6∗p∗q represent the number of Edge moves, let 12∗q represent the number of EECV moves, and let 4 be the number of Vertex moves. The total number of moves is then t = 4 + 12 ∗ q + 6 ∗ p ∗ q + p ∗ q ∗ b .

(4)

In the set lattice spacing, the distance moved by a Tet in a Vertex move is r2 = 3, the distance moved by a Tet in an EECV move is r2 = 2, and the distance moved by a Tet in a Edge move is r2 = 1. From Equation (3) we obtain Pt 2 ri 12 + 24 ∗ q + 6 ∗ p ∗ q D= = t 4 + 12 ∗ q + 6 ∗ p ∗ q + p ∗ q ∗ b 12 + q ∗ (24 + 6 ∗ p) , = (5) 4 + q ∗ (12 + p ∗ (6 + b)) which is an equation for the diffusion constant for the random walk of a Tet in terms of the bias parameters p, q and b.

2.2

Algorithm and Results

Figure 6 shows a sample run of a random walk code for a Tet where 5000 independent walkers1 are averaged at each value of t (=Terms in the figure) using parameter settings of q = 3, p = 2, and b = 4. Figure 6 includes the value predicted for the diffusion constant D by Equation (5) for q, p and b. For all values of bias parameters, the results of simulations follow closely the predicted value for D. Random Walk of Tetrahedron Enter bias value (q): 3 Enter bias value (p): 2 Enter bias value (b): 4 Enter limit of loop iterations: 20 ------------------------------------Terms < r * r > diffusion 2 2.401 1.200 4 4.846 1.212 6 7.167 1.194 8 9.659 1.207 10 11.812 1.181 12 14.497 1.208 14 16.709 1.194 16 18.787 1.174 18 21.351 1.186 20 24.245 1.212

average diffusion = 1.197 with b bias = 4.000 with p bias = 2.000 with q bias = 3.000 Equation for D = 1.200

Figure 6: Sample random walk statistics for a Tet using q = 3, p = 2, and b = 4. Using Equation (4) with the parameter settings q = 3, p = 2, and b = 4, it can be predicted, with

1 Here each walker is independent in the sense that each walker begins by re-seeding the random number generator using the value of microseconds from the system clock.

// Generate and scale random number for move of Tet v = random_number in [0,1); v *= 4 + q*(12 + p*(b + 6)); // Move if else if else if : else if else if else if : else if else if else if else if else

Tet (which is currently in y-orientation) (v < q*p*b) move(Null); (v < q*p*(b + 1)) move(+z); switch(x); (v < q*p*(b + 2)) move(-z); switch(x); : (v < q*p*(b + 6)) move(-x,-y); switch (x); (v < q*(p*(b + 6) + 1)) move(+x,+y,+z); (v < q*(p*(b + 6) + 2)) move(-x,+y,+z); : (v < q*(p*(b + 6) + 12)) move(-2x); (v < q*(p*(b + 6) + 12) + 1) move(+2y,+z); switch(x) (v < q*(p*(b + 6) + 12) + 2) move(-2y,+z); switch(x) (v < q*(p*(b + 6) + 12) + 3) move(+2x,-z); switch(x) move(-2x,-z); switch(x)

// Null moves // Edge moves

// EECV moves

// Vertex moves

Figure 7: Algorithm for moving a Tetrahedron one time step. t = 100, that 4% of the time we expect that the Tet takes a Vertex move, 36% of the time we expect that the Tet takes a EECV move, 36% of the time we expect that the Tet takes an Edge move and 24% of the time we expect that the Tet takes a Null move. To simulate this random walk, we create a scaled random number and select a move (which updates the overall r of the Tet) based on the parameter settings according to the algorithm shown in Figure 7. The algorithm shows how to move a Tet that is currently y-oriented. Other logic, not shown in the algorithm, determines the current orientation and selects the appropriate code. (The main difference between the orientations is the move() associated with Vertex moves.)

2.3

Designing the Diffusion Constant

The equation for the diffusion constant in Equation (5), D = D(q, p, b), is written explicitly as a function of the bias parameters. To design for a specific diffusion constant value, we convert Equation (5) to give p = p(D, q, b): p=

12 + 24 ∗ q − D ∗ (4 + 12 ∗ q) . q ∗ (D ∗ (6 + b) − 6)

3

A Random Walk of a Cube

The random walk starts with the body-center of the Cube at the origin of an unit-spaced threedimensional Cartesian grid. During each step of the random walk, the Cube can move in one of the following ways: 6 types of Face moves: +x, -x, +y, -y, +z, -z. 12 types of Edge moves: (+x+y), (-x+y), . . . , (-x-z). 8 types of Vertex moves: (+x+y+z), (-x+y+z), . . . , (+x-y-z), (-x-y-z). A Null move. For a Cube move we use three bias parameters: q, p and b, and construct a set of moves, t, based on the probability for each type of move. For the total t moves, let q ∗ p ∗ b represent the number of Null moves, let 6 ∗ q ∗ p be the number of Face moves, let 12 ∗ q be the number of Edge moves, and let 8 be the number of Vertex moves. The total number of moves is then t = 8 + 12 ∗ q + 6 ∗ q ∗ p + q ∗ p ∗ b .

(6)

Equation (6) is the design equation. Once we select a value for the bias parameters q and b, and fix a desired value for D, we design the value of p that gives the specific diffusion constant D. Even if we want a value of D = 1, we can set the bias parameters so that all the moves are not just Edge moves, thus bringing some stochastic variability into the movements of the Tet during a simulation that would utilize a tetrahedron form.

The distance moved by a Cube in a Vertex move is r2 = 3, the distance moved by a Cube in an Edge move is r2 = 2, and the distance moved by a Cube in a Face move is r2 = 1. From Equation (3) we obtain 24 + 6 ∗ q ∗ (4 + p) D= , (7) 8 + q ∗ (12 + p ∗ (6 + b)) which is an equation for the diffusion constant of the random walk of a Cube in terms of the bias parameters q, p and b.

Random Walk of Cube enter bias value (b): 2.5 enter bias value (q): 2 enter bias value (p): 4 enter limit of loop iterations: 20 ------------------------------------Terms < r * r > diffusion 2 2.378 1.189 4 4.829 1.207 6 7.057 1.176 8 9.568 1.196 10 12.065 1.207 12 14.624 1.219 14 16.621 1.187 16 19.490 1.218 18 21.677 1.204 20 23.810 1.190 average diffusion = 1.19941 with b = 2.500 with q = 2.000 and p = 4.000 Equation for D = 1.200

Figure 8: Sample random walk statistics for a Cube using b = 2.5, q = 2 and p = 4. Consider a random walk where we set b = 2.5, q = 2 and p = 4. Figure 8 shows a sample run for a Cube using b = 2.5, q = 2 and p = 4 where 5000 independent walkers are averaged at each value of t. Here if we choose each move in the random walk according to the algorithm in Figure 9, then (on average) 48% of the time the Cube takes a Face move, 24% of the time the Cube takes an Edge move, 8% of the time the Cube takes a Vertex move, and 20% of the time the Cube takes a Null move. For this example, from Equation (7), D = 1.2. As done for Tet walk, we solve Equation (7) for the Cube p(b, q, D): p=

24 + 24 ∗ q − 4 ∗ D ∗ (2 + 3 ∗ q) . q ∗ (D ∗ (6 + b) − 6)

(8)

Since for all intensive purposes, the walk of a Cube can be viewed as a movement from vertex point to vertex point(s) in a Cartesian grid, this design technique will allow for movements to grid locations other than nearest-neighbors (i.e., Face moves) for simulations that want a D = 1 value.

4

Discussion

We have extended the work in [1] and we have shown how to design diffusion constants for the random walks of a tetrahedrons and cubes on their respective lattices in three-dimensions. To allow for the design of diffusion constants other than unity we introduced bias parameters to control the probability

that a Tet or Cube would take a move other than an unit length move. Work has begun on the random walks of other geometrical forms in three-dimensions. Of special interest are the random walks of A-modules and B-modules within a FCC lattice. An A-module, for example, is 1/24th of a regular tetrahedron, so when an A-module walks, it could walk to other locations within a tetrahedron, or to nearby tetrahedrons (with a common vertex), or to some possible locations within the octahedron voids of the FCC lattice. Figure 10 shows an A-module and Bmodule example. In the figure, one A-module is in the lower tetrahedron and one A-module is in the octahedron. The other module in the octahedron is the B-module. Besides being a next step in the construction of a computational cosmography, the usefulness of the techniques contained herein could be in (Cartesianbased) particle simulations that constrain entities to vertexes of a regular lattice, and which may require a range of diffusion constant values. Also, for simulations which require a spatially-inhomogeneous diffusion constant, we could utilize the techniques described herein and vary the bias parameters throughout the simulation domain.

References [1] Nystrom, J.F. 2008. On the Random Walks of Geometrical Forms in Two-Dimensions. Conference Proceedings of the 2008 International Conference on Scientific Computing. [2] Giordano, N.J., 1997. Computational Physics. Upper Saddle River, NJ: Prentice Hall. [3] Nystrom, J.F. and C. Bellomo. 2005. Isotropic Vector Matrix Grid and Face-Centered Cubic Lattice Data Structures. Lecture Notes in Computer Science 3516: 1096. [4] Nystrom, J.F. 2010. Ontological musings on how nature computes. (to be presented) ICCS 2010: International Conference on Computational Science. [5] Nystrom, J.F. 2004. On the Omni-directional Emergence of Form in Computation. Lecture Notes in Computer Science 3305: 632. [6] Nystrom, J.F. 2001 Tensional computation: Further musings on the computational cosmography. Applied Mathematics and Computation 120: 211.

// Generate and scale random number for move of Cube v = random_number in [0,1); v *= 8 + q*(12 + p*(b + 6)); // Move Cube if (v < q*p*b) move(Null); else if (v < q*p*(b + 1)) move(+x); : : else if (v < q*p*(b + 6)) move(-z); else if (v < q*(p*(b + 6) + 1)) move(+x,+y); : : else if (v < q*(p*(b + 6) + 12)) move(-x,-z); else if (v < q*(p*(b + 6) + 12) + 1) move(+x,+y,+z); : : else if (v < q*(p*(b + 6) + 12) + 7) move(+x,-y,-z); else move(-x,-y,-z);

// Null moves // Face moves

// Edge moves

// Vertex moves

Figure 9: Algorithm for moving a Cube one time step.

Figure 10: A-modules and B-module inside a tetrahedron and octahedron. (Courtesy of R. Hawkins.)