Contingency Analysis

pandapower

Contingency analysis takes equipment out of service one piece at a time, runs AC load flow, and flags thermal or voltage violations. Today this is single-outage (N-1 style) only. Overview: N-1 contingency guide.

Where to find it

Simulate → Contingency Analysis. Requires a subscription. Confirm a base Load Flow converges first.

When to use

  • N-1 screening for overloads and voltage excursions
  • Ranking outages by violation count
  • A worst-case snapshot for reinforcement discussions
Current limits

Only one element is outaged at a time (line, two-winding transformer, or synchronous generator). Dialog options for N-2, N-K, selected subsets, and redispatch are reserved for later releases and are not applied yet.

How to run

  1. Build and solve a normal Load Flow first so the network is connected and the base case converges.
  2. Ensure each busbar has a numeric nominal voltage vn_kv (kV), not descriptive text from other equipment.
  3. Click Simulate → Contingency Analysis (active subscription required).
  4. In the Contingency Analysis Parameters dialog, set element type (lines, transformers, generators, or all), voltage and thermal limit checks, and thresholds (min/max voltage in p.u., maximum loading %).
  5. Click Analyze. When the study completes, the Contingency Analysis Results dialog opens automatically.
  6. Use filters and expandable rows to inspect violations; download CSV for a full audit trail or expand Worst-case network snapshot for bus/line/trafo values after the heaviest outage.

Results dialog

After a successful run, Electrisim shows an interactive results window (not only console output):

  • Summary cards — cases analyzed, converged, failed, cases with violations, total violation count.
  • Search and filters — find a case by name or outage text; show All, With violations, or Failed only.
  • Case list — sorted by violation count (highest first). Each row shows status (Converged, Non-convergent, or Failed), a violation badge, and a short summary (e.g. voltage vs thermal counts).
  • Expandable details — click a row to open grouped tables for voltage and thermal violations (up to 25 rows per group in the UI; use CSV for the full list).
  • Worst-case snapshot — collapsible section with bus, line, and transformer results from the contingency with the most violations (same data used for optional diagram colouring).
  • Download CSV — exports every case with status and violation summaries.

Non-convergent cases mean the AC power flow did not solve after that outage (often islanding or loss of slack). Failed indicates another backend error; the detail row shows the message.

How it works (backend)

How it works (backend)

  1. Network export: The diagram is collected with the same prepareNetworkData pipeline as Load Flow (buses, lines, transformers, generators, loads, external grid, and so on).
  2. Base case: Run AC load flow on the intact network; abort if isolated buses are detected.
  3. Build cases: For each in-service element of the selected type, create one contingency record.
  4. Outage simulation: deepcopy the network, set that element in_service = False, run runpp.
  5. Limits: Compare bus voltages to your min/max (p.u.) and line/trafo loading to your maximum percent.
  6. Response: Return per-case results, summary, worst-case element arrays, and JSON-safe numeric values (NaN/Inf converted to null for the browser).

Prerequisites

  • Solvable base-case AC power flow (slack/external grid, connected topology).
  • Reasonable voltage and thermal limits for meaningful violation detection.
  • Valid bus vn_kv on every busbar (numeric kV).

Dialog parameters

These fields are sent as ContingencyAnalysisPandaPower Parameters in the POST body together with network elements (see development/API notes if you integrate programmatically).

Parameter Description Honoured in backend?
contingency_type N-1, N-2, or N-K (UI label) No (reserved; only N-1-style single outages run)
element_type line, transformer, generator, or all Yes
elements_to_analyze All, critical only, or selected only (UI) No (reserved; all matching in-service elements are used)
voltage_limits, thermal_limits Enable/disable voltage or thermal checks (true / false) Yes
min_vm_pu, max_vm_pu Bus voltage violation thresholds (per unit) Yes
max_loading_percent Line and transformer overload threshold (%) Yes
post_contingency_actions None, redispatch, load shedding, or both (UI) No (reserved)
analysis_mode Fast screening, detailed, or comprehensive (UI) No (reserved)
user_email Logged-in user (server logging) Yes

Outputs and JSON shape

The HTTP response is JSON (often gzip-compressed). Top-level keys:

Key Content
bus, line, transformer Arrays for the worst contingency (maximum violation count)—compact values for diagram colouring.
summary contingencies_analyzed, flat violations list, critical_contingencies (high-severity or non-convergent cases), total_violations, total_critical.
contingency_results Full per-case list: name, description, converged, optional error, violations (type, element, description, severity), and when converged bus_results / line_results / trafo_results.
error Present if the whole study failed (e.g. no cases, isolated buses, validation error).

Extracting results: Use contingency_results for complete audit trails and CSV export; use summary.critical_contingencies for quick screening; use top-level bus/line/transformer only for the worst-case view on the canvas.

Relationship to pandapower documentation

pandapower documents contingency workflows under Contingency analysis, including run_contingency and limit helpers. Electrisim follows the same physical idea (sequential AC PF after outages) but uses its own loop so the UI can evolve independently. For deeper algorithm options, refer to the official docs.

Limitations

  • Steady-state only—no transient or voltage stability assessment.
  • Each case removes one element; double or common-mode outages are not generated.
  • No automatic redispatch or load shedding after an outage.
  • Islanded or non-convergent cases are reported with converged: false and an error or convergence violation entry.
  • Large networks may produce many voltage violations per case when limits are tight; use the results dialog filters and CSV export rather than reading every violation in the UI.

Technical references

pandapower v3.3.2 — Contingency analysis · runpp

Data center interconnection workflow

pandapower ANDES

Electrisim supports a practical data-center interconnection path on existing engines: site screening with headroom and contingencies, ANSI pre/post short circuit, and ANDES RMS dynamics with an optional computational-load ride-through check. It does not bundle MMWG/WECC/ISO cases, read PSS/E CMLD/PERC1 .dyr records, or run EMT (ParaEMT/dpsim). Overview: Data center interconnection guide.

Where to start

New diagram → Data center interconnection (utility pocket) tutorial for a small POI workflow, IEEE 118-bus transmission benchmark for a public 118-bus MATPOWER case (templates/tutorials/ieee118.py), or IEEE 300-bus transmission benchmark for the larger public case (templates/tutorials/ieee300.py). Neither is an official MMWG, WECC, ERCOT, or ISO planning base. PSS/E .raw and TARA .con are not imported directly.

Site screening (Beta)

Simulate → Data Center Site Screening (Beta). Tick the candidate loads, set MW sizes (for example 300, 500, 1000), power factor, voltage and thermal limits, and whether to include capped N-1-1 (line/transformer pairs, with a hard cap on the number of cases). Show hides the dialog and selects that load on the canvas; Back to site screening restores the dialog with your selections kept. Minimize on the title bar does the same.

The results table lists headroom MW, the intact system, the worst N-1 and N-1-1 cases, and an upgrade likely outcome when headroom is below the requested size or an outage adds violations. Click a violation count to see each bus, line, and transformer that is outside the limits, together with the value and the limit. Open this load flow in Network Dashboard hides the results and opens that case. The project load is selected on the diagram and labeled with the megawatts used in the case. That label is removed when you return to the results or close the dashboard. In the dashboard, click a critical issue to scroll to that element. CSV export uses the same columns as the table.

Short circuit (pre vs post)

On Simulate → Short Circuit, Pandapower tab: tick ANSI/IEEE C37 (beta) and Compare pre/post project. List project elements to take out in the pre case (data-center load, on-site gen, BESS). Export pre/post CSV from the results dialog; for single-line-to-ground faults, use I½ sym at the POI for NGR sizing. IEC 60909 remains available on the same dialog; methods are not interchangeable for utility submission without engineering review.

Dynamics and computational load

Simulate → Transient Stability (ANDES): optional bus fault, line outage, generator trip, and POI bus for voltage/frequency metrics. On the Load dialog, Data center tab enables a ride-through CSV (time vs minimum voltage pu). After TDS, Electrisim compares the POI RMS voltage trace to that curve (pass/fail). This models IT constant-P and cooling via ZIP fields; it is not CMLD/PERC1 and not sub-cycle EMT.

Out of scope in this release

Copyrighted WECC/MMWG/ERCOT/ISO base cases, CMLD/PERC1 dynamic load records, transformer inrush, and sub-cycle sag (EMT) require external tools or future ParaEMT integration.

Last updated: October 2026

Electrisim on YouTube · Frontend on GitHub