Algorithms Utilities Module
The utils module provides utility functions for algorithms in the circular restricted three-body problem.
Configuration
The config module provides configuration utilities.
Configuration constants and settings for the algorithms module.
Coordinate Transformations
The coordinates module provides comprehensive coordinate transformation functions for the circular restricted three-body problem.
_rotating_to_inertial()
The _rotating_to_inertial()
function converts state from rotating to inertial frame.
_inertial_to_rotating()
The _inertial_to_rotating()
function converts state from inertial to rotating frame.
_get_mass_parameter()
The _get_mass_parameter()
function calculates the mass parameter mu for the CR3BP.
_get_angular_velocity()
The _get_angular_velocity()
function calculates the mean motion (angular velocity) of the CR3BP.
- hiten.algorithms.utils.coordinates._get_angular_velocity()[source]
Calculate the mean motion (angular velocity) of the CR3BP.
Computes the angular velocity at which the two primary bodies orbit around their common barycenter in a circular orbit.
- Parameters:
- Returns:
Angular velocity in radians per second
- Return type:
Notes
This is calculated using Kepler’s Third Law: Omega^2 = G(m1+m2)/r^3 where G is the gravitational constant, m1 and m2 are the masses, and r is the distance between the bodies.
_to_crtbp_units()
The _to_crtbp_units()
function converts an SI-state vector into the dimensionless state used by crtbp_accel.
- hiten.algorithms.utils.coordinates._to_crtbp_units()[source]
Convert an SI-state vector into the dimensionless state used by crtbp_accel.
- Parameters:
- Returns:
state_dimless (np.ndarray of shape (6,)) – The dimensionless state vector suitable for crtbp_accel.
mu (float) – Dimensionless mass parameter mu = m2 / (m1 + m2).
_to_si_units()
The _to_si_units()
function converts a dimensionless state vector into the SI-state vector.
_dimless_time()
The _dimless_time()
function converts time from SI units (seconds) to dimensionless CR3BP time units.
- hiten.algorithms.utils.coordinates._dimless_time()[source]
Convert time from SI units (seconds) to dimensionless CR3BP time units.
- Parameters:
- Returns:
Time in dimensionless CR3BP units
- Return type:
Notes
In the CR3BP, the time unit is chosen such that the mean motion is equal to 1, which means one dimensionless time unit corresponds to 1/n seconds, where n is the angular velocity in rad/s.
_si_time()
The _si_time()
function converts time from dimensionless CR3BP time units to SI units (seconds).
_velocity_scale_si_per_canonical()
The _velocity_scale_si_per_canonical()
function returns the scale factor to convert canonical CRTBP velocities to SI (m/s).
_get_distance()
The _get_distance()
function calculates physical distance between two bodies in meters.
- hiten.algorithms.utils.coordinates._get_distance()[source]
Calculate physical distance between two bodies in meters.
- Parameters:
state_1_nondim (np.ndarray[6,]) – First body’s dimensionless state vector
state_0_nondim (np.ndarray[6,]) – Second body’s dimensionless state vector
system_distance (float) – Actual distance between primary bodies in meters (conversion factor)
- Returns:
Physical distance between bodies in meters
- Return type: