Energy of particles on sphere and uniform rotation

120 Views Asked by At

I have a computer program containing some particles on a unit sphere, characterized by their positions $\{(\theta_i,\phi_i)\}$. They have a total energy given by the arc distance between particle pairs:

$E=\displaystyle\sum_{i<j}^N1/\cos^{-1}\Big(\sin(\theta_i)\sin(\theta_j)\cos(\phi_i-\phi_j)+\cos(\theta_i)\cos(\theta_j)\Big)$

In the program I calculate this energy, rotate the whole sphere and then calculate the energy again. The problem is that after the rotation I get a different result for the energy, which shouldn't depend on a uniform rotation like this.

Here's how I implement the rotation:

I first calculate $x_i=\cos(\phi_i)\sin(\theta_i)$, $y_i=\sin(\phi_i)\sin(\theta_i)$ and $z_i=\cos(\theta_i)$. Then I do the following rotation of angle $\Delta\theta$ around the y-axis:

$x_i'=x_i\cos(\Delta\theta)+z_i\sin(\Delta\theta)$

$y_i'=y_i$

$z_i'=z_i\cos(\Delta\theta)-x_i\sin(\Delta\theta)$

And finally I calculate the new angles: $\phi_i'=\tan^{-1}(y_i'/x_i')$ and $\theta_i\ '=\cos^{-1}(z_i')$.

Can anyone see a mistake on the math here?

1

There are 1 best solutions below

1
On BEST ANSWER

You don't say whether $\theta$ represents longitude (about some axis) and $\phi$ latitude, but your inverse trig function formulas for calculating angles are suspicious. If you fix branches, the formula $\phi_i' = \tan^{-1}(y_i'/x_i')$ does not define a continuous function on the sphere (look particularly near $(0, 0, \pm1)$, and neither your formula for $\phi_i'$ nor $\theta_i' = \cos^{-1}(z_i')$ takes all values in an interval of length $2\pi$ (so neither gives a correct longitude).

Maybe it would make sense to store your points' locations as unit vectors in Cartesian coordinates, use orthogonal matrices to rotate, and to use the Euclidean dot product (a.k.a., the cosine of the "small" angle defined by two unit vectors) to calculate energy?