Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add attributes for the normal potential to Sphere and Ellipsoid #184

Merged
merged 3 commits into from
Apr 17, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 19 additions & 2 deletions boule/_ellipsoid.py
Original file line number Diff line number Diff line change
Expand Up @@ -123,6 +123,8 @@ class Ellipsoid:
9.7803253359 m/s²
>>> print(f"{ellipsoid.gravity_pole:.10f} m/s²")
9.8321849379 m/s²
>>> print(f"{ellipsoid.reference_normal_gravity_potential:.3f} m²/s²")
62636851.715 m²/s²

Use the class methods for calculating normal gravity and other geometric
quantities.
Expand Down Expand Up @@ -196,7 +198,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 @@ -287,11 +289,26 @@ def area(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_normal_gravity_potential(self):
r"""
The normal gravity 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 area_equivalent_radius(self):
r"""
Expand Down
11 changes: 11 additions & 0 deletions boule/_sphere.py
Original file line number Diff line number Diff line change
Expand Up @@ -117,6 +117,8 @@ class Sphere:
2.996568928577e+10 kg
>>> print(f"{sphere.mean_density:.0f} kg/m³")
7153781359 kg/m³
>>> print(f"{sphere.reference_normal_gravitational_potential:.3f} m²/s²")
2.000 m²/s²

"""

Expand Down Expand Up @@ -269,6 +271,15 @@ def volume_equivalent_radius(self):
"""
return self.radius

@property
def reference_normal_gravitational_potential(self):
r"""
The normal gravitational potential on the surface of the sphere.
Definition: :math:`U_0 = \dfrac{GM}{R}`.
Units: :math:`m^2 / s^2`.
"""
return self.geocentric_grav_const / self.radius

def normal_gravity(self, latitude, height, si_units=False):
r"""
Normal gravity of the sphere at the given latitude and height.
Expand Down
Loading