-
Notifications
You must be signed in to change notification settings - Fork 2
Epicenter Triangulation Algorithm
In QuakeGuard v2.0.0, the backend actively performs multi-node spatial and temporal correlation to transform isolated sensor triggers into a cohesive, verified seismic event.
Before calculating the physical epicenter, the ingestion worker groups the incoming telemetry via a distributed state machine backed by Redis:
- Temporal Window: When a valid trigger arrives, its payload is appended to a Redis List specific to its geographical area, and the list's Time-To-Live (TTL) is refreshed to 60 seconds. This creates a sliding temporal buffer that captures the seismic wavefront as it propagates across multiple sensors.
- Quorum Consensus: To eliminate isolated false positives (e.g., localized heavy impacts or tampering), the correlation engine requires a minimum quorum of 3 independent sensors within a localized area.
- Execution: The moment the quorum is reached within the 60-second window, the worker flushes the payload cluster to the triangulation function to compute the unified epicenter and trigger the downstream AI reporting services.
The current release implements a deterministic, magnitude-weighted spatial centroid (Barycenter approximation) coupled with an empirical P-wave travel time estimator. While future iterations may introduce a non-linear Least Squares solver based purely on Time Difference of Arrival (TDOA), the current heuristic guarantees real-time computational efficiency and handles the dense topological nature of the IoT network natively.
For a given cluster of N triggers (where N ≥ 3), the estimated epicenter coordinates (Latitude, Longitude) are computed as a weighted average of the sensor coordinates. The weight for each sensor is the local magnitude recorded by that sensor.
This ensures that sensors closer to the actual rupture (which record higher magnitudes) pull the calculated epicenter towards them.
To estimate the origin time of the rupture, the backend computes the great-circle distance d between the calculated epicenter and the first triggered sensor (the node recording the earliest arrival time) using the Haversine formula (assuming an Earth radius of approximately 6371 km).
Assuming an average crustal primary wave (P-wave) velocity of 6.0 km/s, the estimated travel time from the hypocenter to the first sensor is computed by dividing the distance d by the velocity.
The event origin time is then retroactively calculated by subtracting this travel time from the first absolute NTP-synchronized timestamp recorded by the network.
This methodology yields highly accurate epicenters when the sensor density is high (e.g., city-scale deployments). However, since it relies on magnitude weights rather than pure arrival times, asymmetrical network topologies (where sensors are clustered only on one side of a fault) can pull the epicenter centroid artificially toward the cluster.
The current architecture separates this core calculation into a decoupled function, ensuring a seamless upgrade path to standard TDOA multilateration in future releases without disrupting the high-throughput ingestion pipeline.