Skip to content

Commit

Permalink
Merge pull request #131 from jorenham/fix-theta_m_bar
Browse files Browse the repository at this point in the history
Fix `constants.theta_m_bar`
  • Loading branch information
jorenham authored Dec 26, 2023
2 parents f659b9b + 76f175b commit cdeb845
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 9 deletions.
14 changes: 7 additions & 7 deletions lmo/constants.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,18 +9,18 @@

theta_m: Final[float] = 0.955316618124509278163857102515757754
r"""
Magic angle \( \theta_m = \arctan \sqrt 2 \approx 0.9553 \).
Magic angle \( \theta_m = \arctan \sqrt 2 \).
See also:
- https://wikipedia.org/wiki/Magic_angle
- [Magic angle - Wikipedia](https://wikipedia.org/wiki/Magic_angle)
"""

theta_m_bar: Final[float] = 0.221389709640985827437970269154380360
theta_m_bar: Final[float] = 0.152043361992348182457286110194392272
r"""
Magic number of turns \( \bar{\theta}_m = \theta_m / (2 \pi) \approx 0.2214 \)
Magic number of turns \( \bar{\theta}_m = \theta_m / (2 \pi) \).
See also:
- [theta_m][lmo.constants.theta_m]
- https://wikipedia.org/wiki/Magic_angle
- https://wikipedia.org/wiki/Turn_(angle)
- [`lmo.constants.theta_m`][lmo.constants.theta_m]
- [Magic angle - Wikipedia](https://wikipedia.org/wiki/Magic_angle)
- [Turn (angle) - Wikipedia](https://wikipedia.org/wiki/Turn_(angle))
"""
4 changes: 2 additions & 2 deletions tests/test_theoretical.py
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,7 @@ def test_lm_normal():
r = [1, 2, 3, 4]

l2 = sigma / np.sqrt(np.pi)
l = np.array([mu, l2, 0, l2 * (30 * constants.theta_m / np.pi - 9)])
l = np.array([mu, l2, 0, l2 * (60 * constants.theta_m_bar - 9)])

l_ppf = l_moment_from_ppf(IQ.inv_cdf, r)
assert_allclose(l_ppf, l)
Expand All @@ -132,7 +132,7 @@ def test_tlm_normal():

r = [1, 2, 3, 4]

tl2 = 6 * sigma / np.sqrt(np.pi) * (1 - 3 * constants.theta_m / np.pi)
tl2 = 6 * sigma / np.sqrt(np.pi) * (1 - 6 * constants.theta_m_bar)
tl = np.array([mu, tl2, 0, tl2 * 0.06247999167])

tl_ppf = l_moment_from_ppf(IQ.inv_cdf, r, trim=1)
Expand Down

0 comments on commit cdeb845

Please sign in to comment.