Skip to content

Commit

Permalink
chore: #83 fix equations
Browse files Browse the repository at this point in the history
  • Loading branch information
cmp0xff committed Sep 1, 2024
1 parent 53226f7 commit 18b4f00
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions hamilflow/models/kepler_problem/dynamics.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,9 @@ def tau_of_u_exact_elliptic(
) -> "npt.NDArray[np.float64]":
r"""Exact solution for tau of u in the elliptic case.
$$ \tau = -\frac{\sqrt{e^2-u^2}}{(1-e^2)(1+u)} + (1-e^2)^{-frac{3}{2}} \cdot
\left(\frac{pi}{2} - \arctan\frac{e^2+u}{\sqrt{(1-e^2)(e^2-u^2)}}\right)\,. $$
$$ \tau = -\frac{\sqrt{e^2-u^2}}{(1-e^2)(1+u)} +
\left(\frac{\pi}{2} - \arctan\frac{e^2+u}{\sqrt{(1-e^2)(e^2-u^2)}}\right) /
(1-e^2)^{\frac{3}{2}}\,. $$
"""
cosqr, eusqrt = 1 - ecc**2, np.sqrt(ecc**2 - u**2)
trig_numer = np.pi / 2 - np.arctan((ecc**2 + u) / np.sqrt(cosqr) / eusqrt)
Expand All @@ -35,7 +36,7 @@ def tau_of_e_plus_u_elliptic(
$$ \tau = \frac{\pi}{(1-e^2)^\frac{3}{2}}
- \frac{1}{(1-e)^2}\left(\frac{2(e+u)}{e}\right)^\frac{1}{2}
- \frac{1-9e}{24(1-e)^3}\left(\frac{2(e+u)}{e}\right)^\frac{3}{2}
+ O\left((u+e)^\frac{5}{2}\right)\,. $$
+ O\left((e+u)^\frac{5}{2}\right)\,. $$
"""
epu = np.sqrt(2 * (ecc + u) / ecc)
const = np.pi / (1 - ecc**2) ** 1.5
Expand All @@ -48,9 +49,9 @@ def tau_of_e_minus_u_elliptic(
) -> "npt.NDArray[np.float64]":
r"""Expansion for tau of u in the ellpitic case at $u = +e-0$.
$$$ \tau = \frac{1}{(1+e)^2}\left(\frac{2(e-u)}{e}\right)^\frac{1}{2}
$$ \tau = \frac{1}{(1+e)^2}\left(\frac{2(e-u)}{e}\right)^\frac{1}{2}
- \frac{1+9e}{24(1+e)^3}\left(\frac{2(e-u)}{e}\right)^\frac{3}{2}
+ O\left((u-e)^\frac{5}{2}\right)\,.
+ O\left((e-u)^\frac{5}{2}\right)\,. $$
"""
emu = np.sqrt(2 * (ecc - u) / ecc)
return emu / (1 + ecc) ** 2 - emu**3 * (1 + 9 * ecc) / 24 / (1 + ecc) ** 3
Expand Down

0 comments on commit 18b4f00

Please sign in to comment.