feat: voyage modules — Spacecraft, Brachistochrone, MissionPlanner (proposal / no obligation)#92
Draft
tymrtn wants to merge 3 commits intotyppo:masterfrom
Draft
feat: voyage modules — Spacecraft, Brachistochrone, MissionPlanner (proposal / no obligation)#92tymrtn wants to merge 3 commits intotyppo:masterfrom
tymrtn wants to merge 3 commits intotyppo:masterfrom
Conversation
Implements a brachistochrone (constant-acceleration flip-and-burn) trajectory solver with iterative lead-angle rendezvous and a velocity-matching addendum for endpoint Δv. For high-thrust, high-Δv propulsion concepts — fusion drives, beam- target ignition systems — the brachistochrone is the natural mission profile. This module solves the single-leg case and returns flight time, Δv components, peak velocity, arrival JD, and a sampled trajectory suitable for rendering. Tested against three reference cases (Earth→Mars, Earth→Jupiter, Earth→Pluto) at 0.43 g; results align with the parametric estimates in Martin (2026), arxiv submission pending. 27 new unit tests. Refs: docs/superpowers/specs and Martin (2026) "Phase Space Reframing for Directed Fusion Exhaust" Section 4.3. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
…nting Spacecraft is a plain physics class — drive (v_e, max accel), dry/wet mass — with helpers for the rocket-equation Δv → propellant conversion and a stateAfterDeltaV snapshot useful for live-mission telemetry. Includes DRIVE_PB11_REFERENCE preset with v_e = 0.034c and a_max = 0.43g per Martin (2026) reference architecture. Validates against paper Section 4.3 propellant fraction (28-31% for Δv ≈ 0.012c on a 1000-tonne dry mass). 23 new unit tests. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Adds a multi-leg mission planner that sequences brachistochrone legs for grand-tour voyages (e.g. Earth → Saturn → Neptune). Tracks cumulative Δv, propellant burn per leg via the rocket equation, and mission feasibility against the paper's 60% propellant-fraction threshold. findActiveLeg() supports timeline-scrubbing UI. Also normalizes the new modules for Spacekit's tsconfig (no class accessors at default ES3 target; Orbit constructor needs explicit options arg; getPositionAtTime needs explicit second arg). Renames test-internal helpers to module-specific names to avoid collision when re-exported via index.ts. 22 new MissionPlanner tests; 162/162 total tests passing; bundle builds clean to 739 KB minified ESM/CJS/IIFE. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
❌ Deploy Preview for thunderous-lolly-07875e failed.
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Hi Ian — opening this as a draft for your consideration. Zero pressure to merge; the work lives happily as a fork at
tymrtn/spacekitand we'll keep it there if the scope is too far from where you want Spacekit to go.What this adds
Three new modules layered on top of Spacekit's existing visualization primitives, aimed at users who want to render active missions (vehicles, trajectories) alongside the passive solar-system bodies Spacekit already supports beautifully:
Brachistochrone.ts— single-leg trajectory solver for high-thrust, high-Δv propulsion. Iterative lead-angle rendezvous against a targetEphem, plus a velocity-matching addendum for the endpoint Δv. Returns flight time, Δv components, peak velocity, and a sampled trajectory suitable for rendering as aLine. Pure function, no Three.js dependency. 27 tests cover Earth→Mars, Earth→Jupiter, Earth→Pluto at multiple acceleration levels, plus iteration-budget edge cases.Spacecraft.ts— drive spec (exhaustVelocityMs,maxAccelG,label), mass partitioning (dry/propellant tonnes), and Tsiolkovsky helpers (propellantForDeltaV,deltaVForWetMass,spacecraftStateAfterDeltaV). Includes aDRIVE_PB11_REFERENCEpreset (v_e ≈ 0.034c, 0.43g) for the demo I'm using, but the API is drive-agnostic — anyone could plug in chemical, nuclear-thermal, ion, or antimatter constants. 23 tests.MissionPlanner.ts— multi-leg orchestrator (e.g. Earth → Saturn → Neptune) that chains brachistochrone legs, accumulates Δv, back-allocates per-leg propellant via the rocket equation, and exposesfindActiveLeg(missionT)for timeline/scrubber UI. 22 tests.All three sit alongside
SpaceObject,Orbit, etc. insrc/, with tests intest/matching your existing convention. Total: 162/162 tests passing (90 upstream + 72 new). Bundle builds clean to ~739 KB minified.Ran
pnpm testandpnpm run buildagainst your master + my changes. No regressions in upstream behavior; new code is additive.Why this might fit (and why it might not)
Live demo
Built a concept-paper companion that uses these modules end-to-end: https://u1f99e.com/labs/pb11-directed-exhaust/voyage-sim — pick a destination, watch the brachistochrone trajectory, zoom into the spacecraft. The site uses the bundle from this branch. Companion to a research paper on proton-boron fusion propulsion — credit to your library is in the disclaimer.
Notes on style
Orbit(ephem, {})two-arg pattern).__brachistochroneTest,__spacecraftTest) to avoid collision underexport *.Units.tsif you'd prefer.Either way, thanks for Spacekit — it's a beautiful library and made this companion piece feasible.
— Tyler / Lobster Labs