Mars Mission
MissionMathsProjectDocsPresentation
Project Documentation

Design a Mars Mission

Interactive Mission Simulator

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.

Earth-to-Mars transfer orbits (Hohmann transfer)Transfer time in daysRequired delta-v for the transferAvailable spacecraft delta-v (Tsiolkovsky rocket equation)Fuel mass and engine efficiencyMission feasibility and risk (Feasible / Risky / Impossible)Engineering trade-offs between competing priorities
01 · Purpose

Why this project exists

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.

Intended audience

Students, teachers, project reviewers and non-specialist viewers.

02 · Features

What the simulator does

All of the following are implemented and live across the Mission and Maths pages.

Interactive 3D mission visualisation

Sun, Earth, Mars, orbit rings and an animated spacecraft, with a cinematic intro and a free-orbit camera.

Dynamically calculated Hohmann transfer orbit

Drawn from the current mission values, not a hard-coded decorative curve.

Adjustable mission inputs

Earth and Mars orbit radii, spacecraft dry mass, fuel mass and engine exhaust velocity, with number fields and sliders.

Live maths panel

Each formula shown as general form, then substituted values, then final answer, rendered with KaTeX.

Rocket-equation calculation

With a step-by-step worked example and its own inputs.

Required vs available delta-v comparison

With a visual bar chart.

Mission timeline and animated spacecraft

With mission-day and progress tracking, plus play, pause and reset controls.

Mission status

Feasible, Risky or Impossible, with plain-English reasoning.

Engineering trade-off cards

Fuel Mass, Engine Efficiency, Transfer Time and Mission Risk, all reading from the live simulator values.

Alternative destinations

Mars, Ceres and Jupiter, for comparison.

03 · See it live

Explore the pages

Because this is a live web app, the best way to see the simulator is to open it. Each page below is fully interactive.

Mission

Earth, Mars, orbit rings and the animated spacecraft on the calculated transfer path.

Maths

Formula cards, the required-vs-available delta-v comparison and the trade-off cards.

Project

Stages, deliverables, skills and the research-note evidence.

04 · Technology

How it is built

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.

Framework
Next.js 16 (App Router) + React 19
Language
TypeScript
Styling
Inline styles on a Tailwind v4 base, with a small app/globals.css; fonts wired via next/font
3D graphics
Three.js r128 + OrbitControls + CSS2DRenderer (bundled, pinned to r128)
Formula rendering
KaTeX 0.16 (bundled, rendered on the server)
Shared physics
TypeScript modules: app/lib/constants.ts, app/lib/hohmannTransfer.ts (single source of truth)
Fonts
Google Fonts via next/font: Space Grotesk, IBM Plex Sans, IBM Plex Mono
Tooling
npm, ESLint, Turbopack
Deployment
Standalone output + a multi-stage Dockerfile (Node 20)
05 · Setup

Running it locally

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.

06 · Docker

Running in a container

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.

07 · Mathematics

How the maths works

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.

Hohmann transfer semi-major axis
a = (r₁ + r₂) / 2

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.

  • r₁: Earth's orbital radius from the Sun (m)
  • r₂: Mars's orbital radius from the Sun (m)
  • a: transfer-orbit semi-major axis (m)
Transfer time
t = π × √(a³ / μ)

Half of the transfer ellipse's orbital period: the time to coast from Earth's orbit to Mars's orbit.

  • a: transfer-orbit semi-major axis (m)
  • μ: Sun's gravitational parameter (m³/s²)
  • t: transfer time (s), converted to days by dividing by 86,400
Orbital velocity (circular)
v = √(μ / r)

The speed of a body on a circular orbit at distance r from the Sun. Used for the circular speeds of Earth and Mars.

Transfer-orbit velocity (vis-viva)
v = √(μ × (2 / r − 1 / a))

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.

Required delta-v
Δv_total = |Δv₁| + |Δv₂|

The two burns added together give the total delta-v the transfer needs.

  • Δv₁: burn to leave Earth's orbit and enter the transfer ellipse (km/s)
  • Δv₂: burn to match Mars's orbital speed on arrival (km/s)
Rocket equation (available delta-v)
Δv = vₑ × ln(m₀ / m_f)

How much velocity change the spacecraft can actually produce with the fuel it carries.

  • Δv: available change in velocity (m/s, converted to km/s)
  • vₑ: engine exhaust velocity (m/s)
  • m₀: initial wet mass = dry mass + fuel mass (kg)
  • m_f: final dry mass, after all fuel is spent (kg)
  • ln: natural logarithm
Mission status

The mission status compares the available delta-v (rocket equation) against the required delta-v (Hohmann transfer):

Feasibleavailable ≥ 110% of required (comfortable margin)
Riskyavailable is 90–110% of required (little or no margin)
Impossibleavailable < 90% of required
08 · Assumptions

Simplifications and assumptions

This is an educational, simplified simulator, not a full mission-planning tool. It deliberately assumes:

Circular planetary orbits (real orbits are slightly elliptical)
Coplanar orbits (Earth and Mars are treated as being in the same plane)
Instantaneous engine burns (impulsive delta-v, not finite thrust)
No planetary gravity assists
No launch-window or planetary-alignment calculation
No atmospheric drag, and no launch-from-surface delta-v
No detailed life-support model
A simplified mission-risk assessment based on delta-v margin

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.

09 · Validation

Testing and validation

There is no automated test runner; validation is done by inspection in the browser. When checking the app, confirm:

  • Units are shown next to every input and result.
  • Transfer time for the default Earth to Mars case is roughly 255 to 260 days.
  • Required delta-v for the default case is roughly 5.5 to 6 km/s.
  • Invalid inputs (zero or negative mass, zero exhaust velocity) never produce NaN, Infinity or a broken formula; the last valid result or a clear message is shown instead.
  • Formulas, transfer orbit and mission status update immediately when inputs change.
  • Mission status matches the delta-v margin (Feasible / Risky / Impossible).
Reference check (defaults)

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.

10 · Structure

Project structure

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
11 · Roadmap

Future improvements

Not yet implemented, but realistic next steps, separate from the features above:

Launch-window and planetary-alignment calculations
Live planetary-position simulation (true phase angles)
Non-Hohmann and faster-transfer options, with a fuel-vs-speed comparison
Finite-thrust modelling (burn duration, not impulsive)
Radiation-exposure estimates over the journey
Life-support and crew-safety budgeting
More detailed, multi-factor mission-risk scoring
Saving and comparing multiple mission configurations
Improved mobile layout and touch controls
Additional destinations beyond Mars, Ceres and Jupiter

An educational Mars mission simulator: maths, engineering and software combined into one interactive mission story.