Invntr
Source

All instruments

orbit_kepler

Two-body (Kepler) orbits about any central body given by its GM (Earth by default): state vector to classical elements and back, period, specific energy and angular momentum, speeds at periapsis and apoapsis (vis-viva), escape and circular speed, hyperbolic excess speed and turn angle, and propagation in time by Kepler's equation (ellipse, hyperbola; Barker's equation on a parabola). Writes the orbit track as out/orbit.csv. Units: km, s, deg.

Field
Space and orbits
Version
0.1.0
Runs as
Compiled (Rust)
Typical run
0.02 s

Compiled from source: run sh packs/install.sh once before admitting it.

Known answers it must pass

Admission replayorbit_kepler 0.1.0 · files e5bd4e2e18ee…ced8
  1. r0001circular orbit 400 km above R=6378.137 km, GM=398600.4418: closed forms v=sqrt(GM/r)=7.66856 km/s, T=2pi sqrt(r^3/GM), v_esc=sqrt(2) v, energy=-GM/2r, h=sqrt(GM r) (rel 1e-9)passed

    v_mag_km_s7.66856 ± 7.7e-097.66856lockedunder 0.01 % of the tolerance used
    v_circular_km_s7.66856 ± 7.7e-097.66856lockedunder 0.01 % of the tolerance used
    period_s5553.62 ± 5.6e-065553.62lockedunder 0.01 % of the tolerance used
    v_escape_km_s10.845 ± 1.1e-0810.845lockedunder 0.01 % of the tolerance used
    specific_energy_km2_s2-29.4034 ± 2.9e-08-29.4034lockedunder 0.01 % of the tolerance used
    h_km2_s51978.5 ± 5.2e-0551978.5lockedunder 0.01 % of the tolerance used
    r_mag_km6778.14 ± 6.8e-096778.14lockedunder 0.01 % of the tolerance used
  2. r0002sidereal-day period 86164.09 s, e=0: Kepler's third law a=(GM T^2/4pi^2)^(1/3)=42164.17 km (geostationary radius), v=sqrt(GM/a) (rel 1e-9)passed

    a_km42164.2 ± 4.2e-0542164.2lockedunder 0.01 % of the tolerance used
    r_mag_km42164.2 ± 4.2e-0542164.2lockedunder 0.01 % of the tolerance used
    v_mag_km_s3.07466 ± 3.1e-093.07466lockedunder 0.01 % of the tolerance used
  3. r0003frame conventions by inspection: r=[0,7000,0], v=[0,0,7] (below circular, so apoapsis) gives i=90, raan=90, argp=180, nu=180, e=1-R v^2/GM, a=R/(1+e); round trip state->elements->state exact (closed form, rel 1e-9)passed

    i_deg90 ± 1e-0990lockedunder 0.01 % of the tolerance used
    raan_deg90 ± 1e-0990lockedunder 0.01 % of the tolerance used
    argp_deg180 ± 1e-09180lockedunder 0.01 % of the tolerance used
    true_anomaly_deg180 ± 1e-09180lockedunder 0.01 % of the tolerance used
    e0.139489 ± 1.4e-100.139489lockedunder 0.01 % of the tolerance used
    a_km6143.1 ± 6.1e-066143.1lockedunder 0.01 % of the tolerance used
    periapsis_radius_km5286.21 ± 5.3e-065286.21lockedunder 0.01 % of the tolerance used
    apoapsis_radius_km7000 ± 7e-067000lockedunder 0.01 % of the tolerance used
    roundtrip_rel_error≤ 1e-122.71769e-16lockedinside the range
  4. r0004Kepler's equation, ellipse a=10000 km e=0.5 from periapsis, dt=(pi/2-e) sqrt(a^3/GM)=1696.0474 s: exact solution E=90 deg, so r=a and nu=acos(-e)=120 deg (rel 1e-9)passed

    r_end_mag_km10000 ± 1e-0510000lockedunder 0.01 % of the tolerance used
    true_anomaly_end_deg120 ± 1.2e-07120lockedunder 0.01 % of the tolerance used
    mean_anomaly_end_deg61.3521 ± 6.1e-0861.3521lockedunder 0.01 % of the tolerance used
    energy_rel_change≤ 1e-121.96085e-15lockedinside the range
    h_rel_change≤ 1e-121.4878e-16lockedinside the range
  5. r0005Barker's equation, parabola e=1 periapsis 500 km: from periapsis dt=(2/3) sqrt(p^3/GM) (p=2 r_p) reaches nu=90 deg at r=p; v_p=sqrt(2GM/r_p) escape speed (closed form, rel 1e-9)passed

    orbit_type= parabolicparaboliclockedexact match
    true_anomaly_end_deg90 ± 9e-0890lockedunder 0.01 % of the tolerance used
    r_end_mag_km13756.3 ± 1.4e-0513756.3lockedunder 0.01 % of the tolerance used
    v_periapsis_km_s10.7659 ± 1.1e-0810.7659lockedunder 0.01 % of the tolerance used
    specific_energy_km2_s20 ± 1e-09-7.10543e-15lockedunder 0.01 % of the tolerance used
  6. r0006hyperbolic Kepler equation, e=2 periapsis 500 km: turn angle 2 asin(1/e)=60 deg, v_inf=sqrt(GM(e-1)/r_p); from periapsis dt=(2 sqrt3 - ln(2+sqrt3))/n reaches H=ln(2+sqrt3), nu=90 deg, r=p=3 r_p (exact solution, rel 1e-9)passed

    turn_angle_deg60 ± 6e-0860lockedunder 0.01 % of the tolerance used
    v_infinity_km_s7.61261 ± 7.6e-097.61261lockedunder 0.01 % of the tolerance used
    a_km-6878.14 ± 6.9e-06-6878.14lockedunder 0.01 % of the tolerance used
    true_anomaly_end_deg90 ± 9e-0890lockedunder 0.01 % of the tolerance used
    r_end_mag_km20634.4 ± 2.1e-0520634.4lockedunder 0.01 % of the tolerance used
  7. r0007Curtis, Orbital Mechanics for Engineering Students, Example 4.3: r=[-6045,-3490,2500] km, v=[-3.457,6.618,2.533] km/s gives h=58310, i=153.2, raan=255.3, e=0.1712, argp=20.07, nu=28.45, a=8788 (textbook prints 4 figures: tolerance half the last digit); one period of propagation returns the start (exact, 1e-9 relative)passed

    h_km2_s58310 ± 558311.7locked33 % of the tolerance used
    i_deg153.2 ± 0.05153.249locked98 % of the tolerance used
    raan_deg255.3 ± 0.05255.279locked41 % of the tolerance used
    e0.1712 ± 5e-050.171211locked22 % of the tolerance used
    argp_deg20.07 ± 0.00520.0681locked37 % of the tolerance used
    true_anomaly_deg28.45 ± 0.00528.4458locked84 % of the tolerance used
    a_km8788 ± 0.58788.08locked16 % of the tolerance used
    position_change_km≤ 1e-055.92918e-12lockedinside the range
    velocity_change_km_s≤ 1e-085.65233e-15lockedinside the range
    energy_rel_change≤ 1e-126.26623e-16lockedinside the range
    h_rel_change≤ 1e-121.28617e-16lockedinside the range
7 of 7 cases passed · sandbox macos-seatbeltrecorded from the kernel in a fresh lab

Each line is one reading the kernel checked. The bright band is the tolerance; the needle is the value the instrument actually returned when it was admitted. A needle near the centre line used little of its tolerance.

Inputs

NameUnitDefaultMeaning
gm_km3_s2km^3/s^2398600.4418Gravitational parameter GM of the central body. Default: the Earth (WGS 84 / EGM96 value 398600.4418).
body_radius_kmkm6378.137Radius of the central body; altitudes are measured above it. Default: the Earth's equatorial radius (WGS 84). 0 measures from the centre.
r_kmkmState mode: position [x, y, z] in an inertial frame centred on the body. Give with v_km_s and no elements.
v_km_skm/sState mode: velocity [vx, vy, vz]. Give with r_km.
a_kmkmElements mode, size: semi-major axis (positive on an ellipse, negative on a hyperbola). Give exactly one of a_km, period_s, h_km2_s, periapsis_altitude_km.
period_ssElements mode, size: orbital period (closed orbits only).
h_km2_skm^2/sElements mode, size: specific angular momentum.
periapsis_altitude_kmkmElements mode, size: periapsis altitude above body_radius_km; with apoapsis_altitude_km (then leave e out) or with e.
apoapsis_altitude_kmkmElements mode: apoapsis altitude; needs periapsis_altitude_km.
e1Eccentricity: 0 circle, below 1 ellipse, 1 parabola, above 1 hyperbola. 0 when left out.
i_degdegInclination. 0 when left out.
raan_degdegRight ascension of the ascending node. 0 when left out.
argp_degdegArgument of periapsis. 0 when left out.
true_anomaly_degdegTrue anomaly at the epoch. 0 (periapsis) when left out.
dt_ss0Propagate this long from the epoch by Kepler's equation (negative goes back).
propagate_periods10Also propagate this many orbital periods (closed orbits only); added to dt_s.
samples1361Rows in out/orbit.csv: one period evenly in time (closed orbit), or a sweep of true anomaly about periapsis (open orbit).

Readings

NameUnitMeaning
mode1"state" or "elements": which inputs defined the orbit
orbit_type1circular, elliptic, parabolic or hyperbolic
gm_km3_s2km^3/s^2
body_radius_kmkm
a_kmkmsemi-major axis; null on a parabola
p_kmkmsemi-latus rectum h^2/GM
e1
i_degdeg
raan_degdeg
argp_degdeg
true_anomaly_degdeg
mean_anomaly_degdegnull on a parabola
time_since_periapsis_ss
period_ssnull on an open orbit
mean_motion_rad_srad/s
specific_energy_km2_s2km^2/s^2
h_km2_skm^2/s
periapsis_radius_kmkm
apoapsis_radius_kmkm
periapsis_altitude_kmkm
apoapsis_altitude_kmkm
v_periapsis_km_skm/s
v_apoapsis_km_skm/s
v_infinity_km_skm/shyperbolic excess speed; null unless hyperbolic
turn_angle_degdeghyperbolic turn angle 2 asin(1/e); null unless hyperbolic
r_kmkm
v_km_skm/s
r_mag_kmkm
v_mag_km_skm/s
altitude_kmkm
v_circular_km_skm/s
v_escape_km_skm/s
dt_ss
r_end_kmkm
v_end_km_skm/s
r_end_mag_kmkm
v_end_mag_km_skm/s
altitude_end_kmkm
true_anomaly_end_degdeg
mean_anomaly_end_degdeg
position_change_kmkm
velocity_change_km_skm/s
energy_rel_change1
h_rel_change1
roundtrip_rel_error1state -> elements -> state, relative
kepler_iterations1
clears_body1
warnings1
conventions1
orbit_csv_rows1

Try the call

Change a value and the command updates. Nothing runs here; paste it into your terminal or give it to your agent.

Terminal
MCP call