Simulation Reference

The physics under the hood

A documented walkthrough of the 2D rocket trajectory model — forces, atmosphere, integration, and every assumption laid bare.

§1

Overview

The rocket_scan job simulates a single-stage rocket in two dimensions: horizontal range x and altitude y. The rocket is launched at a fixed angle from the ground with constant thrust direction, loses mass as fuel burns, and experiences altitude-dependent aerodynamic drag.

The model is deliberately simple — a pedagogical tool and a provenance demonstration, not a flight-dynamics simulator. Flat Earth, no wind, no staging, no thrust vectoring.

config.json
simulate_trajectory()
results.csv
+
trajectories.svg
+
summary.json
manifest.json

Scan mode: The job sweeps launch angle from angle_min to angle_max in N steps, running one full trajectory simulation per angle. The angle that maximises ground range is reported as the optimal.

§2

Force model

At each time step, three forces act on the rocket: thrust, aerodynamic drag, and gravity. All forces are resolved into horizontal and vertical components and summed to compute acceleration.

θ F_thrust v F_drag mg x (range) y (alt) Thrust (during burn) Drag (opposes velocity) Gravity (constant) Velocity vector
Free-body diagram — forces acting on the rocket during powered flight
Thrust
Fthrust = ve × only during burn (t < t_burn)
Drag
Fdrag = ½ ρ(h) CD A v2opposes velocity vector
Gravity
Fgravity = m(t) × gg = 9.81 m/s², constant
Acceleration
a = (Fthrust + Fdrag + Fgravity) / m(t)

Thrust is applied at a fixed angle θ relative to the ground for the entire burn. The thrust direction does not follow the velocity vector — this is a gravity-turn simplification. Drag is applied opposite to the instantaneous velocity vector and uses an altitude-dependent density from the ISA model.

Thrust components

Fx = Fthrust · cos(θ)

Fy = Fthrust · sin(θ)

Direction constant throughout burn.

Drag components

Fdx = −Fdrag · vx / |v|

Fdy = −Fdrag · vy / |v|

Always opposes instantaneous velocity.

§3

ISA atmosphere model

Air density determines drag magnitude and varies dramatically with altitude. The simulation uses the International Standard Atmosphere (ISA) model with an adjustable ground temperature Tground.

Troposphere
0–11 km
T(h) = Tground L · h
ρ(h) = ρground · (T/Tground)g/(LR) − 1
Stratosphere
11–25 km
ρ(h) = ρtropo · exp(g(h hT) / R Ttropo) isothermal layer
Above 25 km
ρ 0negligible drag
ConstantSymbolValueUnit
Lapse rateL0.0065K/m
Gas constant (dry air)R287.058J/(kg·K)
Sea-level density (ISA)ρ₀1.225kg/m³
ISA ground temperatureT₀288.15K (15°C)
Tropopause altitudehT11 000m
Gravitational accel.g9.81m/s²

When Tground differs from the ISA standard 288.15 K, the ground-level density is scaled by T₀ / Tground (ideal gas law at constant pressure). This allows the Launch Lab's "Arctic" and "Desert" presets to model cold and hot atmospheres.

ISA density profile — standard conditions (T_ground = 288.15 K)
§4

Mass model

The rocket loses mass at a constant rate during the burn. After burnout, the mass is fixed at the dry mass. Thrust-to-weight ratio (TWR) therefore increases throughout the burn as the vehicle lightens.

During burn
m(t) = m0 · tt < t_burn
After burn
m = m0 mfueldry mass, constant
Burn time
tburn = mfuel /
Initial TWR
TWR = ve · / (m0 · g)
ParameterSymbolDefaultUnit
Exhaust velocityve2 500m/s
Mass flow rate50kg/s
Initial massm₀5 000kg
Fuel massmfuel3 000kg
Drag coefficientCD0.15
Cross-section areaA1.0
Ground temperatureTground288.15K

Derived values (defaults): Thrust = 125 kN, burn time = 60 s, dry mass = 2 000 kg, TWR = 2.55. The high TWR means the rocket accelerates upward immediately — no launch pad hold-down is modelled.

§5

Numerical integration

The trajectory is integrated using the explicit Euler method — the simplest first-order integrator. At each time step, forces are summed, acceleration is computed, and velocity and position are updated.

src/jobs/rocket_scan/run.py — integration loop Python
# Forces → acceleration
ax = (Fx_thrust + Fx_drag) / m
ay = (Fy_thrust + Fy_drag + Fy_grav) / m

# Euler integration
vx += ax * dt
vy += ay * dt
x  += vx * dt
y  += vy * dt

The time step is Δt = 0.1 s. This is adequate for the parameter ranges in the default config (trajectories lasting 100–500 s) and keeps the Launch Lab's Web Worker implementation fast enough for real-time interaction.

Velocity
v(t + Δt) = v(t) + a(t) · Δt
Position
r(t + Δt) = r(t) + v(t + Δt) · Δt

Termination conditions

The loop ends when any of:

y < 0 and t > 1 s
t > 600 s
|x| > 500 km

Ground interpolation

When y drops below zero, the impact point is interpolated back to y = 0 using the remaining vertical velocity:

Δt_back = −y / vy
x += vx · Δt_back

§6

Output structure

Each trajectory produces a time series of state vectors. The scan job extracts summary metrics per trajectory and writes three output files, which are then hashed and catalogued in the provenance manifest.

FileContentsFormat
results.csvPer-angle summary: altitude, range, speed, flight time, impact speedCSV, one row per trajectory
trajectories.svgOverlay plot of all trajectories (altitude vs. range)SVG, inline-renderable
summary.jsonRocket parameters, optimal range/altitude, scan configJSON
manifest.jsonFull provenance: commit, environment, parameters, output hashesJSON Schema v2.0.0

The per-trajectory time series (position, velocity, mass at each step) is used only for SVG generation and is not written to CSV — this keeps the CSV compact (one row per angle rather than thousands of rows per trajectory).

§7

Assumptions and limitations

This model is intentionally simplified. It exists to demonstrate the provenance pipeline, not to predict real flight paths. Here is what is and isn't modelled.

Modelled

Altitude-dependent air density (ISA)

Variable mass during burn

Quadratic drag (proportional to v²)

Configurable ground temperature

Configurable drag coefficient

Ground impact interpolation

Not modelled

Earth curvature (flat Earth assumed)

Wind or weather effects

Thrust vectoring or gravity turn

Multi-stage separation

Coriolis effect

Altitude-dependent gravity

Speed of sound / transonic drag

Re-entry heating

Euler method accuracy: The forward Euler integrator introduces a first-order global truncation error proportional to Δt. At Δt = 0.1 s this is adequate for qualitative trajectory shapes, but not for precision astrodynamics. A higher-order integrator (RK4) would give better energy conservation at the same step size. For this demonstration, simplicity and speed are prioritised.