Power Flow Simulator v1.0

Tool:
Drag any bus or label to reposition it. Click a transformer to select it, then press R to rotate it. Right-click a bus to edit its type. Use the wheel to zoom; use the Pan tool or hold Space and drag to pan the canvas. After clicking the diagram, arrow keys pan (or nudge a selected bus); +/− zoom; 0 resets; F fits.
View: 100%
Tool:
Branch labels:
Show / Hide Diagram Labels
Real power (P) — top side
Reactive power (Q) — bottom side
Triangle direction = sign of flow, speed ∝ magnitude
Per-unit base: 100 MVA (impedances and voltages reported in pu)

Generators

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.

NameBusTypeP 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

Loads (MW + jMVAR)

BusVoltageP load (MW)Q load (MVAR)ModelIn service

Shunt compensation (MVAR) and bus base kV

Edit a bus's base kV to rebase impedances of connected lines and transformers. pu impedances are recomputed to preserve the underlying physical ohms.

BusBase kVCap (+MVAR injected)Cap modelCap in serviceReactor (−MVAR absorbed)Reactor modelReactor in service

Transformers (impedance and tap)

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.

NameF→TRated kV fromRated kV toBase kV fromBase kV tor (pu)x (pu)Tap aRating (MVA)In service

Phase-shifting transformers (PSTs)

A PST controls real-power flow by inserting a voltage phase angle between its from and to sides. The complex turns ratio τ = a · e 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.

NameF→TRated kV fromRated kV toBase kV fromBase kV tor (pu)x (pu)Tap aPhase shift (°)Rating (MVA)In service

Transmission lines (impedance)

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.

NameF→TBase kVr (pu)x (pu)b (pu)X/RRating (MVA)In service

Bus results

BusType|V| (pu)θ (deg)P genQ genP loadQ load

Branch flows (sending end)

BranchF→Tr (pu)x (pu)b (pu)P (MW)Q (MVAR)|S| (MVA)RatingLoadingP lossQ loss

How to use this program

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).

Quick start
  1. Drag a tap slider in the right pane to see real and reactive flows redistribute in real time.
  2. Click "Bus voltage heatmap" in the radio toggle below the diagram to see where the system is under- or over-voltage.
  3. Right-click a branch or element in the diagram to toggle it in/out of service (simulates an outage).
  4. Click any element in the diagram (a bus, a transformer, a load triangle) to select it — dotted lines connect it to its data labels.
  5. Right-click a bus to change its type (slack / PV / PQ).
  6. Use the toolbar above the diagram to add buses, generators, lines, transformers, loads, and shunt devices.
  7. Click "Share link" to generate a URL containing the entire model — paste it anywhere, anyone clicking it sees your exact case.
  8. Click "Export animation" with format=Video to record an MP4 of the flow animation, watermarked and ready to share.
Keyboard shortcuts (hotkeys)

Click anywhere in the diagram first to focus it (you'll see a soft blue outline). Then these keys are active:

KeyAction
Arrow keysPan the canvas (5% per press). If a bus is selected, nudges that bus by 5 px instead.
Shift + Arrow keysPan 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).
0Reset view to the default zoom and position.
FFit to content — auto-frame all buses and labels.
RRotate the selected transformer's primary/secondary orientation.
EscapeClear 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.

Mouse controls
ActionEffect
Left-click busSelect the bus (highlights it and connected labels).
Left-click branchSelect the branch.
Left-click empty spaceDeselect everything.
Drag a busReposition it in the diagram (Select tool must be active).
Drag a labelReposition the label manually; position is remembered.
Double-click a labelReset that label to its auto-calculated position.
Right-click a busChange bus type (slack / PV / PQ) via prompt.
Right-click a load/cap/reactor/gen iconToggle that device in/out of service.
Right-click a branch (line/xfmr)Toggle the branch in/out of service (simulates outage).
Right-click a labelReset it to the default auto-placement position.
Mouse wheelZoom in/out, centered on the cursor position.
Drag (Pan tool active)Pan the canvas in any direction.
Space + dragTemporary pan (works in any tool mode).
Toolbar tools reference

The toolbar above the diagram provides these tool modes (click to activate):

ToolHow to use
Select / moveDefault tool. Click to select elements, drag to reposition buses/labels.
PanDrag anywhere to scroll the canvas. Same as holding Space.
Add busClick in empty diagram space to create a new PQ bus.
Add generatorClick in empty space to create a new PV bus with a generator.
Add lineClick a from-bus, then click a to-bus to connect them with a transmission line.
Add transformerClick a from-bus, then click a to-bus to add a transformer between them.
Add Phase Shifting TransformerClick two buses to connect them with a PST (default 5° shift applied).
Add LoadClick a bus to attach a load (prompted for MW and MVAR values).
Add Shunt CapClick a bus to attach a capacitor bank (prompted for MVAR).
Add Shunt ReactorClick a bus to attach a reactor (prompted for MVAR).
DeleteClick any element to remove it. Buses, branches, loads, caps, reactors, generators — all deletable. Prompts for confirmation.

Model management buttons (right side of toolbar)

  • New model — clears everything and starts with a blank canvas.
  • 8 Bus Demo — loads a small system (slack + PV gen, three transformers, parallel transmission, mixed loads).
  • 40 Bus Demo — loads a three-region grid at 345/138/13.8 kV with multiple generators, a PST, and distributed reactive support.
  • Save JSON — downloads the model as a .json file to your computer.
  • Load JSON — opens a previously saved .json model file.
  • Share link — encodes the entire model into a URL hash; anyone clicking the URL sees your exact case.
  • Reset labels — clears all manual label position overrides; auto-placement resumes.

View controls

  • + / − buttons — zoom in/out (same as keyboard +/− or mouse wheel).
  • Fit — auto-frame all content including labels.
  • Reset — return to the default zoom and position.
  • ⛶ Fullscreen — expand the diagram to fill the entire screen (press Esc to exit).
The diagram — what each element means

Buses (the rectangular shapes)

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:

  • Slack bus (one per system, fixed voltage 1.0–1.05 pu, fixed angle 0°): the system's angle reference. Its real and reactive power are computed by the solver to balance the system.
  • PV bus (voltage-controlled generator): you specify P and V; the solver computes Q (the reactive support the generator must provide to hold V) and θ (the angle at which it operates).
  • PQ bus (load bus, also used for PQ-mode generators): you specify P and Q; the solver computes V and θ.

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 (the lines between buses)

Branches come in two kinds:

  • Lines (plain straight line): a transmission or distribution line, modeled as a π-equivalent with series resistance r, series reactance x, and total shunt charging susceptance b — all in per-unit on the system base of 100 MVA.
  • Transformers (two circles connected by a small line): a two-winding transformer with off-nominal turns ratio (tap). Click a transformer to select it, then press R to rotate which side is primary.

Generators (the "G" circles)

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).

Loads (the orange triangles)

A load triangle shows constant-power demand at a bus. Negative load values represent injection (e.g., a distributed generation site).

Shunt compensation (green capacitor symbols, brown reactor symbols)

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.

Animation triangles

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.

The Generators table

Each row is one generator. Cells gray out when they don't apply to that generator's bus type.

ColumnEditable forMeaning
Namedisplay onlyAuto-numbered G1, G2, … in order of bus position.
Busdisplay onlyThe bus this generator attaches to.
TypeallPick slack, PV, or PQ. Selecting "slack" demotes any existing slack to PV (only one slack allowed).
P gen (MW)PV, PQReal-power dispatch. Read-only on slack (computed by solver).
Q gen (MVAR)PQ onlyReactive-power output. Read-only on slack/PV (computed by solver).
V setpoint (pu)slack, PVVoltage setpoint to maintain. Read-only on PQ (V is computed).
P min (MW)allMinimum 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)allMaximum real-power output. Same enforcement as P min.
Q min (MVAR)slack, PVMinimum 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, PVMaximum reactive output. Same enforcement as Q min.
Zgen r (pu)slack, PVGenerator 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, PVGenerator 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.

The Loads table

Lists every bus that has nonzero base load. Each row gives:

  • P load (MW) and Q load (MVAR) — the rated demand at that bus. Negative values represent injection. For the constant-impedance model, this is the value drawn at exactly 1.0 pu; the actual draw scales with V².
  • Model — pick how the load behaves with voltage:
    • const P (default) — the load draws fixed P + jQ regardless of bus voltage. This is the standard textbook assumption. Most data-tabulated loads (industrial, motor-dominant, modern electronics with switched-mode supplies) approximate this.
    • const Z — the load looks like a constant impedance, so P and Q both scale with V². At 0.95 pu, the load draws only 0.9025 of rated. Resistive heating, incandescent lighting, and many distribution-level loads approximate this. Mathematically: P_drawn = P_rated · V², Q_drawn = Q_rated · V².
  • In service — uncheck to remove this load from the solve (e.g., to simulate a feeder trip). The load doesn't get deleted; just zeroed for the next solve.

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.

The Shunt compensation table

One row per bus with nonzero Qcap or Qreact:

  • Q cap (MVAR) — capacitive injection at the bus, rated at 1.0 pu. Always entered as a positive number.
  • Cap model — pick how the capacitor behaves with voltage:
    • const MVAR (default) — the cap injects exactly the rated MVAR regardless of bus voltage. The simple textbook assumption.
    • const Z (V²B) — the cap is modeled as a constant susceptance B in the Y-bus, so it injects Q ≈ V²·B. A 20 MVAR cap at 0.95 pu injects only ~18 MVAR (= 20 · 0.9025). This is what real shunt capacitors actually do — their VAR output drops when you most need it (low V) and rises when you don't (high V).
  • Q reactor (MVAR) — reactive absorption at the bus, also entered as a positive number.
  • Reactor model — same options as Cap model. Constant-MVAR reactors absorb their rated value regardless of voltage; constant-Z reactors absorb less at low voltage (which is good for stability) and more at high voltage.
  • In service checkboxes — toggle each independently. A bus can have both a cap and a reactor; the net effect is determined by which is in service.

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.

The Transformers table

Each transformer row gives:

  • Branch / F→T — name and which buses it connects.
  • kV ratings — primary and secondary voltage ratings, used to compute the off-nominal turns ratio in conjunction with the bus base kVs.
  • r, x — series impedance in per-unit on the system base. b is always 0 for transformers in this tool (no magnetizing branch).
  • Tap ratio (a) — off-nominal tap on the from side. The π-equivalent uses V_from/a as the network-side voltage. Increasing a lowers V_to; decreasing a boosts V_to.
  • Rating (MVA) — nameplate MVA, used to compute % loading shown in the loading display mode. The fundamental thermal limit is actually a current rating (the windings can only dissipate so much I²R heat); MVA is just the nameplate convention because at 1.0 pu voltage, MVA and current are equivalent. At lower voltage, the same current corresponds to less MVA — so a transformer carrying its nameplate MVA at, say, 0.92 pu is actually carrying about 109% of its rated current and is thermally overloaded even though % loading reads 100%. Switch to the Current (A) display mode to see the actual currents and check this directly against the equipment's nameplate amp rating.
  • In service — uncheck to take the transformer out of service. The branch is removed from the Y-bus entirely.
  • → PST button — promotes this transformer to a phase-shifting transformer. A default 5° phase shift is applied; the row moves to the PST table where you can adjust it further.
The Phase-shifting transformers table

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 · e 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:

  • Phase shift (°) — the angle φ in degrees. Positive means the from-side leads the to-side. Typical values are ±5° to ±20° depending on the device design. You can also drag the corresponding slider in the Controls panel for fine-grained adjustment.
  • Demote button — clears the PST status (zeros the phase shift, removes the PST classification) and moves the row back to the regular Transformers table.

Three ways to add a PST:

  1. Click the Add Phase Shifting Transformer button in the diagram toolbar, then click two buses to connect them. A default 5° phase shift is applied.
  2. Click → PST on any existing transformer row to promote it.
  3. Edit a JSON model file with a non-zero 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.

The Lines table

Each line row gives:

  • r (pu) — series resistance in per-unit on the system base.
  • x (pu) — series reactance in per-unit. Together with r, this defines the line's series impedance.
  • b (pu) — total shunt charging susceptance in per-unit. Half is placed at each end in the π-equivalent. Set to 0 for short lines where charging is negligible.
  • Base kV — the line's nominal voltage. Editing this triggers a per-unit rebasing of r, x, b on this and all other lines in the same connected voltage zone, preserving physical ohms.
  • Rating (MVA) — thermal rating used for % loading display. As with transformers, the underlying limit is really a current rating (conductor ampacity — how many amps the wire can carry without exceeding its annealing or sag temperature). MVA = √3 · V_LL · I_A at 1.0 pu, and the conversion only stays clean at 1.0 pu. At lower voltage, the same conductor current draws less MVA, so a 100 MVA line carrying its nameplate MVA at 0.95 pu is actually carrying about 105% of its rated current. Use the Current (A) display mode when low-voltage operation matters for ampacity verification.
  • In service — same as transformer in-service.

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.

The Bus settings table

This table edits raw bus parameters that don't fit elsewhere:

  • Base kV — the bus's voltage zone. Editing rebases all connected branches to preserve physical ohms.
  • Pl, Ql — the bus's base load (before scaling and shunt adjustments). Set both to 0 to remove the bus from the Loads table.
  • Q cap, Q reactor — the rated MVAR values for shunt compensation devices at this bus.
  • B shunt (pu) — a generic shunt susceptance value, separate from the cap/reactor model. Use this if you want to model arbitrary shunt admittance (e.g., line-end equivalents from external systems).
The Controls panel (right side)

Transformer tap ratios

One slider per transformer. Range typically 0.85–1.15. Changing a tap immediately re-solves and you can watch flows redistribute.

Generator setpoints

Sliders are dynamically generated based on bus type:

  • Slack: V setpoint slider only (1.00–1.10 pu typically).
  • PV: V setpoint + P dispatch sliders.
  • PQ generator: P + Q dispatch sliders.

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.

Load scaling

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.

Modeling options

  • Enforce PV generator Q limits — when checked, the solver runs an outer loop. After each inner solve, any PV bus whose computed Q exceeds Qmin/Qmax converts to PQ with Q clamped at the violated limit; its V then floats to whatever the system can support. The user's PV designation and V setpoint are preserved across the conversion.

Per-device modeling choices (load model, cap/reactor model) live in their respective tables, not here.

Solve / Reset

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.

Export animation

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.

Fullscreen mode

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.

Display modes (radio toggle below the diagram)
  • P, Q flow (MW, MVAR) — the default. Branch labels show real and reactive flow magnitudes. Branch coloring is neutral.
  • Current (A) — branch labels show the current magnitude in amperes at each end of the branch, computed from |I| = |S| / V converted to amps using each bus's base kV (I_A = I_pu × S_base / [√3 × V_base_LL]). For a transmission line both ends carry essentially the same current; for a transformer the two ends differ by the turns ratio (HV side has lower amps, LV side has higher amps). This is the view a relay engineer or protection settings person works in — gear is rated and CT-tapped in amps, not MVA. Equipment thermal limits are fundamentally current limits; MVA is just a convenient nameplate at 1.0 pu voltage.
  • Loading (% of rating) — branches recolor by % of their MVA rating: green below 50%, light green 50–80%, amber 80–100%, red above 100%. Useful for spotting overloads at a glance. Caveat: equipment ratings are fundamentally current-based (thermal limits on conductor or winding heat dissipation), and the MVA rating is only equivalent to the current rating at 1.0 pu voltage. At depressed voltage the same nameplate MVA corresponds to a higher current — a transformer reading 100% MVA loading at 0.93 pu is actually carrying about 108% of its rated amps. For a true thermal check at low voltage, switch to the Current (A) display mode and compare against the equipment's nameplate amp rating.
  • Bus voltage heatmap — bus rectangles recolor by |V| in pu. Diverging blue→white→red scale centered at 1.0 pu. The two halves are scaled independently so the worst-low bus always saturates blue and the worst-high bus always saturates red. Legend at bottom-left of the diagram.
  • Bus angle heatmap — bus rectangles recolor by θ in degrees. Diverging purple→white→orange centered at 0° (slack reference). Same independent-half scaling.
When the solver fails: convergence diagnostics

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:

  • Topology error (islanded buses). A bus has no in-service path to the slack bus, so the Y-bus is structurally singular. The diagnostic walks the connectivity graph from the slack and lists every bus it can't reach. Fix: restore an out-of-service branch, or remove the disconnected components.
  • Data inconsistency. Things like Qmin > Qmax (no feasible point), Pmin > Pmax, or branches with effectively zero impedance (which would give an infinite admittance). Fix: correct the inconsistent value.
  • Bad initial guess. A solution exists but the solver couldn't find it from where it started. Most commonly this happens after a big topology change when the hot-start values mislead the solver. The diagnostic automatically retries from a flat start (V = 1.0) and a warm start (V = 0.95). If either succeeds, the system is left in the recovered state with a green "✓ Recovered" message.
  • Voltage collapse. The system is loaded past its voltage-stability limit (the "nose" of the P-V curve). No real solution exists at the requested loading. The diagnostic detects this by binary-searching the load scale: if the system converges at, say, 60% of the requested load but not at 100%, you're past the nose at 100%. The panel reports the approximate nose location. Fix options: reduce loads, add reactive support (caps/SVCs at the weak buses), strengthen transmission paths, or raise generator V setpoints.
  • Q-limit chattering. With Q-limits enforcement enabled, the outer loop can sometimes oscillate between two configurations of which buses are clamped — this means no fixed-point assignment exists with the current limits. The diagnostic detects when the same conversion pattern repeats and stops, rather than spinning forever.

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:

  • Damped Newton step. A full Newton step can overshoot near folds or with bad starting points. Each step is capped to keep |Δθ| ≤ 30° and V ∈ [0.4, 1.6]. Near a real solution the cap doesn't bind, so converged solves take the same number of iterations as undamped Newton; far from a solution, damping prevents the iterates from blowing up.
  • DC power flow seed. On cold starts, the solver first solves the linearized lossless DC equations to get a better angle starting point than θ = 0. For systems with heavy transmission flow (where real angles can spread 20–30°), this saves 1–2 iterations and rescues some cases where flat θ = 0 would lead Newton astray.
Modeling assumptions and limitations

This tool implements a standard balanced positive-sequence AC power flow with the following modeling choices:

  • Solver: Newton-Raphson in polar form, with full Jacobian and partial-pivot Gaussian elimination. Damped step control caps |Δθ| at 30° and keeps V within [0.5, 1.5] per iteration to prevent overshoot near folds. Hot-start from previous solution for incremental edits; DC power flow seed on cold starts (solves the linearized lossless equations B'·θ = P first to get a much better θ starting estimate than θ = 0, especially for systems with significant transmission flow).
  • System base: 100 MVA. All per-unit values are on this base.
  • Convergence: max mismatch tolerance 1×10⁻⁶ pu, with a 50-iteration cap.
  • Lines: nominal-π model with series r + jx and total shunt jb (half at each end). No long-line correction. No zero-sequence or harmonic modeling.
  • Transformers: off-nominal-tap π-equivalent, from-side tap convention. No magnetizing branch. Phase-shifting transformers supported (complex-tap model τ = a·e^(jφ)). Charging b is supported but typically zero for transformers.
  • Loads: per-bus selectable constant power (default) or constant impedance (P, Q ∝ V²). No constant-current, no full ZIP, no motor models.
  • Shunts: per-device selectable constant-MVAR (default) or constant-susceptance. Cap and reactor at the same bus can use different models.
  • Generator Q limits: optional, enforced via PV→PQ conversion outer loop.
  • Generator impedance: optional Thevenin series Zgen = r + jx per generator. Implemented as a phantom internal bus during the solve, transparent to the rest of the UI.
  • What's not modeled: dynamic stability, fault analysis, harmonics, three-phase asymmetry, frequency dependence, voltage-dependent loads, contingency screening, optimal power flow.

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.

Controls

Transformer tap ratios
Generator setpoints
Load scaling
1.00
Modeling options
Ready
About this model

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.

Export animation
30
6
Recording captures the current operating point with the live triangle animation.
Things to try

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|.

Recording

Capturing frames…
Download