ADCS.orbits.helpers.orbit_factory module¶
- ADCS.orbits.helpers.orbit_factory.create_random_circular_orbit(radius_km, dt, tf, J2000=0.22, fast=False, rng=None, zonal_J=2)[source]¶
Creates an initialized Orbit object based on a random circular orbital state.
This function utilizes
create_random_circular_os()to generate the initial conditions \(\mathbf{R}\) and \(\mathbf{V}\). It then initializes the orbit propagator.The end time is calculated as:
\[t_{end} = t_{start} + t_{f} \cdot C_{sec2cent}\]where \(C_{sec2cent}\) is the conversion factor from seconds to centuries.
- Parameters:
radius_km (float) – The orbital radius in kilometers.
dt (float) – The simulation time step in seconds.
tf (float) – The total simulation duration in seconds.
J2000 (float) – The start time in J2000 centuries. Defaults to 0.22.
fast (bool) – Flag to enable fast propagation mode (reduced precision).
zonal_J (int) – Highest zonal harmonic degree to include.
0disables zonals,2includes only J2, and larger values include every zonal term up to that degree.rng (Generator | None)
- Returns:
The fully initialized orbit object.
- Return type:
- ADCS.orbits.helpers.orbit_factory.create_random_circular_os(radius_km, J2000=0.22, ephem=None, rng=None)[source]¶
Generates a random orbital state for a circular orbit with a specified radius.
The position vector \(\mathbf{R}\) is generated by sampling a random vector \(\mathbf{x}\) from a standard normal distribution \(\mathcal{N}(0, I_3)\) and normalizing it to lie on the unit sphere, then scaling by the radius \(r\):
\[ \begin{align}\begin{aligned}\hat{\mathbf{r}} = \frac{\mathbf{x}}{\|\mathbf{x}\|}\\\mathbf{R} = r \cdot \hat{\mathbf{r}}\end{aligned}\end{align} \]The velocity vector \(\mathbf{V}\) is generated by creating a random tangent direction. A second random vector \(\mathbf{v}_{rand}\) is sampled and projected onto the plane tangent to \(\hat{\mathbf{r}}\):
\[ \begin{align}\begin{aligned}\mathbf{v}_{tan} = \mathbf{v}_{rand} - (\mathbf{v}_{rand} \cdot \hat{\mathbf{r}}) \hat{\mathbf{r}}\\\hat{\mathbf{v}} = \frac{\mathbf{v}_{tan}}{\|\mathbf{v}_{tan}\|}\end{aligned}\end{align} \]The magnitude is set to the circular velocity \(v_{circ}\):
\[ \begin{align}\begin{aligned}v_{circ} = \sqrt{\frac{\mu}{r}}\\\mathbf{V} = v_{circ} \cdot \hat{\mathbf{v}}\end{aligned}\end{align} \]- Parameters:
radius_km (float) – The orbital radius in kilometers.
J2000 (float) – The current time in J2000 centuries. Defaults to 0.22.
ephem (
Ephemeris, optional) – Optional ephemeris object. If None, a new one is created.rng (Generator | None)
- Returns:
The generated orbital state.
- Return type: