A documented walkthrough of the 2D rocket trajectory model — forces, atmosphere, integration, and every assumption laid bare.
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.
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.
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.
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.
Fx = Fthrust · cos(θ)
Fy = Fthrust · sin(θ)
Direction constant throughout burn.
Fdx = −Fdrag · vx / |v|
Fdy = −Fdrag · vy / |v|
Always opposes instantaneous velocity.
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.
| Constant | Symbol | Value | Unit |
|---|---|---|---|
| Lapse rate | L | 0.0065 | K/m |
| Gas constant (dry air) | R | 287.058 | J/(kg·K) |
| Sea-level density (ISA) | ρ₀ | 1.225 | kg/m³ |
| ISA ground temperature | T₀ | 288.15 | K (15°C) |
| Tropopause altitude | hT | 11 000 | m |
| Gravitational accel. | g | 9.81 | m/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.
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.
| Parameter | Symbol | Default | Unit |
|---|---|---|---|
| Exhaust velocity | ve | 2 500 | m/s |
| Mass flow rate | ṁ | 50 | kg/s |
| Initial mass | m₀ | 5 000 | kg |
| Fuel mass | mfuel | 3 000 | kg |
| Drag coefficient | CD | 0.15 | — |
| Cross-section area | A | 1.0 | m² |
| Ground temperature | Tground | 288.15 | K |
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.
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.
# 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.
The loop ends when any of:
y < 0 and t > 1 s
t > 600 s
|x| > 500 km
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
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.
| File | Contents | Format |
|---|---|---|
| results.csv | Per-angle summary: altitude, range, speed, flight time, impact speed | CSV, one row per trajectory |
| trajectories.svg | Overlay plot of all trajectories (altitude vs. range) | SVG, inline-renderable |
| summary.json | Rocket parameters, optimal range/altitude, scan config | JSON |
| manifest.json | Full provenance: commit, environment, parameters, output hashes | JSON 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).
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.
Altitude-dependent air density (ISA)
Variable mass during burn
Quadratic drag (proportional to v²)
Configurable ground temperature
Configurable drag coefficient
Ground impact interpolation
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.