How to simulate a random walk on a sphere

In summary: So the basic idea is to add a constant vector to each step, then use the dot product to calculate the new position.In summary, you would move your point by an angle \alpha along a random great circle, then use the dot product to calculate the new position.
  • #1
phonic
28
0
Dear All,

I am simulating a random walk on a sphere with unit radius. I want to move from current location p_t to the new location p_{t+1} along the big circle, whose arc has an angle omega relative to p_t's latitude. I tried using the law of cosine. But at the poles, the law of cosine diverges. Can anyone help find a method that works for all location on the sphere? Thanks!
 
Physics news on Phys.org
  • #2
phonic said:
Dear All,

I am simulating a random walk on a sphere with unit radius. I want to move from current location p_t to the new location p_{t+1} along the big circle, whose arc has an angle omega relative to p_t's latitude. I tried using the law of cosine. But at the poles, the law of cosine diverges. Can anyone help find a method that works for all location on the sphere? Thanks!

I am not sure what you mean by law of cosine, but I would suggest: If your algorithm is correct, then do not start your walk at the pole. Probability that you will ever reach the pole is zero, I guess.
 
  • #3
So say, at each step, you want to move by an angle [itex]\alpha[/itex] along a random great circle through the current point. If your current point is the "north pole", i.e. (0,0,1) in xyz coordinates, then that's just a rotation, call it R, by [itex]\alpha[/itex], with axis a random line in the xy-plane.

And rather than worry about how you'd do it if the point isn't the north pole, I'd instead do a rotation C to bring my current point to the north pole, then do as above, then do the inverse of C. Finding such a C is straightforward; one way would be to project the current point to the xy-plane, draw a line through it and the origin, and take the perpendicular line through the origin to be the axis of rotation. Then you can rotate so that p travels along a great circle to the north pole. There are lots of other C's that would work (where p doesn't move along a great circle), but that's probably the easiest to compute. (Detail: if p is the south pole, this isn't well-defined, so just let C be the map that mirrors the sphere across the xy-plane.)

So then the effect of [itex]CRC^{-1}[/itex] on p is to carry it to a new point at an angular distance [itex]\omega[/itex] away, along a random great circle passing through p.
 

1. How can I generate random points on a sphere?

To generate random points on a sphere, you can use a spherical coordinate system. This involves choosing a random angle for latitude and a random angle for longitude. A random radius can also be chosen, although it is typically kept constant for a unit sphere. Using trigonometric functions, you can then convert the spherical coordinates to Cartesian coordinates to get your random points on the sphere.

2. What is the difference between a random walk on a sphere and on a plane?

The main difference between a random walk on a sphere and on a plane is the dimensionality. A random walk on a sphere takes place in a 3D space, while a random walk on a plane takes place in a 2D space. This means that on a sphere, there is an added element of directionality as you move in all three dimensions, whereas on a plane, you only move in two dimensions.

3. How do I add constraints to my random walk on a sphere?

To add constraints to your random walk on a sphere, you can use boundary conditions. These can include setting limits on the latitude and longitude angles, or setting a maximum distance that the random walk can travel from the starting point. You can also add directional constraints by specifying a certain direction for the walk to follow.

4. What is the significance of simulating a random walk on a sphere?

Simulating a random walk on a sphere can have various applications in scientific research. It can be used to model diffusion processes, such as the spread of particles in a gas, or the movement of molecules in a liquid. It can also be used to study animal behavior, as many animals move in a random fashion and their movements can be modeled as a random walk.

5. How can I visualize the results of my random walk on a sphere?

There are various ways to visualize the results of a random walk on a sphere. One common way is to plot the points on a 3D graph, with the starting point as the origin and the points connected by lines to show the path of the walk. Another way is to use a heat map, where the points are colored based on the number of times they have been visited during the walk. You can also create an animation to show the movement of the points over time.

Similar threads

  • Set Theory, Logic, Probability, Statistics
Replies
15
Views
1K
  • Calculus and Beyond Homework Help
Replies
1
Views
905
  • Quantum Physics
Replies
5
Views
3K
  • Programming and Computer Science
Replies
6
Views
2K
  • Linear and Abstract Algebra
Replies
13
Views
2K
  • Topology and Analysis
Replies
2
Views
5K
Replies
16
Views
2K
  • Advanced Physics Homework Help
Replies
4
Views
2K
  • Advanced Physics Homework Help
Replies
8
Views
7K
  • Introductory Physics Homework Help
Replies
8
Views
2K
Back
Top