⚡ Power Grid
DC Power Flow
Grid Topology
Loading
Actions
Stats
Gen (MW)
Load (MW)
100%
Served
0
Tripped
Generator
Bus
Load
Line: <70% 70–90% >90% Tripped

About the Power Grid Simulation

This simulation models an electrical transmission network using the DC power flow approximation, the linearised method engineers use for rapid grid studies. Generators, buses and loads are connected by lines, each with a reactance x and a capacity in megawatts. The solver builds the network susceptance (B) matrix from b = 1/x, fixes the first generator as the slack bus, and finds the bus voltage angles θ that satisfy P = Bθ by Gauss-Seidel iteration. Line flow then follows as (θfrom − θto) / x.

You choose between Ring, Mesh and Radial topologies, scale every load with the Demand multiplier, and starve the generators with the Generation Deficit slider. Solve, Trip Line and Cascade let you remove lines and watch power redistribute. Each line is coloured by loading (green under 70%, amber to 90%, red above), and a cascade trips any line carrying more than 105% of its capacity, mirroring how real protection relays drop overloaded circuits and how blackouts propagate.

Frequently Asked Questions

What is DC power flow?

DC power flow is a linear approximation of full AC load flow used to estimate how active power (megawatts) divides across transmission lines. It assumes flat voltage magnitudes, negligible line resistance and small angle differences, so it reduces to a simple linear system. This makes it fast enough for contingency screening, even on networks with thousands of buses.

How does this simulation solve the network?

It assembles the susceptance matrix B, where each line contributes b = 1/x to the relevant entries. The first generator is set as the slack bus with angle zero, and the bus angles are found by running 80 Gauss-Seidel sweeps over P = Bθ. Line power is then computed as the angle difference divided by reactance.

What do the three topology buttons do?

Ring connects eight nodes in a loop with one cross-tie, Mesh is a denser twelve-node network with two generators and many redundant paths, and Radial is a single 350 MW generator feeding loads through a tree with no loops. Switching topology changes how resilient the grid is when lines are lost.

What do the Demand and Generation Deficit sliders control?

Demand multiplies every load's power injection, from 0.5 to 2.5 times its base value, increasing the stress on the lines. Generation Deficit scales the generators down by 0 to 50 percent, simulating lost or under-dispatched supply. Both push more lines towards their thermal limits.

What triggers a cascade failure?

The Cascade action repeatedly resolves the flow and trips any line carrying more than 105% of its rated capacity. Removing those lines forces their power onto neighbours, which may then overload and trip in turn. The process runs in steps roughly every 0.4 seconds until no line is overloaded or the served load reaches zero, reproducing how a single fault can snowball into a regional blackout.

Why does the reactance x matter more than resistance here?

In high-voltage transmission, line reactance dominates resistance, so the DC approximation neglects resistance entirely and uses only x. Power then flows inversely with reactance: a low-reactance line is electrically "short" and naturally attracts more flow. That is why power does not follow the shortest geographic path but the path of least reactance.

What does the "Served" percentage mean?

Served shows the fraction of total demand that still reaches connected loads. When lines trip and a load becomes isolated from any generator, its demand can no longer be supplied, so the figure drops. It turns amber below 95% and red below 80% to flag partial or widespread loss of supply.

How realistic is this model compared with a real grid?

The DC method captures the essential physics of how active power splits across a meshed network and why overloads cascade, and it is genuinely used in industry for planning and security analysis. However, it ignores voltage collapse, reactive power, frequency dynamics and detailed relay behaviour, so it is a teaching-grade approximation rather than a full electromechanical simulator.

Why does tripping one line sometimes overload another?

Power flow obeys Kirchhoff's laws, so it redistributes instantly across all remaining paths when a line is removed. A circuit that was lightly loaded can suddenly carry the diverted power and exceed its own limit. This coupling is exactly why grid operators run N-1 contingency checks before allowing any single element to fail.

Why is the Radial topology more fragile than the Mesh?

A radial network has only one path from the generator to each load, so losing any line immediately isolates everything downstream of it. A mesh network has redundant routes, allowing power to detour around a failed line. Tripping a line in Mesh usually keeps the lights on, whereas in Radial it directly cuts customers off.