Skip to content

don't mod angles; they are not periodic #1180

@unalmis

Description

@unalmis

Recall single valued functions $f$ that are periodic in $(\theta, \zeta)$ obey $f(\theta, \zeta) = f(\theta + j 2 \pi, \zeta + k 2 \pi)$. Of course $\zeta \neq \zeta + k 2 \pi$.

  1. I think we should not mod any of the angles we compute $\theta, \zeta, \phi, \alpha, \vartheta$ inside our compute functions. Otherwise, we can run into issues because there are functions of interest which are not periodic. 1

We don't mod $\phi$ right now, but if we did, attempts to map coordinates $\alpha \in \mathbf{R}, \phi \subset \mathbf{R}$ using $\alpha = \vartheta \text{mod} (2 \pi) - \iota (\phi \text{mod} (2 \pi))$ will give incorrect results because the map $\alpha \colon \vartheta, \phi \mapsto \alpha(\vartheta, \phi)$ is not periodic. Likewise since the "branch cut" (for my lack of better description) we choose to define $\alpha$ on is centered at $\phi =\vartheta = 0$, we want that

$$\lim_{\vert\phi\vert \to \infty} \vert \frac{\partial \alpha}{\partial \rho}\vert (\rho, \vartheta, \phi) = \infty \text{ when } \frac{\partial \iota}{\partial \rho} \neq 0$$

but this will not be satisfied if we mod $\phi$ in the compute function.

Currently on master we mod $\vartheta$ and $\alpha$. This doesn't cause issues for my work, but FYI it would impede computing $\phi$ through the relation $(\vartheta - \alpha) / \iota = \phi$.

  1. Inside the coordinate mapping routines, we mod the coordinates by the period common to all periodic functions of those coordinates. This is fine if we only care about feeding the output to periodic functions, and should help accelerate convergence of the root finding. If we care about feeding these coordinates to non periodic functions, such as a radial derivative of $\alpha$, dependency, or chain multiple coordinate mappings together, then we could get wrong results.

I think 1. can be done without drawbacks. Not sure if 2 affects anyone. 2 affects me

Footnotes

  1. For example, if we edit the compute function of $\phi = \phi mod $2\pi$, then this test will fail. Note that the output of _map_clebsch_coordinates remains correct because it never computes $\phi$, while the general map_coordinates is affected.

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions