Vibeship-spawner-skills orbital-mechanics

id: orbital-mechanics

install
source · Clone the upstream repo
git clone https://github.com/vibeforge1111/vibeship-spawner-skills
manifest: space/orbital-mechanics/skill.yaml
source content

id: orbital-mechanics name: Orbital Mechanics category: space version: 1.0.0 description: > Use when computing orbits, planning maneuvers, propagating trajectories, or analyzing orbital perturbations for spacecraft or celestial bodies.

triggers:

  • "orbit"
  • "trajectory"
  • "maneuver"
  • "delta-v"
  • "Hohmann"
  • "Keplerian"
  • "perturbation"
  • "J2"
  • "TLE"
  • "orbital elements"
  • "semi-major axis"
  • "eccentricity"
  • "inclination"
  • "RAAN"
  • "spacecraft propagation"
  • "Lambert solver"
  • "interplanetary"

provides:

  • name: orbital_element_computation description: Convert between state vectors and Keplerian orbital elements
  • name: orbit_propagation description: Propagate orbits with two-body and perturbation models
  • name: maneuver_planning description: Calculate delta-v for Hohmann, bi-elliptic, and plane change maneuvers
  • name: interplanetary_design description: Patched conic approximation for interplanetary missions

knowledge_base: fundamental_constants: gravitational_parameters: sun_mu: "1.32712440018e11 km^3/s^2" earth_mu: "3.986004418e5 km^3/s^2" moon_mu: "4.9028695e3 km^3/s^2" mars_mu: "4.282837e4 km^3/s^2" jupiter_mu: "1.26686534e8 km^3/s^2" planetary_radii: earth_equatorial: "6378.137 km" moon: "1737.4 km" mars: "3396.2 km" earth_parameters: j2: "1.08263e-3" rotation_rate: "7.2921159e-5 rad/s" astronomical_unit: "149597870.7 km"

orbital_elements: classical: - name: a description: Semi-major axis (km) - size of orbit - name: e description: Eccentricity (0=circular, 0-1=ellipse, 1=parabolic, >1=hyperbolic) - name: i description: Inclination (rad) - tilt from reference plane - name: RAAN description: Right Ascension of Ascending Node (rad) - orientation of orbital plane - name: omega description: Argument of periapsis (rad) - orientation of orbit in plane - name: nu description: True anomaly (rad) - position in orbit derived: - period: "2pisqrt(a^3/mu) for elliptical orbits" - periapsis: "a*(1-e)" - apoapsis: "a*(1+e) for e<1" - specific_energy: "-mu/(2a)" - specific_angular_momentum: "sqrt(mua*(1-e^2))"

kepler_equation: description: "M = E - e*sin(E) relates mean anomaly to eccentric anomaly" solution_method: "Newton-Raphson iteration" initial_guess: "E=M for e<0.8, E=pi for e>=0.8" convergence_tolerance: "1e-10 rad typical"

coordinate_transformations: frames: - ECI: "Earth-Centered Inertial" - ECEF: "Earth-Centered Earth-Fixed" - perifocal: "PQW frame in orbital plane" conversions: - "elements_to_state: Orbital elements to position/velocity vectors" - "state_to_elements: Position/velocity to orbital elements"

propagation_methods: two_body: description: "Simple Keplerian motion, ignores perturbations" uses: "Fast, analytic, short-term predictions" cowell: description: "Direct numerical integration of equations of motion" uses: "General purpose, handles all perturbations" encke: description: "Integrate deviation from reference orbit" uses: "More accurate for near-Keplerian orbits"

perturbations: j2: description: "Earth oblateness - dominant perturbation for LEO" effects: - "RAAN drift (nodal precession)" - "Argument of periapsis drift (apsidal precession)" equations: raan_dot: "-3/2 * J2 * (R_e/p)^2 * n * cos(i)" omega_dot: "-3/2 * J2 * (R_e/p)^2 * n * (2 - 5/2sin^2(i))" drag: description: "Atmospheric drag - significant below 1000 km" model: "Exponential atmosphere, a_drag = -0.5CdA/mrho*v^2" third_body: description: "Sun/Moon gravitational influence - significant for high orbits" solar_radiation_pressure: description: "Photon pressure on spacecraft surfaces"

maneuvers: hohmann_transfer: description: "Most fuel-efficient two-impulse transfer between coplanar circular orbits" delta_v1: "sqrt(mu*(2/r1 - 1/a_t)) - sqrt(mu/r1)" delta_v2: "sqrt(mu/r2) - sqrt(mu*(2/r2 - 1/a_t))" time_of_flight: "pisqrt(a_t^3/mu)" bielliptic_transfer: description: "Three-impulse transfer, more efficient when r2/r1 > 11.94" plane_change: description: "Most efficient at apoapsis where velocity is lowest" delta_v: "2v*sin(delta_i/2)" combined_maneuver: description: "Combined plane change and orbit raise more efficient than separate" phasing: description: "Adjust orbit period to change relative phase angle"

interplanetary: patched_conic: description: "Divide trajectory into sphere of influence regions" phases: - "Departure hyperbola (escape from departure planet)" - "Heliocentric transfer ellipse" - "Arrival hyperbola (capture at arrival planet)" c3: description: "Characteristic energy = v_infinity^2" unit: "km^2/s^2" gravity_assist: description: "Use planetary flyby to change velocity direction/magnitude" turn_angle: "2*arcsin(1/e) where e = 1 - r_p/a"

patterns:

  • name: orbit_determination steps:

    • "Collect position/velocity observations"
    • "Initial orbit determination (IOD) from multiple observations"
    • "Differential correction to refine orbit"
    • "Convert to standard orbital elements"
    • "Validate with propagation vs observations"
  • name: maneuver_sequence steps:

    • "Define initial and target orbits"
    • "Select transfer type (Hohmann, bi-elliptic, etc.)"
    • "Calculate delta-v requirements"
    • "Add margins for navigation uncertainty"
    • "Determine burn times and directions"
    • "Verify final orbit achieved"
  • name: orbit_maintenance steps:

    • "Define orbit tolerance box"
    • "Propagate with perturbations"
    • "Predict when leaving tolerance"
    • "Plan station-keeping maneuvers"
    • "Budget delta-v for mission lifetime"

anti_patterns:

  • name: ignoring_j2_for_leo problem: "Predictions diverge within hours" solution: "Include J2 perturbation at minimum for LEO"
  • name: two_body_long_propagation problem: "Misses secular drifts over time" solution: "Use perturbation model for multi-day propagation"
  • name: hohmann_always_optimal problem: "Not true for large orbit ratio transfers" solution: "Consider bi-elliptic when r2/r1 > 11.94"
  • name: ignoring_sphere_of_influence problem: "Using wrong gravity source" solution: "Properly model patched conic transitions"
  • name: plane_change_at_periapsis problem: "Maximum delta-v waste" solution: "Perform plane changes at apoapsis where velocity is lowest"

checklist: orbit_definition: - "Orbital elements defined (a, e, i, RAAN, omega, nu)" - "Coordinate frame specified (ECI, ECEF, etc.)" - "Epoch time established" propagation: - "Perturbation model selected for mission duration" - "J2 included for LEO (< 2000 km)" - "Drag model for altitudes < 1000 km" - "Third-body effects for high orbits" maneuver_planning: - "Transfer type selected (Hohmann, bi-elliptic, etc.)" - "Combined maneuvers considered" - "Fuel margins calculated" - "Backup maneuver windows identified" interplanetary: - "Patched conic approximation set up" - "Launch window identified" - "Gravity assists evaluated" - "Capture strategy defined"