Bus type controls solver behavior: slack fixes V and θ (P, Q computed) — exactly one allowed; PV fixes V and P (Q, θ computed); PQ fixes P and Q (V, θ computed). Setting type to slack on one row demotes any existing slack to PV.
| Name | Bus | Type | P gen (MW) | Q gen (MVAR) | V setpoint (pu) | P min (MW) | P max (MW) | Q min (MVAR) | Q max (MVAR) | Zgen r (pu) | Zgen x (pu) | In Service |
|---|
| Bus | Voltage | P load (MW) | Q load (MVAR) | Model | In service |
|---|
Edit a bus's base kV to rebase impedances of connected lines and transformers. pu impedances are recomputed to preserve the underlying physical ohms.
| Bus | Base kV | Cap (+MVAR injected) | Cap model | Cap in service | Reactor (−MVAR absorbed) | Reactor model | Reactor in service |
|---|
Impedances are in pu on the system base (100 MVA, with bus base kV at each end). kV columns show the transformer's rated kV (nameplate) — the off-nominal turns ratio accounts for any mismatch between rated kV and the system base kV at that bus.
| Name | F→T | Rated kV from | Rated kV to | Base kV from | Base kV to | r (pu) | x (pu) | Tap a | Rating (MVA) | In service |
|---|
A PST controls real-power flow by inserting a voltage phase angle between its from and to sides. The complex turns ratio τ = a · ejφ makes the Y-bus asymmetric — Yft ≠ Ytf when φ ≠ 0. Use the Phase shift column to control the angle directly, or add a new PST via the toolbar.
| Name | F→T | Rated kV from | Rated kV to | Base kV from | Base kV to | r (pu) | x (pu) | Tap a | Phase shift (°) | Rating (MVA) | In service |
|---|
Line impedances are in pu on the system base (100 MVA at the line's base kV). Editing the base kV converts pu values to preserve the underlying physical impedance in ohms.
| Name | F→T | Base kV | r (pu) | x (pu) | b (pu) | X/R | Rating (MVA) | In service |
|---|
| Bus | Type | |V| (pu) | θ (deg) | P gen | Q gen | P load | Q load |
|---|
| Branch | F→T | r (pu) | x (pu) | b (pu) | P (MW) | Q (MVAR) | |S| (MVA) | Rating | Loading | P loss | Q loss |
|---|
This is a real Newton-Raphson AC power flow solver running entirely in your browser. Drag sliders, edit table cells, or click in the diagram to modify the system — it re-solves automatically on every change. The interface has three main areas: the diagram (upper left), the data tables (below the diagram), and the Controls panel (right side with sliders).
Click anywhere in the diagram first to focus it (you'll see a soft blue outline). Then these keys are active:
| Key | Action |
|---|---|
| Arrow keys | Pan the canvas (5% per press). If a bus is selected, nudges that bus by 5 px instead. |
| Shift + Arrow keys | Pan the canvas (20% per press). If a bus is selected, nudges it by 20 px. |
| + or = | Zoom in (×1.25). |
| − or _ | Zoom out (÷1.25). |
| 0 | Reset view to the default zoom and position. |
| F | Fit to content — auto-frame all buses and labels. |
| R | Rotate the selected transformer's primary/secondary orientation. |
| Escape | Clear selection; cancel a pending branch connection. |
| Space (hold) | Temporary pan mode — drag to pan while held, like the Photoshop hand tool. Works in any tool mode. |
These shortcuts only fire when the SVG diagram has focus (click it) and when you're not typing in a text input or table cell.
| Action | Effect |
|---|---|
| Left-click bus | Select the bus (highlights it and connected labels). |
| Left-click branch | Select the branch. |
| Left-click empty space | Deselect everything. |
| Drag a bus | Reposition it in the diagram (Select tool must be active). |
| Drag a label | Reposition the label manually; position is remembered. |
| Double-click a label | Reset that label to its auto-calculated position. |
| Right-click a bus | Change bus type (slack / PV / PQ) via prompt. |
| Right-click a load/cap/reactor/gen icon | Toggle that device in/out of service. |
| Right-click a branch (line/xfmr) | Toggle the branch in/out of service (simulates outage). |
| Right-click a label | Reset it to the default auto-placement position. |
| Mouse wheel | Zoom in/out, centered on the cursor position. |
| Drag (Pan tool active) | Pan the canvas in any direction. |
| Space + drag | Temporary pan (works in any tool mode). |
The toolbar above the diagram provides these tool modes (click to activate):
| Tool | How to use |
|---|---|
| Select / move | Default tool. Click to select elements, drag to reposition buses/labels. |
| Pan | Drag anywhere to scroll the canvas. Same as holding Space. |
| Add bus | Click in empty diagram space to create a new PQ bus. |
| Add generator | Click in empty space to create a new PV bus with a generator. |
| Add line | Click a from-bus, then click a to-bus to connect them with a transmission line. |
| Add transformer | Click a from-bus, then click a to-bus to add a transformer between them. |
| Add Phase Shifting Transformer | Click two buses to connect them with a PST (default 5° shift applied). |
| Add Load | Click a bus to attach a load (prompted for MW and MVAR values). |
| Add Shunt Cap | Click a bus to attach a capacitor bank (prompted for MVAR). |
| Add Shunt Reactor | Click a bus to attach a reactor (prompted for MVAR). |
| Delete | Click any element to remove it. Buses, branches, loads, caps, reactors, generators — all deletable. Prompts for confirmation. |
A bus represents a node in the network — physically, a substation busbar or any point where multiple connections meet. Each bus has one of three types:
Right-click any bus to change its type. In voltage-heatmap mode, the bus rectangle's fill color shows its voltage on a blue→white→red scale (low→nominal→high). In angle-heatmap mode, purple→white→orange shows lagging→reference→leading angle.
Branches come in two kinds:
R to rotate which side is primary.A generator symbol attaches to a bus that has hasGenerator: true. The label below the G shows actual P and Q output (computed for slack/PV, fixed for PQ).
A load triangle shows constant-power demand at a bus. Negative load values represent injection (e.g., a distributed generation site).
Shunt caps inject reactive power; shunt reactors absorb it. By default they're modeled as constant-MVAR devices, but you can switch to constant-susceptance (V²B) in the Modeling options group — see "Shunt modeling" below.
The colored triangles flowing along each branch show the direction and magnitude of power flow. Blue triangles on the upper side of each branch are real power (P, in MW); orange triangles on the lower side are reactive power (Q, in MVAR). Triangle direction encodes sign of flow; both density and speed scale with √(magnitude), so the visual flux (triangles passing a point per second) is proportional to the actual flow magnitude.
The central pedagogical point: P flows from higher angle to lower angle; Q flows from higher voltage to lower voltage. Watch what happens when you adjust a tap or a generator V setpoint — the orange triangles change direction visibly while the blue ones stay roughly the same.
Each row is one generator. Cells gray out when they don't apply to that generator's bus type.
| Column | Editable for | Meaning |
|---|---|---|
| Name | display only | Auto-numbered G1, G2, … in order of bus position. |
| Bus | display only | The bus this generator attaches to. |
| Type | all | Pick slack, PV, or PQ. Selecting "slack" demotes any existing slack to PV (only one slack allowed). |
| P gen (MW) | PV, PQ | Real-power dispatch. Read-only on slack (computed by solver). |
| Q gen (MVAR) | PQ only | Reactive-power output. Read-only on slack/PV (computed by solver). |
| V setpoint (pu) | slack, PV | Voltage setpoint to maintain. Read-only on PQ (V is computed). |
| P min (MW) | all | Minimum real-power output. Bounds the slider for PV/PQ; on slack, a violation triggers a warning (the slack is being asked to absorb more than physically possible). Empty = no limit. |
| P max (MW) | all | Maximum real-power output. Same enforcement as P min. |
| Q min (MVAR) | slack, PV | Minimum reactive output. With "Enforce PV Q limits" enabled, a PV bus that hits this limit converts to PQ with Q clamped (its V then floats to whatever the surviving system supports). |
| Q max (MVAR) | slack, PV | Maximum reactive output. Same enforcement as Q min. |
| Zgen r (pu) | slack, PV | Generator series resistance in pu. Captures copper/iron losses inside the machine plus step-up transformer. Default 0 (ideal source). Typical real values 0.001–0.005 pu. |
| Zgen x (pu) | slack, PV | Generator series reactance in pu — the Thevenin equivalent of subtransient/transient reactance plus generator step-up transformer reactance. Default 0. Typical real values 0.05–0.20 pu. With Zgen x > 0, the bus terminal voltage droops below the V setpoint as the generator loads up — the V setpoint becomes the internal EMF behind the impedance, not the terminal voltage. This is how real generators behave physically. |
Cells with a violated limit get a pink background. The bus results table shows an asterisk on the V cell when the actual voltage drifted from the setpoint due to a Q-limit hit; hover the asterisk for details.
When Zgen is non-zero, the V column in the bus results table shows the actual terminal voltage at that bus (what loads see). The V setpoint slider in the Controls panel sets the internal EMF — the terminal voltage will drop below this as the gen sources real or reactive power. With Zgen = 0 (default), terminal V equals the setpoint exactly.
Lists every bus that has nonzero base load. Each row gives:
The load model affects how the system responds to voltage swings. With constant-power loads, a voltage-collapse scenario can spiral: low V → fixed power demand → more current → more I²X drop → even lower V. With constant-impedance loads, low voltage automatically reduces the demand, providing natural stabilization. Real grids fall somewhere between (the IEEE "ZIP" model splits load into constant Z, constant I, and constant P fractions).
To add a new load to a bus that doesn't have one yet, edit the bus's row in the Bus settings table further down — set Pl/Ql to nonzero values and the load row will appear here automatically.
The "Total load (×)" slider in the Controls panel scales every load uniformly without modifying the underlying values. Useful for scenario sweeps.
When the load model is constant-impedance, the values shown in the P load and Q load columns are the rated values (at 1.0 pu). The actual P and Q drawn at the converged voltage appear in the Bus results table further down.
One row per bus with nonzero Qcap or Qreact:
You can mix models freely: a bus can have a constant-MVAR cap and a constant-Z reactor, or vice versa. The choice typically depends on the device technology — switched capacitor banks are well-modeled as constant-MVAR (they're rated at a specific point and switched in/out), while air-core reactors and saturable devices are better modeled as constant-Z. SVCs and STATCOMs in voltage-control mode are something else entirely (active control of Q to hold voltage), beyond what this tool models.
Each transformer row gives:
V_from/a as the network-side voltage. Increasing a lowers V_to; decreasing a boosts V_to.A phase-shifting transformer (PST) is structurally identical to a regular transformer except that it inserts a controllable angle φ between its from and to sides. The complex turns ratio τ = a · ejφ makes the Y-bus asymmetric — Yft ≠ Ytf when φ ≠ 0. This asymmetry is the entire mechanism: it forces real-power flow from one side to the other regardless of the natural impedance distribution.
The PST row has the same columns as a regular transformer with one addition:
Three ways to add a PST:
phaseShift on a transformer branch.Real-world example: PSTs are commonly used at the New York/Pennsylvania interface to control loop flows from PJM into NYISO. The interconnection has parallel paths through both control areas; the PSTs let operators dispatch real power along the contractual path rather than letting it follow the natural impedance distribution.
To see the effect in this demo: T4 (the PST tie between B5 and B6) is in parallel with the L57+L67 path through B7. Sweep its phase shift from −15° to +15° and watch the flow on T4 reverse direction while L57 and L67 mirror the change. Total system real-power balance is preserved at every angle — the PST just redirects flow between the two parallel paths.
Each line row gives:
The "P loss" and "Q loss" columns can be negative for lightly-loaded long lines. That's not a bug — it means the line's shunt charging (V²·b/2 at each end) exceeds the I²X consumption in the series reactance. The line is acting as a net VAR source rather than a sink.
This table edits raw bus parameters that don't fit elsewhere:
One slider per transformer. Range typically 0.85–1.15. Changing a tap immediately re-solves and you can watch flows redistribute.
Sliders are dynamically generated based on bus type:
Slider ranges respect Pmin/Pmax/Qmin/Qmax from the Generators table when they're set. If you type a value into a table cell that's outside the slider's current range, the slider auto-widens.
A single multiplier (0.2× to 1.5×) applied uniformly to every load in the system. Useful for "watch what happens at heavy load" scenarios without editing each bus individually.
Per-device modeling choices (load model, cap/reactor model) live in their respective tables, not here.
Solve forces an immediate re-solve (normally the solver runs automatically on any change). Reset returns transformer taps to 1.0 and load scale to 1.0; generator setpoints and topology are not touched.
Capture the live flow animation as either an Animated GIF or an MP4/WebM video. Format, aspect ratio, and resolution are all configurable. Output is watermarked with the NERX Power Consultants logo at the bottom-right and the model name at the top.
The ⛶ Fullscreen button (top right of the View toolbar above the diagram) expands the diagram to fill the entire screen. Useful for live presentations and LinkedIn demos where the constrained pane is too small to read at audience distance.
While fullscreen, the diagram and the Branch labels radio buttons are visible but the Generator/Load tables and Controls sliders are not — those stay in the underlying page. So the workflow is: set up your scenario first (adjust load scale, generator dispatch, transformer taps in the underlying view), then click the Fullscreen button. Once fullscreen, you can still toggle between display modes (P/Q flow, current, loading, voltage heatmap, angle heatmap) and zoom/pan the diagram.
Press Esc to exit fullscreen, or click the button again. Re-entering fullscreen always re-fits the diagram to the new pixel dimensions, so the content fills the screen edge-to-edge regardless of monitor aspect ratio.
Power flow non-convergence is one of the harder problems in steady-state analysis because it can mean fundamentally different things. When a solve fails, this tool runs an automatic diagnostic that tries to figure out which kind of failure has occurred and tells you what to do about it. The findings appear in a panel below the status bar.
The diagnostic checks for several distinct failure modes:
The auto-recovery is silent on success — if the only thing wrong was a stale hot-start, you'll see the "✓ Recovered" note and the model continues. Only persistent failures show the full diagnostic panel.
Voltage collapse is the most pedagogically interesting of these. In real grids it's the regime where utilities deploy SVCs, STATCOMs, switched capacitor banks, or under-voltage load shedding. The "P-V curve" or "nose curve" is the canonical visualization — the diagnostic's nose-scale estimate tells you roughly where the tip is. To explore this, try cranking individual load values up in the Loads table (the load-scale slider only goes to 1.5×, but the table cells accept any value).
When voltage collapse is detected, a "Trace P-V curve" button appears in the diagnostic panel. Clicking it runs an incremental-loading procedure (a simplified continuation power flow): starting from a low-load operating point, the load is gradually scaled up and the system re-solved at each step, hot-starting from the previous solution. Step size shrinks automatically as voltage drop accelerates near the nose. The result is plotted as |V| vs. λ for each load bus — that's the actual upper branch of the P-V curve for your system. The right edge marks the nose location with reasonable precision.
Other techniques baked into the solver to improve robustness:
This tool implements a standard balanced positive-sequence AC power flow with the following modeling choices:
For an 8-bus demo, this is more than adequate. For larger or more rigorous study work, use a commercial tool — but the math here is the same math those tools run.
Topology: Two generators (B1 slack, B2 PV) feed the system through step-up transformers T1 (B1→B3) and T2 (B2→B4). The 138 kV transmission network connects B3↔B5, B4↔B6, B5↔B6 (tie), B5↔B7, B6↔B7. A 138/13.8 kV step-down transformer T3 (B7→B8) feeds a distribution load at B8. Loads sit at B5, B6, B7, B8.
Solver: Polar Newton-Raphson on the full Jacobian (∂P/∂θ, ∂P/∂V, ∂Q/∂θ, ∂Q/∂V), tolerance 1e-6 pu on mismatches, 100 MVA base. Each Newton update is a damped step — the raw update is scaled so |Δθ| ≤ 30° per iteration and V stays within [0.5, 1.5] — which prevents overshoot near voltage-collapse folds without changing the converged solution. Cold starts are seeded by a DC power flow pre-solve (B'·θ = P, the linearized lossless network) so Newton begins with a physically reasonable angle profile instead of θ = 0.
Tap model: Off-nominal tap a on the from-side of an admittance y is modeled with the standard π-equivalent: series y/a, shunt (1-a)/a²·y on the from side, shunt (a-1)/a·y on the to side.
T4 note: T4 (B5↔B6) is a phase-shifting transformer (PST) with kvFrom = kvTo = 138 kV. With tap = 1.0 and a 5° default phase shift, it demonstrates how a PST redirects real power between parallel paths. Sweep the phase shift in the Controls panel or edit the PST table to explore the effect.
What to look for: P flows from the bus with the higher angle θ toward the lower-angle bus. Q flows from the higher-|V| bus toward the lower-|V| bus. Lowering T3's tap (boosting B8 voltage — see "tap convention" note below) changes how Q splits between the cap and the upstream system, even while P delivery stays the same.
1. Solve at defaults. Q flows from each high-V bus toward the lower-V neighbor; P flows from each high-θ bus toward the lower-θ neighbor.
2. Switch on the B8 shunt cap (try 20–30 MVAR). B8 voltage rises. With enough capacitance, B8 may exceed B7 — when it does, Q flow on T3 reverses (B8 backfeeds vars upstream).
3. With the cap on, sweep T3 tap. Tap convention here: tap a is on the from-side (B7); raising a lowers V_B8 because the LV side sees Vi/a. Watch how the tap-controlled |V| at B8 changes the Q split between cap and upstream.
4. Drop V_slack to 1.00. Q from B1 jumps as the system pulls vars from any remaining high-voltage source.
5. Push P at B2 to 200 MW. θ_B2 grows; P_T2 grows; Q at B2 also rises because longer angles need more vars to maintain |V|.
Every power flow model needs exactly one slack bus — the angle reference that absorbs the system imbalance. Choose which bus should serve that role:
Tip: a slack bus is normally the strongest generation source. You can change this later by right-clicking any bus.