At engine cutoff, we compute osculating orbital elements to evaluate mission success.
LaTeX Reference
This section corresponds to Section 7 of nm_final_project.tex (Equations 18-21).
The Two-Body Problem¶
After leaving the atmosphere, the rocket follows a Keplerian orbit around Earth.
Assumptions¶
- Point masses: Earth and spacecraft treated as point masses
- No perturbations: No atmospheric drag, solar radiation, or third-body effects
- Spherical Earth: Gravitational field is \(\mu/r^2\)
Governing Equation¶
Where \(\mu = GM_\oplus = 3.986 \times 10^{14}\) m³/s².
Step 1: Specific Orbital Energy¶
Derivation¶
The total mechanical energy per unit mass is conserved:
Step 1.1: Kinetic energy per unit mass = \(\frac{1}{2}v^2\)
Step 1.2: Potential energy per unit mass = \(-\frac{\mu}{r}\) (zero at infinity)
Step 1.3: Sum gives specific orbital energy:
Physical Interpretation¶
| \(\varepsilon\) | Orbit Type |
|---|---|
| \(\varepsilon < 0\) | Bound (elliptical) |
| \(\varepsilon = 0\) | Parabolic (escape) |
| \(\varepsilon > 0\) | Hyperbolic (escape) |
Implementation:
# [Eq. 18] Specific orbital energy
eps = 0.5 * v * v - mu / r
Step 2: Specific Angular Momentum¶
Derivation¶
Angular momentum per unit mass is also conserved:
For planar motion:
Where \(v_\perp = v\cos\gamma\) is the tangential velocity component.
Physical Interpretation¶
- \(h = 0\): Radial motion (impact trajectory)
- Maximum \(h\) for given energy: Circular orbit
- \(\gamma = 0\): All velocity is tangential (\(h = rv\))
Implementation:
# [Eq. 19] Specific angular momentum
h_ang = r * v * jnp.cos(gamma)
Step 3: Eccentricity¶
Derivation¶
The eccentricity relates energy and angular momentum:
Step 3.1: Start from the vis-viva equation:
Step 3.2: For an ellipse:
Step 3.3: The semi-latus rectum is:
Step 3.4: Eccentricity from \(p = a(1 - e^2)\):
Numerical Guard¶
To handle numerical errors that might give \(e^2 < 0\):
Implementation:
# [Eq. 20] Eccentricity with numerical guard
e = jnp.sqrt(jnp.maximum(0.0, 1.0 + (2.0 * eps * h_ang * h_ang) / (mu * mu)))
Eccentricity Values¶
| \(e\) | Orbit Type |
|---|---|
| \(e = 0\) | Circular |
| \(0 < e < 1\) | Elliptical |
| \(e = 1\) | Parabolic |
| \(e > 1\) | Hyperbolic |
Mission Goal
For circular orbit insertion, we want \(e \approx 0\) (typically \(e < 0.001\)).
Step 4: Semi-Major Axis¶
Derivation¶
From the energy equation:
Solving for \(a\):
Bound Orbits Only
This formula is valid only for \(\varepsilon < 0\) (bound orbits).
Implementation:
# [Eq. 21] Semi-major axis (valid for bound orbits)
a = -mu / (2.0 * eps)
Step 5: Apoapsis and Periapsis¶
Derivation¶
For an ellipse with semi-major axis \(a\) and eccentricity \(e\):
Altitudes above Earth's surface:
Implementation:
r_apo = a * (1.0 + e)
r_peri = a * (1.0 - e)
Mission Success Criteria¶
For a circular orbit at target altitude \(h_{\text{target}}\):
Target State¶
Success Metrics¶
| Metric | Definition | Target |
|---|---|---|
| Eccentricity | \(e\) | \(< 0.001\) |
| Altitude error | \(a - r_{\text{target}}\) | \(< 2\) km |
| Velocity error | \(v - v_{\text{circular}}\) | \(< 5\) m/s |
| Flight-path angle | \(\gamma\) | \(< 0.1°\) |
Complete Implementation¶
def orbit_diagnostics(*, y: Array, earth: EarthParams):
"""Two-body orbit diagnostics at cutoff per LaTeX Report (Section 7).
Equations:
- Specific Energy (epsilon): [Eq. 18]
- Specific Angular Momentum (h): [Eq. 19]
- Eccentricity (e): [Eq. 20]
- Semi-major Axis (a): [Eq. 21]
"""
r = y[_R]
v = y[_V]
gamma = y[_GAMMA]
mu = earth.mu
# [Eq. 18] Specific energy
eps = 0.5 * v * v - mu / r
# [Eq. 19] Specific angular momentum
h_ang = r * v * jnp.cos(gamma)
# [Eq. 20] Eccentricity
e = jnp.sqrt(jnp.maximum(0.0, 1.0 + (2.0 * eps * h_ang * h_ang) / (mu * mu)))
# [Eq. 21] Semi-major axis
a = -mu / (2.0 * eps)
# Apoapsis and periapsis
r_apo = a * (1.0 + e)
r_peri = a * (1.0 - e)
return eps, h_ang, a, e, r_apo, r_peri
Orbital Parameters in Output¶
The simulation returns orbital diagnostics in the JSON output:
{
"trajectory": {
"orbit": {
"specific_energy": -2.94e7,
"specific_angular_momentum": 5.13e10,
"semi_major_axis": 6578137,
"eccentricity": 0.000498,
"apoapsis": 6581414,
"periapsis": 6574860
}
}
}
References¶
-
Battin, R.H. (1999). An Introduction to the Mathematics and Methods of Astrodynamics. AIAA Education Series. Chapters 3-4.
-
Curtis, H.D. (2013). Orbital Mechanics for Engineering Students. Butterworth-Heinemann. Chapter 2 - "The Two-Body Problem".
-
Vallado, D.A. (2013). Fundamentals of Astrodynamics and Applications. Microcosm Press. Chapter 2.
Next Steps¶
- Flight Phases - Hybrid system dynamics
- Shooting Method - How we achieve circular orbits