RunMat for energy

Run power-flow and hosting-capacity scripts in the MATLAB language, from one case on a laptop to every hour of the year on a cluster.

Talk to us

Run grid studies in the language your team already knows

Your power-flow, hosting-capacity and load-flow scripts run in RunMat as they are, so nobody rewrites them in Python and validates them again.

The script beside this matches the published solution for a standard IEEE test grid.

Linear algebraMigration guide

power-flow.m
P = (bus(:, 6) - bus(:, 4)) / 100; Q = -bus(:, 5) / 100;
pv = find(bus(:, 2) == 2); pq = find(bus(:, 2) == 0); ns = vertcat(pv, pq);
V = bus(:, 3); th = zeros(n, 1); S = zeros(n, 1);
for it = 1:20
E = V .* exp(1i*th);
S = E .* conj(Y*E);
mis = vertcat(P(ns) - real(S(ns)), Q(pq) - imag(S(pq)));
if max(abs(mis)) < 1e-8, break; end
dSdth = 1i*diag(E)*conj(diag(Y*E) - Y*diag(E));
dSdV = diag(E)*conj(Y*diag(E./V)) + diag(conj(Y*E).*(E./V));
J = vertcat(horzcat(real(dSdth(ns, ns)), real(dSdV(ns, pq))), ...
horzcat(imag(dSdth(pq, ns)), imag(dSdV(pq, pq))));
dx = J \ mis;
m = numel(ns);
th(ns) = th(ns) + dx((1:m)');
V(pq) = V(pq) + dx((m+1:numel(dx))');
end
Terminal
$ runmat power-flow.m
slack bus supplies 232.4 MW and -16.5 Mvar
bus 14 at 1.036 pu, -16.03 degrees (published 1.036 pu, -16.04)

Run a full year with the script you wrote for one hour

Run the hosting-capacity script you wrote for one hour across every hour of the year, so the study covers the whole year.

Change for to parfor and RunMat spreads it across a workstation's cores or a cluster you run. Each run is kept with its inputs.

ParallelGPU

% Power flow for every hour of the year
vmax = zeros(8760, 1);
parfor k = 1:8760
    b = scale(bus, load(k), solar(k));
    vmax(k) = max(powerflow(b, br));
end
over = find(vmax > 1.05);
LaptopRemote serverLARGE CLUSTER

Work on the same study together, live

Planners open the same project and edit the same scripts at once. Each person sees the others' cursors and edits as they happen, and a rerun shows everyone the new result.

Every run is kept with the case, the script version and who ran it, so a study can be reviewed, handed over or rerun months later from the copy that produced its numbers.

A deterministic engine designed for AI models to use in controlled loops

RunMat is a deterministic engine: the same case and script give the same result every time. It is designed for AI models to use in a controlled loop, for work like the studies on this page.

The model writes the script or the study. RunMat checks its types, shapes and units and sends any error back for the model to fix, then runs it. The model reports the result and how it was computed, and every number in that answer came from RunMat, so it can go in a planning study.

It works with Claude Code, Codex, any MCP client or the agent built into RunMat, on the model your company already uses.

AI integrations

Works withClaude CodeCodexAny MCP client

AI modelSets up and interpretsRunMatChecks and runs the studystudyerrors and results
  1. ModelWrites cantilever.fea
  2. RunMatline 28: traction must be force per area, found N
  3. ModelFixes the load unit: N → Pa
  4. RunMatSolved · tip deflection 0.199 mm, beam theory 0.200 mm
  5. ModelReports the results and how they were computed

Define and run physics simulations quickly

Check a tower's first mode against 1P and 3P as a study in the same project as the rest of the analysis, with a beam model beside it to check against. When the foundation stiffness or the nacelle mass changes, edit one line and rerun.

A study is a short text file with a unit on every number, so a variant is a change you can review line by line, and a sweep over foundations or masses runs in parallel like any script.

StructuralSimulation in RunMat

tower-modal.fea
Mode 1 relative amplitude · 364.81 Hz from the saved analysis study
Beam model, first fore-aft mode
0.336 Hz
NREL reference turbine report
0.324 Hz

Preview: a solved RunMat modal study of a tuning fork. This tower's first mode replaces it once the study runs.

Keep base cases inside the company

Base cases are CEII. RunMat runs on servers you control, offline if needed, so the cases never leave the network.

Self-hosted deployment

Examples

Bus voltages of the IEEE 14-bus case against 0.95 and 1.05 pu, rendered by RunMat

Newton-Raphson power flow

The IEEE 14-bus case, checked against its published solution.

Bus 14 voltage rising with solar at the bus against a 3% rise limit, rendered by RunMat

Hosting capacity

How much solar a bus takes before its voltage passes the limit.

Histogram of hourly wind speed with a fitted Weibull density, rendered by RunMat

Wind energy yield

A Weibull fit to a year of wind and a 5 MW turbine's output.

Tower first frequency against 1P and 3P lines over rotor speed, rendered by RunMat

Tower against 1P and 3P

The NREL 5-MW tower's first mode against rotor excitation.

Hot and cold outlet temperatures against heat-transfer area, rendered by RunMat

Heat exchanger sizing

Effectiveness-NTU for a counterflow exchanger.

A utility's hourly load for a year sorted from highest to lowest, rendered by RunMat

Load-duration curve

A year of hourly load, its peak and its load factor.

What RunMat does not do

  • Electromagnetic transient and protection-coordination studies
  • Reading case files saved by commercial grid tools
  • Production-cost models with integer unit commitment
  • Aeroelastic loads on turbine blades and towers

Start here

  1. 01

    Open the IEEE 14-bus power flow in a browser. No account needed.

  2. 02

    Run three planning scripts and compare results and run times.

  3. 03

    Talk to us about where your models need to run.

Linear algebraStatisticsSignal processingSimulation in RunMat