-
Notifications
You must be signed in to change notification settings - Fork 0
Home
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)
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 | 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 |
- Getting Started — build, run the UK model live, solve the IEEE 9-bus benchmark
-
Architecture — project map, the
ILinearSolverCUDA seam, how models flow into solvers - The Power-Flow Solvers — Y-bus, Newton-Raphson, Q-limits, OLTC, the sparse backend
- The UK Model — the reduced 10-zone GB system, defined entirely by editable JSON
- The GDA Replica — ingesting the real DNO network (LTDS) into a solvable model
- The National Fleet and Inertia — the real GB generation fleet and the inertia problem
- Frequency Dynamics — RoCoF, nadir, governor response; trip a unit and watch
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.
⚡ GridSim Wiki · Repository · GPL-3.0-or-later · validated against published reference cases