1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
/// Solution of the universal Kepler equation.
///
/// Returned by [`solve`](crate::kepler::UniversalKeplerParams::solve) on convergence, this struct bundles
/// the universal anomaly $\psi$ with the four Stumpff auxiliary values
/// $(s_0, s_1, s_2, s_3)$ evaluated at $(\psi, \alpha)$.
///
/// # Physical meaning
///
/// ## Universal anomaly $\psi$
///
/// The universal anomaly generalizes the classical orbital anomalies across all
/// conic regimes:
///
/// | Regime | Relation |
/// |---|---|
/// | Elliptic | $\psi = \sqrt{a} \cdot E$ where $E$ is the eccentric anomaly |
/// | Hyperbolic | $\psi = \sqrt{-a} \cdot H$ where $H$ is the hyperbolic anomaly |
///
/// A single equation covers all regimes:
///
/// $$r_0 \cdot s_1(\psi, \alpha) + \sigma_0 \cdot s_2(\psi, \alpha) + s_3(\psi, \alpha) = \sqrt{\mu} \cdot \Delta t$$
///
/// where `alpha` is the reciprocal semi-major-axis convention
/// ( $\alpha = -1/a$ ), not the raw vis-viva $2E$ — see
/// [`UniversalKeplerParams`](crate::kepler::UniversalKeplerParams).
///
/// ## Stumpff auxiliary functions $s_n(\psi, \alpha)$
///
/// These functions unify trigonometric and hyperbolic functions through the
/// energy parameter $\alpha$ via the substitution $\beta = \alpha \psi^2$:
///
/// $$s_n(\psi, \alpha) = \psi^n \cdot c_n(\alpha \psi^2)$$
///
/// where $c_n$ are the Stumpff functions defined by:
///
/// $$c_n(x) = \sum_{k=0}^{\infty} \frac{(-x)^k}{(n + 2k)!}$$
///
/// Their explicit forms depend on the orbital regime ($\beta = \alpha\psi^2$):
///
/// | | Elliptic $(\beta < 0)$ | Hyperbolic $(\beta > 0)$ |
/// |---|---|---|
/// | $s_0$ | $\cos\!\sqrt{-\beta}$ | $\cosh\!\sqrt{\beta}$ |
/// | $s_1$ | $\sin\!\sqrt{-\beta}\,/\sqrt{-\alpha}$ | $\sinh\!\sqrt{\beta}\,/\sqrt{\alpha}$ |
/// | $s_2$ | $(1 - \cos\!\sqrt{-\beta})\,/(-\alpha)$ | $(\cosh\!\sqrt{\beta}-1)\,/\alpha$ |
/// | $s_3$ | $(\sqrt{-\beta}-\sin\!\sqrt{-\beta})\,/(-\alpha)^{3/2}$ | $(\sinh\!\sqrt{\beta}-\sqrt{\beta})\,/\alpha^{3/2}$ |
///
/// The differentiation chain with respect to $\psi$:
///
/// $$\frac{d s_3}{d\psi} = s_2, \qquad \frac{d s_2}{d\psi} = s_1, \qquad \frac{d s_1}{d\psi} = s_0$$
///
/// which directly yields the residual derivative:
///
/// $$f'(\psi) = r_0 \cdot s_0 + \sigma_0 \cdot s_1 + s_2$$
///
/// ## Role of each $s_n$ in orbit propagation
///
/// The Stumpff functions appear in the **Lagrange coefficients** $f$ and $g$,
/// which propagate position and velocity from epoch $t_0$ to $t_0 + \Delta t$:
///
/// $$\vec{r}(t) = f \cdot \vec{r}_0 + g \cdot \vec{v}_0$$
/// $$\vec{v}(t) = \dot{f} \cdot \vec{r}_0 + \dot{g} \cdot \vec{v}_0$$
///
/// | Field | Stumpff analog | Role in propagation |
/// |---|---|---|
/// | `cos_like` ($s_0$) | $\cos$ / $\cosh$ | Lagrange coefficient $f$ and $\dot{g}$ |
/// | `sin_like` ($s_1$) | $\sin/\omega$ / $\sinh/\omega$ | Lagrange coefficient $g$ (units of time) |
/// | `one_minus_cos_like` ($s_2$) | $(1-\cos)/\alpha$ | Lagrange coefficient $\dot{f}$ |
/// | `time_integral` ($s_3$) | time-of-flight kernel | Carries $\Delta t$ in the Kepler equation |