Base Module
The base module provides high-level abstractions for the Circular Restricted Three-Body Problem (CR3BP).
This module bundles the physical information of a binary system, computes the mass parameter mu, instantiates the underlying vector field via rtbp_dynsys()
, and pre-computes the five classical Lagrange (libration) points.
System()
The main system class that provides a lightweight wrapper around the CR3BP dynamical system.
- class hiten.system.base.System[source]
Bases:
_HitenBase
Lightweight wrapper around the CR3BP dynamical system.
The class stores the physical properties of the primaries, computes the dimensionless mass parameter mu = m2 / (m1 + m2), instantiates the CR3BP vector field through
rtbp_dynsys()
, and caches the five Lagrange points.- Parameters:
- libration_points
Mapping from integer identifiers {1,…,5} to the corresponding libration point objects.
- Type:
- dynsys
Underlying vector field instance compatible with the integrators defined in
integrators
.- Type:
- var_dynsys
Underlying variational equations system.
- Type:
Notes
The heavy computations reside in the dynamical system and individual libration point classes; this wrapper simply orchestrates them.
- property primary: Body
Primary gravitating body.
- Returns:
The primary gravitating body.
- Return type:
- property secondary: Body
Secondary gravitating body.
- Returns:
The secondary gravitating body.
- Return type:
- property distance: float
Characteristic separation between the bodies.
- Returns:
The characteristic separation between the bodies in km.
- Return type:
- property mu: float
Mass parameter mu.
- Returns:
The mass parameter mu = m2 / (m1 + m2) (dimensionless).
- Return type:
- property libration_points: Dict[int, LibrationPoint]
Mapping from integer identifiers {1,…,5} to libration point objects.
- Returns:
Dictionary mapping integer identifiers {1,…,5} to libration point objects.
- Return type:
- property dynsys
Underlying vector field instance.
- Returns:
The underlying vector field instance.
- Return type:
- property var_dynsys
Underlying variational equations system.
- Returns:
The underlying variational equations system.
- Return type:
- property jacobian_dynsys
Underlying Jacobian evaluation system.
- Returns:
The underlying Jacobian evaluation system.
- Return type:
- get_libration_point(index)[source]
Access a pre-computed libration point.
- Parameters:
index (int) – Identifier of the desired point in {1, 2, 3, 4, 5}.
- Returns:
Requested libration point instance.
- Return type:
- Raises:
ValueError – If index is not in the valid range.
Examples
>>> sys = System(primary, secondary, distance) >>> L1 = sys.get_libration_point(1)
- propagate(initial_conditions, tf=6.283185307179586, *, steps=1000, method='adaptive', order=8, forward=1)[source]
Propagate arbitrary initial conditions in the CR3BP.
This helper is a thin wrapper around
_propagate_dynsys()
that avoids the need to instantiate aPeriodicOrbit
.- Parameters:
initial_conditions (Sequence[float]) – Six-element state vector [x, y, z, vx, vy, vz] expressed in canonical CR3BP units (nondimensional).
tf (float, default 2*pi) – Final time for integration in nondimensional units.
steps (int, default 1000) – Number of output nodes in the returned trajectory.
method ({"fixed", "adaptive", "symplectic"}, default "adaptive") – Integration backend to employ (Hiten integrators).
order (int, default 8) – Formal order of the integrator when applicable.
forward (int)
- Returns:
The propagated trajectory.
- Return type:
- classmethod from_bodies(primary_name, secondary_name)[source]
Factory method to build a
System
directly from body names.This helper retrieves the masses, radii and characteristic orbital distance of the selected primary/secondary pair from
Constants
and instantiates the correspondingBody
objects before finally returning the fully-initialisedSystem
instance.- Parameters:
- Returns:
Newly created CR3BP system.
- Return type:
- Raises:
ValueError – If the body names are not found in the constants database.
- __setstate__(state)[source]
Restore the System instance after unpickling.
The heavy, non-serialisable dynamical system is reconstructed lazily using the stored value of mu and the names of the primary and secondary bodies.
- Parameters:
state (dict) – Dictionary containing the serialized state of the System.