An interactive, browser-based Mars mission simulator that turns simplified orbital mechanics and rocket-engineering maths into a visual mission story. Adjust the mission and spacecraft, and watch the transfer orbit, travel time, fuel and feasibility update live. No prior knowledge of orbital mechanics or the codebase is required.
This is an educational project. Its goal is to show that planning a Mars mission is not a single “correct answer”: it is a set of engineering trade-offs between fuel, speed, mass, engine choice and risk.
The simulator converts the underlying formulas into an interactive experience: change a value, and the maths, the 3D flight path and the mission verdict all respond together. This makes the relationship between the numbers and the real-world decisions visible.
Students, teachers, project reviewers and non-specialist viewers.
All of the following are implemented and live across the Mission and Maths pages.
Sun, Earth, Mars, orbit rings and an animated spacecraft, with a cinematic intro and a free-orbit camera.
Drawn from the current mission values, not a hard-coded decorative curve.
Earth and Mars orbit radii, spacecraft dry mass, fuel mass and engine exhaust velocity, with number fields and sliders.
Each formula shown as general form, then substituted values, then final answer, rendered with KaTeX.
With a step-by-step worked example and its own inputs.
With a visual bar chart.
With mission-day and progress tracking, plus play, pause and reset controls.
Feasible, Risky or Impossible, with plain-English reasoning.
Fuel Mass, Engine Efficiency, Transfer Time and Mission Risk, all reading from the live simulator values.
Mars, Ceres and Jupiter, for comparison.
Because this is a live web app, the best way to see the simulator is to open it. Each page below is fully interactive.
This is a Next.js application. The interactive pages are React client components behind thin server routes, sharing one physics module as a single source of truth.
You need Node.js (which includes npm). There are no other prerequisites, no environment variables and no config files to create.
git clone <repository-url> cd natalie npm install # Start the dev server (Turbopack) npm run dev # then open http://localhost:3000
For a production build:
npm run build # compile the app npm run start # serve the production build
The dev server (port 3000) hot-reloads as you edit. That home page links to the Mission, Maths and Project pages, and to this documentation.
The repository ships a multi-stage Dockerfile that produces a self-contained standalone build (Node 20). No extra configuration is required.
docker build -t mars-mission . docker run --rm -p 8080:8080 mars-mission # then open http://localhost:8080
The container serves the Next.js standalone server on port 8080 as a non-root user; the build output includes only a pruned node_modules.
All physics lives in app/lib/hohmannTransfer.ts and uses the constants in app/lib/constants.ts. Internally everything is SI (metres, seconds, kilograms); results are converted to km/s and days for display.
The transfer orbit is an ellipse that touches Earth's orbit at one end and Mars's orbit at the other. Its semi-major axis a is simply the average of the two orbit radii.
Half of the transfer ellipse's orbital period: the time to coast from Earth's orbit to Mars's orbit.
The speed of a body on a circular orbit at distance r from the Sun. Used for the circular speeds of Earth and Mars.
The vis-viva equation gives the spacecraft's speed at any distance r on an orbit of semi-major axis a. The difference from the circular speed gives each burn's delta-v.
The two burns added together give the total delta-v the transfer needs.
How much velocity change the spacecraft can actually produce with the fuel it carries.
The mission status compares the available delta-v (rocket equation) against the required delta-v (Hohmann transfer):
This is an educational, simplified simulator, not a full mission-planning tool. It deliberately assumes:
Real Mars missions require far more advanced modelling: finite-thrust burns, n-body gravity, launch windows, navigation error, entry, descent and landing, radiation and life-support budgets.
There is no automated test runner; validation is done by inspection in the browser. When checking the app, confirm:
Earth r₁ = 1.0 AU and Mars r₂ = 1.524 AU give a transfer time near 259 days and a total delta-v near 5.6 km/s, consistent with the textbook Hohmann values, allowing for the simplifications above.
The four interactive pages live under app/, each as a React client component behind a thin server route. The physics and constants are shared modules.
. ├── app/ │ ├── page.tsx + mars-mission.tsx # Home page (entry point) │ ├── mission/ page.tsx, mission.tsx, scenes.ts # 3D scene, timeline, telemetry │ ├── maths/ page.tsx, maths.tsx # constants, formulas, calculator, trade-offs │ ├── project/ page.tsx, plan.tsx # stages, deliverables, skills, reflection │ ├── readme/ page.tsx, readme.tsx # this documentation page │ ├── lib/ constants.ts, hohmannTransfer.ts # shared physics (single source of truth) │ ├── starfield.tsx # shared starfield + responsive hook │ ├── layout.tsx, globals.css │ ├── public/research/ # research-note evidence images ├── Dockerfile # multi-stage, standalone Next.js build ├── next.config.ts # output: "standalone" └── package.json
Not yet implemented, but realistic next steps, separate from the features above:
An educational Mars mission simulator: maths, engineering and software combined into one interactive mission story.