Skip to content

Commit

Permalink
Add test for triaxial centrifugal potential
Browse files Browse the repository at this point in the history
  • Loading branch information
Mark Wieczorek committed Apr 18, 2024
1 parent 53eb086 commit 894d0ae
Showing 1 changed file with 23 additions and 0 deletions.
23 changes: 23 additions & 0 deletions boule/tests/test_triaxialellipsoid.py
Original file line number Diff line number Diff line change
Expand Up @@ -295,3 +295,26 @@ def test_geocentric_radius_biaxialellipsoid(triaxialellipsoid):
npt.assert_allclose(
radius_true, biaxialellipsoid.geocentric_radius(longitude, latitude)
)


def test_centrifugal_potential(triaxialellipsoid):
"""
Test that the centrifugal potential on the surface is greater along the
semimajor axis than the semimedium axis, and that the centrifugal potential
is zero at the poles.
"""
height = 2 * [0, 1, 1000]
latitude = 3 * [-90] + 3 * [90]
longitude = np.linspace(0, 360, 6)
assert (
triaxialellipsoid.centrifugal_potential(
longitude=longitude, latitude=latitude, height=height
)
< 1e-15
).all()
assert (
triaxialellipsoid.centrifugal_potential(longitude=0, latitude=0, height=height)
>= triaxialellipsoid.centrifugal_potential(
longitude=90, latitude=0, height=height
)
).all()

0 comments on commit 894d0ae

Please sign in to comment.