Skip to content
MarkS0485 edited this page Jun 5, 2026 · 2 revisions

GridSim

GridSim is a grounded, physics-first power-grid simulator in C# / .NET. It owns everything from a per-unit network model to a converged steady state — complex Y-bus assembly, a full-Jacobian Newton-Raphson load flow (dense and sparse), generator Q-limits, on-load tap changers, frequency dynamics — and validates every step against published reference cases.

License: GPL-3.0-or-later | Targets: net10.0 | Co-developed with Opus 4.8 / Claude Code (1M context)


The one core idea

Keep it simple, keep it grounded in the actual physics, and validate every step against published reference cases.

Nothing goes into the model that can't be checked: the dense solver reproduces the published WSCC / MATPOWER IEEE 9-bus solution; the sparse solver reproduces the dense solver to 1e-6; the GDA replica is validated against a real Grid Supply Point distribution network solved straight from the archive. Physics changes ship with a reference case or they don't ship.


What's in the box

What Status
Per-unit network model — buses, generators, π-model branches Done
Complex Y-bus with line charging, shunts, taps & phase shift Done
Newton-Raphson load flow (full polar Jacobian) — validated vs IEEE 9-bus Done
Generator Q-limits (PV→PQ switching) Done
OLTC voltage regulation Done
Sparse NR (sparse LU, RCM ordering) — scales to ~6,000-bus networks Done
UK reduced 10-zone GB model, all-JSON, runs live with a daily load curve Done
GridSim.Gda — build the real GB grid from the GDA/LTDS data lake Done
National generation fleet (943 units, 134.8 GW) + system inertia Done
Frequency dynamics — swing equation, governor droop, unit trips Done
NESO frequency CSV streaming + RoCoF upsampler (1 s → 20 ms) Done
ETYS boundaries with transfer limits, N-1 contingency scan Done
81 headless xUnit tests (no grid data required) Done
ILGPU/CUDA linear-solver backend Planned — the ILinearSolver seam is in

Start here

  • Getting Started — build, run the UK model live, solve the IEEE 9-bus benchmark
  • Architecture — project map, the ILinearSolver CUDA seam, how models flow into solvers
  • The Power-Flow Solvers — Y-bus, Newton-Raphson, Q-limits, OLTC, the sparse backend

The grid itself


Quick build

dotnet build GridSim.slnx
dotnet test  GridSim.slnx
dotnet run --project src/GridSim.Cli            # UK reduced model, live
dotnet run --project src/GridSim.Cli case9      # IEEE 9-bus benchmark

Requires the .NET 10 SDK. No grid data, no network access, no GPU required — the tests build their own synthetic fixtures.


See also

  • The CLI — full command reference
  • Testing — what's validated and how
  • Roadmap — where this is going
  • Glossary — per-unit, RoCoF, GSP, LTDS and friends

Clone this wiki locally