The Four in B6-4
The motor I loaded yesterday is stamped B6-4. B is total impulse, 6 is average thrust in newtons, and the 4 is the one that keeps me up at night: seconds of delay between burnout and the ejection charge that pops the parachute. Get it wrong and the chute deploys while the rocket is still screaming upward — shredded — or long after it has nosed over and started to fall, which is a fancy way of building a lawn dart. The delay has to land near apogee. So the question is narrow and answerable: when does this thing stop climbing?
There is no tidy closed-form answer, because drag depends on velocity squared and velocity depends on drag. Fortunately you don’t need one. Euler’s method treats the whole flight as a flip-book. Freeze the rocket, read the forces acting on it right now, nudge velocity and height forward by one tiny time step, repeat. Thrust minus gravity minus drag gives acceleration; acceleration times dt updates velocity; velocity times dt updates height. Ten milliseconds a frame, a few hundred frames, and the trajectory draws itself.
my ($v, $h, $t) = (0, 0, 0);
my ($dt, $m, $g, $k) = (0.01, 0.05, 9.81, 0.0008); # s, kg, m/s^2, drag
my @thrust = (0, 5, 6, 5, 0); # crude B6 curve, N per 0.2 s
while (1) {
my $F = $t < 0.8 ? $thrust[int($t / 0.2)] : 0;
my $a = ($F - $g * $m - $k * $v * abs($v)) / $m;
$v += $a * $dt; $h += $v * $dt; $t += $dt;
last if $v < 0 && $t > 0.8;
}
printf "apogee at t=%.2f s, h=%.1f m\n", $t, $h;
import Foundation
var v = 0.0, h = 0.0, t = 0.0
let dt = 0.01, m = 0.05, g = 9.81, k = 0.0008
let thrust = [0.0, 5, 6, 5, 0] // crude B6 curve, N per 0.2 s
while true {
let F = t < 0.8 ? thrust[Int(t / 0.2)] : 0
let a = (F - g * m - k * v * abs(v)) / m
v += a * dt; h += v * dt; t += dt
if v < 0 && t > 0.8 { break }
}
print(String(format: "apogee at t=%.2f s, h=%.1f m", t, h))
Both march the same rocket up the sky and land on:
apogee at t=3.56 s, h=63.5 m
3.56 seconds. The motor’s 4-second delay would fire just past the top, on the way down — close enough that the chute opens into slowing air instead of a 30 m/s slipstream. Reassuring, given I picked the motor mostly by feel and the shape of the tube.
Now the honest caveat: my thrust curve is four numbers I made up and my drag coefficient is a guess, so treat 63.5 m as a story rather than a survey. Halve dt and the answer drifts a little, because Euler quietly assumes the forces hold constant across each interval, which they never do — it accumulates a small lie at every step. Shorter steps, smaller lie. Runge-Kutta spends the same effort more wisely, and one of these days I’ll bother to type it in. For a cardboard tube on a field east of Calgary, a flip-book that agrees with the number already stamped on the motor is enough to walk out and light the thing.