A command center never sees the grid directly — it sees noisy sensor readings and must estimate the true state. This uses a linearised (DC) power-flow model on a 6-bus, 9-line network with bus 0 as the reference (θ₀ = 0):
line flow: f_ij = B_ij (θ_i − θ_j)
measurement: z_k = f_ij + noise_k, noise_k ~ N(0, σ²)
in matrix form: z = Hθ + e
The estimator solves the weighted least-squares problem, with W = diag(1/σ²):
θ̂ = (HᵀWH)⁻¹ HᵀWz (solved live by Gaussian elimination, 5×5)
residual: r = z − Hθ̂
χ² test: J(θ̂) = Σ rₖ²/σ² vs threshold ≈ dof + 3√(2·dof)
If J exceeds the threshold, the command center flags bad data. A naive spoof adds an offset to one meter directly — it breaks the flow-consistency equations, spikes the residuals, and trips the alarm. A stealthy false-data injection (FDIA) instead adds an error vector c = Hâ built from a fake angle shift â: because c lives inside the column space of H, the estimator "explains" it as a perfectly consistent — but wrong — grid state, and the residual (and χ²) barely move. This is the textbook unobservable-attack result from power-system security research (Liu, Ning & Reiter, 2011): an attacker who knows the network topology can corrupt the state estimate without tripping a single alarm.
- Grid loading — rescales bus power injections, re-solving the true DC flow and regenerating fresh noisy measurements every frame.
- Sensor noise σ — the assumed/actual meter noise; also sets the χ² threshold via W.
- Target line meter + magnitude — choose which of the 9 line-flow sensors to corrupt and by how much.
- Naive spoof vs Stealthy FDIA — same magnitude, two different injection geometries; watch χ² and the estimated-angle error respond completely differently.
- Drag / scroll the network view — pan and zoom the topology map; it never affects the physics, only your view of it.