description: How I built a real-time ballistic computer with Euler simulation, Coriolis effect, blast zones and a satellite map interface using microservices architecture.
tags: python, csharp, redis, opensource
Building a Ballistic Fire Control Simulator โ BALISTIC V5
A few weeks ago I started wondering: how hard would it be to simulate real external ballistics? Not just a simple parabola โ but actual physics with air resistance, wind, air density and even the Coriolis effect.
The result is BALISTIC V5 โ a full microservices ballistic fire control simulator.
๐ GitHub: https://github.com/InsaneInfinity/Balistic
๐๏ธ Architecture
The system is split into two independent services communicating via Redis Streams:
โโโโโโโโโโโโโโโโโโโโโโโ Redis Stream โโโโโโโโโโโโโโโโโโโโโโโโ
โ Python / Flask โ โโโโโโโโโโโโโโโโโโโบ โ C# Processor โ
โ โ ballistics:stream โ โ
โ - Leaflet Map โ โ - Euler Simulation โ
โ - Weather API โ โโโโโโโโโโโโโโโโโโโ โ - Coriolis Effect โ
โ - Results Panel โ ballistics:result โ - Blast Zones โ
โ - PDF Export โ โ โ
โโโโโโโโโโโโโโโโโโโโโโโ โโโโโโโโโโโโโโโโโโโโโโโโ
Why Redis Streams instead of a simple key-value? Because every shot is an independent entry โ no data gets overwritten during sequential multi-target fire.
๐งฎ Physics Model
Trajectory Simulation
For kinetic energy rounds (APFSDS, HEAT) I use an Euler method simulation with dt=0.01s:
double v = Math.Sqrt(vx*vx + vy*vy);
double drag = 0.5 * cd * rho * area * v * v;
vx += -(drag/mass)*(vx/v)*dt;
vy += (-9.81 - (drag/mass)*(vy/v))*dt;
For artillery rounds (HE, EXCALIBUR) I use an empirical angle formula based on the dist/max_range ratio โ artillery always prefers a high-arc trajectory (45ยฐโ65ยฐ).
Coriolis Effect
This was the most interesting part. The real deflection formula:
d_cor = ฮฉ ยท sin(ฯ) ยท v_avg ยท tยฒ / 2
Where:
-
ฮฉ = 7.2921ร10โปโต rad/sโ Earth's angular velocity -
ฯโ shooter's latitude (dynamic, updates with every position change) -
v_avg = dist / tofโ average horizontal velocity during flight
Results for M107 HE at ~5km range, 54ยฐN latitude: ~3m deflection to the right โ matches NATO FM 6-40 tables.
Air Density
Calculated live from OpenWeatherMap data:
dens = (pressure * 100) / (287.058 * (temp + 273.15))
๐ฅ Blast Zones
Based on NATO / FM 6-40 publicly available data:
| Round | Total destruction | Heavy damage | Light damage | Hazard zone |
|---|---|---|---|---|
| M107 HE / EXCALIBUR | 30 m | 100 m | 300 m | 800 m |
| HE STD (RAK 120mm) | 8 m | 30 m | 80 m | 200 m |
| APFSDS | kinetic only | โ | โ | โ |
| HEAT | โ | โ | โ | 5 m |
These render as 4 concentric circles on the satellite map with tooltips.
๐ซ Supported Systems
| System | Round | vโ | Trajectory |
|---|---|---|---|
| AHS KRAB (155mm) | M107 HE | 560 m/s | Artillery arc |
| AHS KRAB (155mm) | EXCALIBUR | 560 m/s | Artillery arc |
| M120 RAK (120mm) | HE STD | 280 m/s | Artillery arc |
| M120 RAK (120mm) | SMOKE | 250 m/s | Artillery arc |
| LEOPARD 2 (120mm) | APFSDS | 1650 m/s | Flat |
| LEOPARD 2 (120mm) | HEAT | 1140 m/s | Flat |
โจ Features
- ๐บ๏ธ Satellite map with shooter/target positioning
- ๐ฏ Multi-target selection โ mark multiple targets, fire sequentially
- ๐ Live results panel โ azimuth, elevation angle, TOF, wind drift + Coriolis
- ๐ฅ 4-zone blast radius visualization
- ๐ PDF session report export
- ๐ Dynamic system/ammo switching without restart
- ๐ Session token authorization on all fire endpoints
๐ Key Lessons Learned
1. Euler simulation has limits
For high-velocity artillery (v0=827 m/s โ my initial wrong value!), the vacuum range formula gives unrealistic results. Real M107 HE has v0=560 m/s, not 827 m/s.
2. Bisection method for elevation angle
Finding the correct elevation angle for a given range required a bisection search. The tricky part: artillery prefers the high-arc solution (>45ยฐ), not the flat one.
3. Coriolis is smaller than you think
At 5km range with 20s flight time at 54ยฐN: only ~3m deflection. Significant for precision rounds like EXCALIBUR (CEP 10m), negligible for M107 HE (CEP 150m).
4. Redis Streams > Redis String for queues
Using XADD/XREAD with consumer groups means no data loss even if the C# processor is temporarily down โ messages wait in the stream.
โ ๏ธ Disclaimer
Educational and simulation purposes only. Real fire control systems use 6-DOF models, balloon sonde meteorological data, barrel wear corrections and dozens of other factors.
Full source: https://github.com/InsaneInfinity/Balistic
Would love to hear your thoughts โ especially on the physics model! ๐ฏ


Top comments (0)