A 3-DOF missile intercept simulator written in Python. It evaluates True Proportional Navigation (TPN) guidance against a randomly evading airborne target, and supports Monte Carlo parameter sweeps to estimate kill probability across many randomized engagements.
The simulator models a ground-launched interceptor against a manoeuvring target. Rather than flying a pre-programmed path, the target changes heading and climb rate at random times, so each run produces a different engagement geometry. A single run returns a trajectory and telemetry; a multi-run batch returns aggregate statistics.
The flight mechanics, the TPN vector formulation and the numerical integration were derived and coded by hand. An in-IDE AI assistant was used to generate boilerplate for the visualization layer — Matplotlib 3D axes setup and time-series panel layout — so that the engineering effort stayed on the physics and the guidance law.
The target is a kinematic model, not a force-integrated one. Speed magnitude is held constant; the state that evolves is the heading angle and the vertical speed. At each step the velocity vector is rebuilt from those two quantities:
The floor on
Manoeuvres are triggered by a Poisson process: the wait between manoeuvres is drawn from an exponential distribution with mean maneuver_period_s (default 20 s), so evasions occur at unpredictable moments rather than on a fixed schedule. Each trigger draws a new heading offset (uniform in
The commanded heading is not reached instantly. The turn rate is capped by the tighter of two limits:
The second term is the coordinated-turn constraint: a heavier turn demands more lift, and the airframe cannot exceed its structural load factor heading_rate_max_rads (default 0.08 rad/s ≈ 4.6°/s), is an independent kinematic cap standing in for the roll-in time and control authority that a point-mass model does not resolve.
Which limit actually binds depends on the parameters. At the defaults (--target-speed past ~490 m/s, or drop --nz-max below ~3.0, and the behaviour switches. This is worth knowing before reading the load-factor panel as evidence of structural saturation.
Vertical speed slews toward its commanded value at 10 m/s², and altitude is clamped to [altitude_min_m, altitude_max_m]; hitting a bound zeroes
The reported
The missile is a 3-DOF point mass. Three accelerations are summed and integrated directly:
Guidance — True Proportional Navigation. TPN steers on the rotation rate of the Line-Of-Sight vector rather than pointing at the target's current position. With
The logic is that on a pure collision course the LOS direction stays fixed and
Gravity compensation. A constant
Acceleration limit. The guidance command and the gravity compensation are summed before saturation, and the combined vector is clipped to accel_max_lat_mps2 (default 300 m/s² ≈ 30 g). Consequence worth stating explicitly: gravity compensation draws from the same budget as guidance, so when the missile saturates during a hard manoeuvre it also stops fully compensating its own weight.
Propulsion. Boost applies constant thrust along the velocity vector for burn_time_s (default 5 s); afterwards the missile coasts. Mass is constant — propellant expenditure is not modelled — and speed is clipped to speed_max_mps. The missile is launched at
Fixed-step Euler integration at
- distance below
kill_radius_m(default 30 m) → intercept - missile altitude below zero → ground impact, miss
- simulation time past
t_max(default 120 s) → timeout, miss
Because the intercept test is evaluated once per step, the reported miss distance is discretisation-limited: at closing speeds around 1 km/s the missile covers roughly 55 m per step, so a 30 m kill radius can be flown through between samples. Reduce --dt for finer resolution near the endgame.
A single run produces a 3D trajectory plot plus telemetry panels: altitude, speed, missile–target distance (log scale, with the kill radius marked) and target load factor.
3D visualization of the missile trajectory and target evasion manoeuvres.
Terminal output logging the engagement telemetry.
Stated plainly, since they bound what the results mean:
-
No aerodynamic drag. The coast phase does not decelerate, so the missile retains full speed indefinitely and kinematic range is optimistic. Mach-dependent
$C_d$ is the first correction needed for realistic range figures. - Constant missile mass. Propellant burn is not accounted for, so thrust-to-weight is understated during boost.
- Point-mass only. No angle of attack, no roll dynamics, no control-surface lag. A 6-DOF rigid-body model would capture the delay between command and achieved acceleration, which is where basic PN typically loses performance.
- Perfect state information. The guidance law reads exact target position and velocity — no seeker noise, no glint, no measurement lag, no filtering.
- First-order integration. Euler at 20 Hz is adequate for trajectory shape but accumulates error; RK4 would tighten the endgame.
- Basic TPN. Augmented Proportional Navigation, which adds an estimated target-acceleration term (typically from a Kalman filter), handles agile targets substantially better.
- NumPy — vector operations and numerical routines
- Matplotlib — 3D plots and telemetry panels
pip install numpy matplotlibpython 3D_Missile_Intercept_Simulator.py
python 3D_Missile_Intercept_Simulator.py --seed 42 # reproducible
python 3D_Missile_Intercept_Simulator.py --nz-max 7 --target-speed 300
python 3D_Missile_Intercept_Simulator.py --help # full option list--runs N executes N engagements with incremental seeds, suppresses plotting, and reports kill probability, mean intercept time and mean miss distance:
python 3D_Missile_Intercept_Simulator.py --runs 100 --seed 0
python 3D_Missile_Intercept_Simulator.py --runs 100 --nav-constant 3.0Sweeping --nav-constant, --nz-max or --maneuver-period across batches is the intended way to study guidance performance; a single run is a demonstration, not a result.
| Flag | Default | Meaning |
|---|---|---|
--target-speed |
250 m/s | Target cruise speed (constant magnitude) |
--nz-max |
5.0 | Target structural load factor |
--maneuver-period |
20 s | Mean interval of the Poisson evasion process |
--spawn-range |
40 km | Max target spawn radius |
--nav-constant |
4.0 | TPN navigation ratio$N'$ |
--accel-max |
300 m/s² | Missile lateral acceleration limit |
--burn-time |
5 s | Boost duration |
--missile-speed |
900 m/s | Missile speed cap |
--dt |
0.05 s | Integration step |
--kill-radius |
30 m | Intercept threshold |
--runs |
1 | Number of Monte Carlo runs |
MIT.