A BLE tag on a mobile infusion pump broadcasts an advertising packet a few times per second. Every fixed ceiling receiver ("beacon") that hears it measures the Received Signal Strength Indicator (RSSI) and converts it to an estimated distance using the log-distance path-loss model:
RSSI(d) = RSSI₀ − 10·n·log₁₀(d / d₀) + Xσ
d = d₀ · 10^((RSSI₀ − RSSI) / (10·n))
where RSSI₀ is the calibrated strength at reference distance d₀ = 1 m, n is the path-loss exponent (2.0 in free space, higher through walls and bodies), and Xσ is zero-mean Gaussian multipath/shadowing noise. Each beacon's distance estimate defines a sphere of possible tag positions around it.
With three or more spheres, the tag's true position is the point that best satisfies all of them simultaneously. This simulator solves that with linear least-squares multilateration: subtracting the equation for a reference beacon from every other beacon's equation cancels the quadratic |tag|² term, leaving a linear system A·x = b solved for the (x, z) floor-plan position that minimizes total squared residual.
- Tag speed — how fast the simulated pump moves along its patrol path.
- RSSI noise (σ) — the standard deviation of the shadowing/multipath error added to every reading; higher σ spreads the distance spheres and inflates position error.
- Path-loss exponent n — how fast signal decays with distance; higher n (more walls/obstruction) makes RSSI→distance conversion less linear and noisier.
- Active beacons — beacons beyond ~9 m range or disabled here stop contributing; fewer beacons means a more poorly conditioned (or unsolvable, below 3) least-squares system and larger error.
Real hospital RTLS (real-time locating systems) use exactly this pipeline — Bluetooth AoA/RSSI, Wi-Fi RTT, or UWB — to find infusion pumps, wheelchairs and portable monitors on a floor plan, the "resource tracking" layer of a connected hospital's medical IoT.