Power Flow Analyzer: MATPOWER, PSS/E RAW, CGMES Load Flow
Pricing
Pay per event
Power Flow Analyzer: MATPOWER, PSS/E RAW, CGMES Load Flow
Run AC/DC power flow, N-1 contingency, short-circuit and hosting capacity studies on power grids: MATPOWER, PSS/E RAW, CGMES, UCTE, pandapower or JSON tables. Get voltage and loading violations, losses, OPF prices, tables, Excel and grid diagrams. For engineers and AI agents.
Pricing
Pay per event
Rating
0.0
(0)
Developer
Jumble Mog
Maintained by CommunityActor stats
0
Bookmarked
2
Total users
1
Monthly active users
11 hours ago
Last modified
Categories
Features
Share
Study a power grid in one API call: load flow, N-1 contingencies, short circuits, hosting capacity and optimal dispatch. Give links to network files (MATPOWER .m, PSS/E .raw, CGMES, UCTE-DEF and more), paste one, describe a small grid as JSON tables, or name one of 46 built-in test grids. For each network you get back:
- A load flow (AC Newton-Raphson, or DC): every bus's voltage and angle, every line's and transformer's flows, loading and losses, with a verdict (ok, warning or critical) and a one-line headline.
- Limit checks: buses outside the voltage band and branches over their rating (the network's own limits, or yours), generators past their reactive or active power limits, and buses no source reaches.
- N-1 contingency analysis: each line and transformer (and, on request, each generator) taken out in turn, the most loaded first. Every outage gets a status (secure, violations, islanding or no solution) and its worst effect, such as "losing L-7-9-1 puts T-4-7-1 at 174%". Parts that split off keep running on their own generators, and generation an outage takes away is made up by the other generators in proportion to their output, as their governors would.
- Short-circuit currents to IEC 60909: three-phase or two-phase faults, maximum or minimum case, with the initial current Ik'', the peak current ip and the short-circuit power at every bus. Where the file has no short-circuit data, typical values are filled in and named.
- Hosting capacity: how much new generation (or load) each bus takes on its own before a voltage or loading limit is passed, and which limit stops it.
- Optimal power flow when the file has generator costs (MATPOWER's
gencost): the lowest-cost dispatch within every limit, its cost against the case's own dispatch, the branches at their limit and each bus's marginal price (LMP). - Files: CSV tables of buses, branches, generators, loads, outages, short circuits and hosting capacity, one Excel workbook with all of them, the network as pandapower JSON (and as a MATPOWER case on request), and pictures: the grid coloured by loading, every bus's voltage against the band, the worst outages and a hosting capacity map.

The CIGRE MV benchmark with every load at 130%: two transformers over their rating (red) and nine buses below the voltage band (circled).

Hosting capacity of the built-in example, a German 20 kV grid: the new generation each of its 147 load buses takes before a limit is passed.

N-1 on the IEEE 14-bus PSS/E file: each bar is one outage and the highest loading it causes. Two of the 20 overload transformer T-4-7-1.
The power flow, short-circuit and optimal power flow calculations are pandapower's, an open-source power system library from the University of Kassel and Fraunhofer IEE. PSS/E, CGMES, UCTE and the other exchange formats are read with PowSyBl, the open-source grid toolkit started by RTE (the French transmission system operator), and converted by this tool. Every converted network is solved by both, and the voltages compared, so a conversion error shows up as a mismatch instead of a wrong answer. You install nothing: no MATPOWER, no PSS/E or PowerFactory licence, no Python.
It's made for:
- Distribution engineers checking where new solar, batteries or EV chargers fit (hosting capacity), or how a feeder copes with more load.
- Transmission planners and consultants who want N-1 screening and short-circuit levels from a PSS/E or CGMES file without opening PSS/E or PowerFactory.
- Students and researchers working with MATPOWER, PGLib-OPF or IEEE test cases: solved cases, N-1 tables and optimal dispatch from a link, in Excel or CSV.
- Developers building grid dashboards, interconnection screening or data pipelines who need power flow results by API, or a PSS/E or CGMES model converted to MATPOWER or pandapower.
- AI agents asked "is this grid N-1 secure?" or "how much solar can this feeder take?". A language model can't solve power flow equations; this tool hands it the findings as JSON and pictures it can show.
How to use it
- Give Networks: links to network files, or the name of a built-in grid. To try it, write
example. - Pick the Studies (power flow, N-1 and short circuit by default; add hosting capacity and optimal power flow), and if you like the limits and options of each.
- Click Start. The dataset has a row per network with the verdict, headline, numbers and findings. The files and pictures are in the run's key-value store, and
OUTPUTsums up the run.
How-to examples
The result lines come from runs of these inputs. The MATPOWER, PGLib-OPF and ANDES files are public test cases on GitHub; the tool downloads them from their links and they aren't part of it.
How to run a MATPOWER or PGLib-OPF case online
Put the link to the .m file in networks (a GitHub file page works) and add opf to the studies when the case has generator costs.
{"networks": ["https://github.com/MATPOWER/matpower/blob/master/data/case118.m","https://github.com/power-grid-lib/pglib-opf/blob/master/pglib_opf_case118_ieee.m"],"analyses": ["powerflow", "contingency", "shortcircuit", "opf"]}
Result for MATPOWER's case118: voltages 0.943 to 1.050 pu and 132.86 MW of losses (3.1%), with 6 generators past their reactive limits. The optimal dispatch costs 129,660.70 per hour, against 131,220.64 for the case's own. In the N-1 study 170 of 184 outages are secure; the worst, losing line 11 SouthBnd V2-13 Concord V2, leaves bus 13 Concord V2 at 0.902 pu. The PGLib-OPF version has branch ratings, and its own dispatch puts 10 branches over them (line 69-77 at 197% of 150 MVA). The optimal power flow brings its cost from 117,293.55 to 97,043.15 per hour within every limit, with line 49-69 and line 100-103 at theirs.
How to open a PSS/E RAW file without PSS/E
Give the link to the .raw file. The default studies are the power flow, N-1 and short circuit.
{"networks": ["https://github.com/CURENT/andes/blob/master/andes/cases/ieee14/ieee14.raw","https://github.com/CURENT/andes/blob/master/andes/cases/wecc/wecc.raw"]}
Result for the IEEE 14-bus file: voltages 1.010 to 1.030 pu and 2.73 MW of losses. In the N-1 study 18 of 20 outages are secure, and losing L-7-9-1 puts transformer T-4-7-1 at 174%. Short-circuit currents run from 23.69 kA at BUS1 down to 1.63 kA at BUS14, and PowSyBl's own load flow of the original file agrees to within 0.00001 pu. The WECC 179-bus file has 7 buses above its voltage band of 0.9 to 1.1 pu (highest 1.167 pu at 108 MIDWAY). Of its 263 outages, 217 are secure, 30 bring violations (losing T-160-161-1 leaves bus 160 NAUGHTON at 0.662 pu) and 13 find no solution.
How to find how much solar a feeder can take (hosting capacity)
Add hosting to the studies. Each bus with load is given new generation (or load, with hostingKind set to load) until a voltage or a branch passes its limit.
{"networks": ["example"],"analyses": ["hosting"]}
Result: the 147 load buses of the example, a German 20 kV grid, take 5.976 to 35.610 MW of new generation each (median 12.932 MW). Bus 92 takes the least, stopped by its own voltage passing 1.05 pu. High voltage is the limit at 101 buses and branch loading at 46. hosting.png maps it and hosting-capacity.csv has every bus. For one planned connection, name its bus in hostingBuses.
How to see how a grid copes with more load
Scale every load with loadScalingPercent (or every generator with generationScalingPercent).
{"networks": ["cigremv"],"loadScalingPercent": 130,"analyses": ["powerflow", "contingency"]}
Result: at 130% load the CIGRE medium-voltage benchmark is critical. Its two 25 MVA transformers carry 127% and 111% of their rating, and 9 buses fall below 0.95 pu (lowest 0.907 pu at Bus 11). In the N-1 study, losing Line 7-8 puts Trafo 0-1 at 133%, and 13 of the 17 outages cut off radial parts of the grid, the most load lost being 31.406 MW when Trafo 0-1 goes. The first picture on this page is this run's grid.png.
How to study a grid you describe yourself
Write it as JSON tables in network: pandapower's element tables (bus, line, trafo, trafo3w, load, sgen, gen, ext_grid, shunt, switch, storage, impedance, ward) with pandapower's parameter names, and buses referred to by name. Lines and transformers take one of pandapower's standard types (std_type) or their own parameters.
{"network": {"name": "Two feeders","bus": [{"name": "Grid", "vn_kv": 110}, {"name": "MV", "vn_kv": 20}, {"name": "A", "vn_kv": 20}, {"name": "B", "vn_kv": 20}, {"name": "C", "vn_kv": 20}],"ext_grid": [{"bus": "Grid", "vm_pu": 1.02}],"trafo": [{"name": "T1", "hv_bus": "Grid", "lv_bus": "MV", "std_type": "25 MVA 110/20 kV"}],"line": [{"name": "L1", "from_bus": "MV", "to_bus": "A", "length_km": 4, "std_type": "NA2XS2Y 1x240 RM/25 12/20 kV"},{"name": "L2", "from_bus": "A", "to_bus": "B", "length_km": 3, "std_type": "NA2XS2Y 1x95 RM/25 12/20 kV"},{"name": "L3", "from_bus": "MV", "to_bus": "C", "length_km": 6, "std_type": "NA2XS2Y 1x95 RM/25 12/20 kV"}],"load": [{"name": "Town", "bus": "A", "p_mw": 3, "q_mvar": 1}, {"bus": "B", "p_mw": 4, "q_mvar": 1.2}, {"bus": "C", "p_mw": 2.5, "q_mvar": 0.8}],"sgen": [{"name": "PV", "bus": "B", "p_mw": 1.5}]},"analyses": ["powerflow", "shortcircuit", "hosting"],"hostingKind": "load"}
Result: voltages 0.989 to 1.020 pu, L1 at 41% and 0.12 MW of losses. The short-circuit current is 26.25 kA at Grid (with a typical 5,000 MVA upstream grid, as the tables don't give one), 6.53 kA at the 20 kV busbar MV and 3.80 kA at C, the end of the longest cable. B and C each take 5.797 MW more load before their cable (L2, L3) reaches its rating, and A takes 8.560 MW before L1 does.
How to convert a PSS/E or CGMES model to MATPOWER or pandapower
Ask for the network and matpower outputs. The power flow runs either way, and conversionCheck says how closely the converted network's voltages match PowSyBl's load flow of the original file.
{"networks": ["https://github.com/CURENT/andes/blob/master/andes/cases/wecc/wecc.raw"],"analyses": ["powerflow"],"outputs": ["network", "matpower"]}
Result, in 3 seconds: network.m, a MATPOWER case with the bus names in mpc.bus_name, and network.json, a pandapower network. Read back in, the MATPOWER case gives the same voltages (0.950 to 1.167 pu) and losses (626.01 MW), and conversionCheck found no difference from PowSyBl's load flow over the 179 buses.
How to let an AI agent check a grid
Add the tool to the agent through Apify's MCP server at https://mcp.apify.com/?tools=jumblemog/power-flow-analyzer. Asked whether a grid is N-1 secure, the agent sends the file's link with "analyses": ["powerflow", "contingency"] and reads verdict, headline, findings and contingency.worst from the dataset. The headline is a sentence it can pass on as it is, such as "Solved: voltages 0.907 to 1.030 pu, highest loading 127% (Trafo 0-1), losses 0.34 MW (0.6%). 1 critical and 2 warnings: 2 branches over the limit: worst Trafo 0-1 at 127% of 25 MVA.", and the picture links are there for it to show.
FAQ
Which files can it read?
- MATPOWER cases (
.m, and.matsaved by MATLAB), with bus names (mpc.bus_name) and generator costs (mpc.gencost). PGLib-OPF and NESTA cases are MATPOWER cases. - PSS/E RAW versions 32, 33 and 35, and RAWX. Older versions (30, 31) aren't supported; PSS/E can save a case as version 33.
- CGMES (CIM 2.4.15 and 3.0): a ZIP of the XML profiles. The boundary set can be in the same ZIP or a ZIP of its own, and a ZIP of several models gives a network per model.
- UCTE-DEF (
.uct), the IEEE common data format, PowerFactory DGS exports, PowSyBl IIDM (.xiidm), pandapower JSON and JSON tables (below).
The format is found from the content, not the file name. gzip, bzip2, xz and ZIP files are unpacked, and #text at the end of a ZIP link takes only the files whose names contain the text.
How accurate is it?
The load flow solves the full AC equations, to a mismatch below 0.000001 MVA at every bus. On MATPOWER's own cases it gives MATPOWER's answers: case9's losses of 4.955 MW, and optimal dispatch costs of 5,296.68 per hour for case9 (MATPOWER: 5,296.69) and 129,660.70 for MATPOWER's case118 file (MATPOWER: 129,660.69). Converted PSS/E and CGMES files are checked against PowSyBl's OpenLoadFlow on the original file, and the dataset's conversionCheck gives the largest voltage difference; the largest seen in tests was 0.0021 pu (on the IEEE 300-bus case), and on the PSS/E files above it was below 0.0001 pu.
What limits does it check against?
Each bus's own voltage limits where the file has them (MATPOWER's Vmin and Vmax, PSS/E's normal limits), else 0.95 to 1.05 pu; and each line's and transformer's rating, at 100%. minVoltagePu, maxVoltagePu and maxLoadingPercent set your own for every bus and branch. MATPOWER writes 0 or 9,900 MVA for a branch without a rating; those branches aren't checked, and the findings say how many there are.
How does the N-1 study handle a split network and lost generation? When an outage splits the network, a part with generators and load keeps running on its own generators, and only parts without any are counted as lost load. When an outage takes generation away (a generator, or the transformer that connects it), the other generators make it up in proportion to their output, as their governors would, instead of the slack making up all of it. An outage that leaves no solution is reported as such: it often means voltage collapse. A violation the base case already has counts again only when the outage makes it worse (by 0.01 pu, or 5 percentage points of loading).
Is it a replacement for PSS/E, PowerFactory or MATPOWER? No: those do dynamics, protection, detailed control and much more. This tool does the everyday steady-state studies, by API, on many networks at once, and gives the results as JSON your code or agent can act on, plus Excel and CSV. It's also a quick way to open a PSS/E or CGMES file without a licence, and to convert it.
How big a network can it take?
Networks of several thousand buses work: the built-in case9241pegase (9,241 buses) was solved, with every table and picture, in 41 seconds at the default memory. N-1 takes one power flow per outage and hosting capacity 10 to 30 per bus, so they grow with the network: give the run more memory (a CPU core per 4 GB), lower maxContingencies and hostingMaxBuses, or raise timeLimitSeconds. A study that reaches the time limit stops early and says how far it got. Up to 50 networks a run and 500 files a ZIP.
Is my data kept? Each network is read in a temporary folder by a separate process that has no access to your Apify token, and the folder is deleted when the run ends. pandapower files are read as data: one that would run code is refused. The outputs stay in your own Apify storage.
Input
| Field | What it does |
|---|---|
networks | Links to network files, or built-in grid names (example, case9, case14, case39, case118, case300, case2869pegase, cigremv, gb ...). Up to 50. |
upload | A network file (or a ZIP of them) from your computer. |
networkText | The text of a network file: a MATPOWER case, a PSS/E RAW file, UCTE-DEF, IEEE common data format or JSON. |
network | A network as JSON tables (see the how-to above). |
analyses | powerflow, contingency, shortcircuit, hosting, opf (the first three by default; the power flow always runs). |
method | ac or dc (ac). |
enforceReactiveLimits | Generators past their reactive limit hold it and give up their voltage set point (off, as in MATPOWER's runpf). |
loadScalingPercent, generationScalingPercent | Every load, or every generator's active power, scaled (100). |
minVoltagePu, maxVoltagePu, maxLoadingPercent | Your own voltage band and loading limit for every bus and branch (the network's own, else 0.95 to 1.05 pu and 100%). |
contingencyElements | line, trafo, trafo3w, gen: what the N-1 study takes out (all but gen). |
maxContingencies | Only the outages of the most loaded branches, up to this many (all, as far as the time limit allows). |
faultType, shortCircuitCase | 3ph or 2ph; max or min (3ph, max). |
faultBuses | Bus names or numbers for the short-circuit study (every bus up to 2,000 buses). |
gridShortCircuitMva | The upstream grid's short-circuit power, for external grids that don't state it (typical values by voltage). |
hostingKind | generation or load added at each bus (generation). |
hostingBuses, hostingMaxBuses | The buses to study (the buses with load, the lowest voltage first), and the most to study (200). |
outputs | tables, excel, pictures, network, matpower (all but matpower). |
frequencyHz | The system frequency for files that don't state it (50; 60 for North America). |
timeLimitSeconds | Downloading and studying stop after this long (300 s). |
Output
- Dataset: one row per network, with
network,source,status,error,format,verdict,headline, the element counts (buses,lines,transformers,generators,loads...), the power flow (converged,method,solver,iterations,loadMw,generationMw,slackMw,lossesMw,lossesPercent,lossesByVoltage), the voltages (minVoltagePu,minVoltageBus,maxVoltagePu,maxVoltageBus,lowVoltageBuses,highVoltageBuses,voltageViolations), the loading (maxLoadingPercent,maxLoadingBranch,overloadedBranches,overloads,unratedBranches), supply (unsuppliedBuses,unsuppliedLoadMw,generatorsOutsideLimits),voltageBand,loadingLimit,findings,checks, the studies (contingency,shortCircuit,hostingCapacity,opf),conversionCheck,notes, the file links,downloadMB,secondsandevents. - Each finding has
severity(critical,warningorinfo),checkandmessage. - Key-value store:
grid.png,voltage.png,contingencies.png,hosting.png,buses.csv,branches.csv,generators.csv,loads.csv,contingencies.csv,short-circuit.csv,hosting-capacity.csv,results.xlsx,network.jsonandnetwork.m. With several networks, the second network's files start withnet2-, the third's withnet3-, and so on. - OUTPUT: the run as one JSON object, with every network's row and, for a single network, its file links at the top.
How it works
- Links are downloaded and uploads fetched. Web servers, S3 and other buckets, GitHub and GitLab file pages, Google Drive and Dropbox all work. Archives are unpacked, and network files are told apart from other files by their content.
- Each network is read by a separate process, as an unprivileged user, in a throwaway folder. MATPOWER and pandapower files go straight to pandapower. The other formats are read by PowSyBl, converted to pandapower (lines, two- and three-winding transformers with their taps and phase shifts, generators with their limits, loads, shunts, switches, HVDC links), then solved by both and compared.
- The power flow runs first. When Newton-Raphson finds no solution, three more ways are tried (a flat start, step-size control, more iterations), and then the DC power flow gives approximate flows, which the findings say. The other studies start from the solved case.
Pricing
You pay per network studied, at the price shown on this page. One event covers a network of up to 20 MB downloaded and 30 seconds of processing at the default 2 GB memory.
- A bigger file costs one more event for each further started 20 MB.
- A longer study costs an event for each further 30 seconds. At 4 GB that's every 15 seconds, since the platform's cost follows memory; a run with 4 GB has a whole CPU core and finishes about twice as fast, for about the same price.
Each network's events says what it counted for. In the runs above, the example grid with the default studies counted 1 event (14 s), MATPOWER's case118 with N-1, short circuit and the optimal power flow 2 (37 s), the WECC 179-bus PSS/E file 2 (56 s), and the example's hosting capacity at 147 buses 3 (89 s). Networks that can't be downloaded or read are never charged. Downloads stop at what the run's maximum charge still covers.
Speed
Times at the default 2 GB memory, which has half a CPU core, from the runs above:
| Network and studies | Time |
|---|---|
| WECC 179-bus PSS/E file converted to MATPOWER and pandapower (power flow only) | 3 s |
example, 179 buses: power flow, N-1 (183 outages) and short circuit, with every file and picture | 14 s |
| IEEE 14-bus PSS/E file, default studies | 21 s |
| MATPOWER case118: power flow, N-1 (184 outages), short circuit and optimal power flow | 37 s |
case9241pegase, 9,241 buses: power flow, with every file and picture | 41 s |
| WECC 179-bus PSS/E file, default studies (N-1 of 263 outages: 35 s) | 56 s |
example hosting capacity, 147 buses | 89 s |
The N-1 and hosting capacity studies take most of the time on bigger networks. With 4 GB the run has a whole CPU core and the studies take about half as long.
Tips and limits
- For a quick look at a big network, set
analysesto["powerflow"]: the N-1 and hosting capacity studies take most of the time. - To screen a planned connection, name its bus in
hostingBuseswithhostingKindset togeneration(solar, wind, batteries feeding in) orload(EV chargers, heat pumps, data centres). - Hosting capacity adds the new generation or load at unity power factor, at one bus at a time, to within 2%. It checks voltages and branch loading in steady state, not protection, flicker or harmonics.
- The optimal power flow limits each line's and transformer's current (its rating at nominal voltage), where MATPOWER limits apparent power. Where a branch limit binds and voltages are above nominal, the cost can come out slightly lower than MATPOWER's.
- Short-circuit currents use the data the file has. PSS/E RAW and MATPOWER files hold no short-circuit data for generators or the upstream grid, so typical values are used and named in
notes; givegridShortCircuitMvafor your own. - The checks are a screening, not a sign-off: a finding is a lead for a closer look in your planning tools.
For AI agents and developers
- Input:
networks(links or built-in names), and optionallyanalyses, the limits andoutputs. - Output: in the dataset, each network's
verdict,headline,findingsandchecks, the numbers behind them, and the studies (contingency,shortCircuit,hostingCapacity,opf).OUTPUThas every network with its file links. - Errors: a network that can't be read gets
status: "failed"and anerrorthat says why: a web page instead of a file, not a network file, an unsupported PSS/E version, or a ZIP with nothing matching the#part. A name that is close to a built-in grid's gets a suggestion. Failed networks cost nothing.
Add the tool to an agent through Apify's MCP server at https://mcp.apify.com/?tools=jumblemog/power-flow-analyzer. Or get the findings from one HTTP call:
curl -X POST "https://api.apify.com/v2/acts/jumblemog~power-flow-analyzer/run-sync-get-dataset-items?token=YOUR_TOKEN" \-H "Content-Type: application/json" \-d '{"networks": ["https://example.com/models/feeder.raw"], "analyses": ["powerflow", "contingency"], "outputs": ["tables"]}'
In Python, with the apify-client package:
from apify_client import ApifyClientclient = ApifyClient("YOUR_TOKEN")run = client.actor("jumblemog/power-flow-analyzer").call(run_input={"networks": ["case118"], "analyses": ["powerflow", "contingency", "opf"]})for row in client.dataset(run["defaultDatasetId"]).iterate_items():print(row["network"], row["verdict"], row["headline"])for finding in row["findings"]:print(" ", finding["severity"], finding["check"], finding["message"])store = client.key_value_store(run["defaultKeyValueStoreId"])with open("results.xlsx", "wb") as f:f.write(store.get_record_as_bytes("results.xlsx")["value"])
Credits
- Power flow, short circuit and optimal power flow: pandapower (BSD-3-Clause), with its built-in grids (MATPOWER's, PEGASE's and RTE's cases, the CIGRE benchmarks, the Kerber grids, LV Schutterwald and MV Oberrhein).
- PSS/E, CGMES, UCTE, IEEE common data format, DGS and IIDM: PowSyBl (pypowsybl, MPL-2.0), which also gives the second solver (OpenLoadFlow) for the conversion check.
- MATPOWER files: matpowercaseframes (MIT). Grid layout: igraph (GPL-2.0). Tables and pictures: pandas, NumPy, SciPy, Matplotlib and openpyxl.
- The how-to examples link to public test cases: MATPOWER's
case118.m(BSD-3-Clause), PGLib-OPF'spglib_opf_case118_ieee.m(CC BY 4.0) and ANDES' IEEE 14-bus and WECC 179-bus PSS/E files (GPL-3.0).