Skip to content

Commit

Permalink
Add reference_potential for the Ellipsoid class
Browse files Browse the repository at this point in the history
  • Loading branch information
Mark Wieczorek committed Apr 8, 2024
1 parent 27ab6a5 commit 1a7c904
Showing 1 changed file with 19 additions and 2 deletions.
21 changes: 19 additions & 2 deletions boule/_ellipsoid.py
Original file line number Diff line number Diff line change
Expand Up @@ -107,6 +107,8 @@ class Ellipsoid:
9.7803253359 m/s²
>>> print(f"{ellipsoid.gravity_pole:.10f} m/s²")
9.8321849379 m/s²
>>> print(f"{ellipsoid.reference_potential:.3f} m²/s²")
62636851.715 m²/s²
Use the class methods for calculating normal gravity and other geometric
quantities.
Expand Down Expand Up @@ -179,7 +181,7 @@ def linear_eccentricity(self):
r"""
The linear eccentricity of the ellipsoid. The distance between the
ellipsoid's center and one of its foci.
Definition: :math:`c = \sqrt{a^2 - b^2}`.
Definition: :math:`E = \sqrt{a^2 - b^2}`.
Units: :math:`m`.
"""
return np.sqrt(self.semimajor_axis**2 - self.semiminor_axis**2)
Expand Down Expand Up @@ -223,11 +225,26 @@ def mean_radius(self):
def volume(self):
r"""
The volume bounded by the ellipsoid.
Definition: :math:`V = \dfrac{4}{3} \pi a^2 c`.
Definition: :math:`V = \dfrac{4}{3} \pi a^2 b`.
Units: :math:`m^3`.
"""
return (4 / 3 * np.pi) * self.semimajor_axis**2 * self.semiminor_axis

@property
def reference_potential(self):
r"""
The reference potential on the surface of the ellipsoid.
Definition: :math:`U_0 = \dfrac{GM}{E} \arctan{\dfrac{E}{b}}
+ \dfrac{1}{3} \omega^2 a^2`.
Units: :math:`m^2 / s^2`.
"""
return (
self.geocentric_grav_const
/ self.linear_eccentricity
* np.arctan(self.linear_eccentricity / self.semiminor_axis)
+ (1 / 3) * self.angular_velocity**2 * self.semimajor_axis**2
)

@property
def _emm(self):
"Auxiliary quantity used to calculate gravity at the pole and equator"
Expand Down

0 comments on commit 1a7c904

Please sign in to comment.