Skip to content

Getting Started

MarkS0485 edited this page Jun 5, 2026 · 1 revision

Getting Started

Everything here runs on a bare machine: .NET 10 SDK is the only prerequisite. No grid data, no GPU, no network access.

Build and test

git clone git@github.com:MarkS0485/GridSim.git
cd GridSim
dotnet build GridSim.slnx
dotnet test  GridSim.slnx       # 81 tests, ~3 s — all headless

Run the IEEE 9-bus benchmark

The classic WSCC 9-bus case is built in (IeeeCases.Case9()) and is the canonical "is the solver right?" check:

dotnet run --project src/GridSim.Cli case9
GridSim — IEEE 9-bus (WSCC)   (9 buses, 9 branches, base 100 MVA)
================================================================
Converged in 4 iterations (max mismatch 1.84E-014 p.u.)

Bus    Vm(pu)   Va(deg)     P(MW)    Q(MVAr)
  1    1.0400     0.000     71.64     27.05
  ...
Total losses: 4.641 MW, -92.160 MVAr

Slack generation ≈ 71.64 MW and total losses ≈ 4.64 MW match the published MATPOWER solution. If you change solver internals and this still prints, you probably didn't break the physics.

Run the UK model — live

With no arguments the CLI loads the reduced 10-zone GB model from data/uk/ and runs it continuously: demand follows a day/night curve, generation re-dispatches, and the network re-solves each tick (any key stops it):

dotnet run --project src/GridSim.Cli              # live, starts at 08:00
dotnet run --project src/GridSim.Cli -- --once    # solve once and print
dotnet run --project src/GridSim.Cli -- --ticks 50  # headless: N ticks then exit
GridSim — GB reduced (10-zone)
20 buses · 24 branches · 22 generators · base 10000 MVA · 50 Hz
========================================================================
Converged (3 NR iters, 3 OLTC passes, max mismatch 1.29E-011 p.u.)
Generation 39.56 GW · Demand 39.50 GW · Losses 56.3 MW · System inertia 171.7 GVA·s
Voltage range: 0.998 – 1.040 p.u.  (within 0.94–1.06 band)

Trip a generator

The headline demo — lose a unit and watch frequency physics respond:

dotnet run --project src/GridSim.Cli trip "Sizewell"
dotnet run --project src/GridSim.Cli trip Hinkley --export trip.csv
dotnet run --project src/GridSim.Cli replay trip.csv     # watch the dip at 20 ms

See Frequency Dynamics for what the numbers mean.

Run your own case

The whole grid is just data — point the CLI at any folder with the same JSON layout as data/uk/:

dotnet run --project src/GridSim.Cli -- --dir path/to/case

See The UK Model for the file format.

Where next

Clone this wiki locally