pub fn default_twist_inches(
diameter_m: f64,
mass_kg: f64,
muzzle_velocity_mps: f64,
) -> f64Expand description
Synthesize a default barrel twist (inches per turn) for a bullet whose twist the shooter did not
supply, by inverting the Miller stability formula for the twist that yields
DEFAULT_TWIST_SG_TARGET (MBA-1135).
This replaces the mass-blind fixed 1:12" fallback: heavier / longer bullets correctly demand a
faster twist. The bullet length is taken from estimate_bullet_length_m (so the whole default
is caliber + weight aware), the velocity term is (v_fps / 2800)^(1/3) at the supplied muzzle
velocity, and the density correction is 1.0 (sea-level ICAO standard).
Inverting Sg = 30 m_gr * vel_corr / (t_cal^2 * d_in^3 * L_cal * (1 + L_cal^2)):
t_cal = sqrt( 30 m_gr * vel_corr / (Sg_target * d_in^3 * L_cal * (1 + L_cal^2)) ),
twist_in = t_cal * d_in.
Sg_target was selected by comparing 1.5 vs 2.0 against common factory twists
(velocities: .308/175 gr @ 2600 fps, .223/55 gr @ 3240 fps, .224/77 gr @ 2750 fps,
6.5mm/140 gr @ 2700 fps):
| bullet | factory | Sg=1.5 | Sg=2.0 |
|---|---|---|---|
| .308 / 175 gr | 1:10-12“ | 1:12.9“ | 1:11.2“ |
| .223 / 55 gr | ~1:12“ | 1:11.7“ | 1:10.1“ |
| .224 / 77 gr | ~1:8“ | 1:8.4“ | 1:7.2“ |
| 6.5mm / 140 gr | ~1:8“ | 1:8.9“ | 1:7.7“ |
2.0 wins: Sg=1.5 gives 1:12.9“ for the 175 gr match bullet (no real .308 barrel is that slow and it under-stabilizes 175 gr), whereas 2.0’s 1:11.2“ / 1:8“ are exactly the standard twists for the twist-sensitive high-BC bullets, and slight over-stabilization is the safe direction for a default.
Guards degenerate inputs (diameter_m, mass_kg, or muzzle_velocity_mps <= 0) by returning the
historical 12.0 (1:12“) fallback. Always returns a positive inches-per-turn value.