The complete description of every model inside Project APEX — stability, drag, compressibility, numerical integration, and atmosphere.
Project APEX solves a one-dimensional vertical flight from launch to apogee using a physics-based model with no lookup tables for the core dynamics. Every quantity — drag coefficient, stability margin, air density, speed of sound — is computed analytically at each timestep from the current state of the rocket and the atmosphere.
The model has three main layers. The aerodynamics layer computes the centre of pressure (CP), the drag coefficient (Cd), and the lift-curve slope from the rocket's geometry. The flight integration layer uses those forces together with the motor thrust curve to propagate position and velocity forward in time. The atmosphere layer supplies air density, dynamic viscosity, and speed of sound at each altitude, updated at every step.
All internal calculations use SI units throughout. Inputs entered in imperial units are converted before the simulation runs and converted back for display.
| Layer | Output | Method |
|---|---|---|
| Stability | Xcp, CNα, static margin | Barrowman (1966) + PG correction |
| Drag | Total Cd (7 components) | Analytical, Re-based skin friction |
| Compressibility | KPG correction factor | PG subsonic, Ackeret supersonic, linear blend transonic |
| Integration | Altitude, velocity vs time | 4th-order Runge-Kutta, dt = 0.05 s |
| Atmosphere | ρ, T, P, a, μ | ISA 1976, 3 layers to 32 km |
The centre of pressure is calculated using the Barrowman method, which treats the rocket as a body of revolution and sums the normal-force contributions of the nosecone and fins separately. The CP is the weighted average of those contributions, weighted by their respective normal-force slope coefficients (CNα).
All distances are measured from the nose tip. A larger Xcp means the CP is further aft, which increases the stability margin.
For a slender body of revolution, the nosecone normal-force slope is 2.0 regardless of shape. The shape affects the CP location of the nose contribution:
| Nose shape | Xcp_nose (from tip) |
|---|---|
| Cone | 2/3 · Ln |
| Ogive | 0.466 · Ln |
| Von Kármán | 0.437 · Ln |
| Parabolic | 0.500 · Ln |
The fin normal-force slope uses the Barrowman trapezoidal fin formula with a body-interference factor K:
The fin CP location:
APEX recomputes CP at every recorded timestep using the Prandtl-Glauert correction factor:
The static margin in calibers (body diameters):
A margin of 1–2 calibers is the conventional HPR target. APEX applies an increasing drag penalty for unstable rockets — ramping from 1× at 0 calibers to up to 10× at −2 calibers. During the burn, CG moves forward as propellant is consumed:
The total drag coefficient is the sum of seven analytically computed terms, recalculated at every simulation step. The total drag force is:
| Component | Symbol | Regime |
|---|---|---|
| Skin friction (body) | Cd_body | All speeds |
| Nose pressure drag | Cd_nose | All speeds |
| Base drag | Cd_base | All speeds |
| Fin friction + profile | Cd_fin_friction | All speeds |
| Fin LE/TE pressure | Cd_fin_LE / TE | All speeds |
| Fin interference | Cd_fin_interference | All speeds |
| Fin wave drag | Cd_fin_wave | M > 0.75 |
| Body shoulder wave drag | Cd_wave | 0.82 < M < 1.25 |
Body skin friction uses the Prandtl-Schlichting turbulent flat-plate formula with a Schlichting roughness lower bound, applied to the wetted surface area of the body:
The roughness ε (in metres) sets a lower limit on skin friction; once the boundary layer is fully rough, increasing Reynolds number no longer reduces Cf.
Fin skin friction is computed separately at the fin chord Reynolds number, not the full body length Re. Fin chords are typically much shorter than the body, giving a substantially higher Cf than the body value:
The Fin Roughness parameter (ε_fin) is independent of body roughness, allowing correct per-surface calibration — a painted carbon-fibre body (~20 µm) and polished aluminium fins (~0.5 µm) have very different Cf values.
Nose pressure drag is shape-dependent and grows with Mach number via the Prandtl-Glauert compressibility correction. In the supersonic regime Ackeret theory takes over, with the correct 1/β (not 1/β²) dependence:
Pressure drag scales as the square of the flow deflection angle and falls off as 1/β as the rocket accelerates deeper into the supersonic regime. The constant √0.44 anchors the Ackeret value to the PG result at M = 1.2 for a continuous transition. A longer nose (larger Ln) reduces θ and therefore reduces wave drag — this is why HPR rockets favour 5:1 or 7:1 nose fineness ratios.
The rocket's blunt base creates a low-pressure wake. The model uses a Mach-dependent formula calibrated to match measured drag behaviour: low at rest, rising to a peak near M = 1, then decaying in the supersonic regime as the base flow changes character:
The subsonic formula anchors at 0.025 at zero speed and rises quadratically to 0.190 at Mach 1. The supersonic formula is continuous at that boundary and decays with the M^1.25 exponent, correctly representing the gradual increase in base pressure recovery as the Mach number rises.
Leading and trailing edge pressure drag depends on the fin cross-section profile. For bevelled profiles the subsonic LE drag follows linearised wedge theory — the same functional form as the Ackeret term but active at all speeds. The profile also sets Kwave for the supersonic regime:
| Cross-section | LE profile | TE profile | Kwave (Ackeret) |
|---|---|---|---|
| Double wedge | Sharp | Sharp | 4·t_c² |
| Quarter-chord bevel | Bevelled | Sharp | 2·t_c²/f_le |
| Hexagonal / LE bevel | Bevelled | Bevelled | 8·t_c² |
| Flat plate (default) | Blunt | Blunt | 4·t_c |
where t_c = fin thickness / root chord. For the quarter-chord bevel, the LE Bevel Depth (f_le) appears in both the subsonic and supersonic drag terms — a deeper bevel distributes the deflection over more chord, reducing the effective wedge angle and lowering drag at all speeds.
Where the fins attach to the body, the disturbed boundary layer produces additional drag:
Wave drag is the dominant drag increase in the transonic and supersonic regimes, arising from three independent sources. For a full treatment see the blog post Wave Drag Explained.
The clamping of the denominator to 1.0 regularises the Ackeret singularity at M_eff = 1. Swept fins maintain a lower M_eff than the freestream Mach number, delaying and reducing the wave drag onset.
Nose wave drag grows via the PG correction below M = 0.8, blends linearly through transonic, and transitions to Ackeret above M = 1.2. See the Nose Pressure Drag section above for the formula.
At the nosecone-to-body junction a recompression shock exists only in the transonic band:
This term peaks near M = 1 and disappears once the flow is fully supersonic.
As the rocket approaches and exceeds Mach 1, compressibility changes the pressure distribution and normal-force generation. APEX applies a single correction factor KPG that transitions continuously between three regimes:
The PG correction at M = 0.8 evaluates to approximately 1.67 — meaning fin normal-force authority is 67% higher than the incompressible value. At M = 1.2 the Ackeret result is approximately 1.51. The linear transonic blend connects these continuously.
This correction is applied to the fin normal-force slope (CNα_fins) before computing CP, and also feeds into the nose pressure drag model. As fins gain authority approaching M = 1, CP moves aft, increasing stability margin. In the fully supersonic regime, fin authority drops off and CP shifts forward.
The flight is solved as a system of two first-order ODEs — altitude (dh/dt = v) and velocity (dv/dt = net acceleration) — using the fourth-order Runge-Kutta method (RK4) with a fixed timestep of 50 ms.
Each call to the derivative function performs a full atmosphere lookup, computes the current Mach and Reynolds number, evaluates all seven drag components, reads the thrust from the interpolated thrust curve, and returns net acceleration:
Mass decreases linearly through the burn phase as propellant is depleted. After burnout, mass is constant at the dry mass. Gravity: g = 9.80665 m/s².
The integrator runs at 50 ms per step internally. Output is recorded every 100 ms (every other integration step) to keep the data arrays at a manageable size for charting. For a typical 30-second flight this produces approximately 300 data points per output channel.
Air density, temperature, pressure, speed of sound, and dynamic viscosity are computed from altitude using the International Standard Atmosphere (ISA 1976), covering three layers up to 32 km.
| Layer | Altitude range | Lapse rate | Base temperature |
|---|---|---|---|
| Troposphere | 0 – 11 km | −6.5 K/km | 288.15 K (15 °C) |
| Tropopause | 11 – 20 km | 0 K/km (isothermal) | 216.65 K (−56.5 °C) |
| Lower stratosphere | 20 – 32 km | 0 K/km (isothermal) | 216.65 K |
All five quantities are updated at every integration step. The launch altitude input allows the simulation to start at field elevation, important for high-desert launch sites where sea-level density assumptions would overestimate drag.
With correct physics inputs — accurate surface roughness values for body and fins, the right fin cross-section profile, and a well-measured geometry — APEX's analytical drag model typically matches real flight data within 3–5% apogee error without any fudge factor. The Cd Scale Factor (default 1.0) exists as a fine-tuning tool, but should not be needed to achieve a good baseline prediction.
Surface roughness is the most influential calibration input. The Body Roughness and Fin Roughness parameters should match the actual finish of each surface:
| Surface finish | Roughness (µm) |
|---|---|
| Polished metal / bare carbon fibre | 0.5 – 2 |
| Smooth paint (glossy finish) | 5 – 20 |
| Matte / spray paint | 30 – 60 |
| Rough fibreglass | 100 – 300 |
Body roughness 20 µm and fin roughness 0.5 µm is a good starting point for a painted airframe with polished aluminium fins. Note that OpenRocket sets roughness per component in the General tab of the component editor (not the Appearance tab).
When a Featherweight Blue Raven altimeter CSV is loaded into APEX, the Aerodynamics tab back-calculates actual Cd versus Mach from the coast phase — the interval between burnout and apogee when thrust is zero, making drag the only unknown:
This produces a measured Cd vs Mach curve plotted alongside the model prediction. If the curves are offset, first check that surface roughness and fin profile parameters reflect the actual airframe — a persistent offset usually means the geometry or roughness inputs are wrong, not that the scale factor needs adjustment.
APEX can also import an OpenRocket Cd CSV (exported from OR's drag breakdown) as a visual reference overlay on the Aerodynamics chart. The simulation always uses the APEX computed Cd — the OR import is a visual comparison only, useful for identifying where the two models diverge.