Showcase · Optimal power flow

Least-cost power dispatch, within the physics

An electric grid must meet demand every moment at least cost, without pushing any line, voltage, or generator past its limit — a capacitated optimization problem with the same shape as the routing, scheduling, and dispatch problems BIS models for clients. Here it is built end to end in AMPL on the public IEEE test systems. BIS has no power-systems client, and that is the point: what follows is the method, not a résumé, and every number is reproducible from the linked repository.

118buses on the largest IEEE grid — solved to its published optimum
$97,214per-hour least-cost dispatch AC-OPF finds on that grid
4lines the fast linear model would silently overload — caught here
≤1e⁻⁵relative error vs the published PGLib-OPF baseline
The decision

A dispatch problem, in a client’s terms

Optimal power flow decides how much real and reactive power each generator produces, and the voltage it holds, to serve demand at least cost while respecting every thermal, voltage, and angle limit. Strip the domain away and it is the decision BIS builds engines for every day: allocate scarce capacity across a network, cheaply, without breaking a constraint. On a 40,000-location routing engine that discipline cut the fleet by 20%; here it produces the cheapest safe dispatch. The modeling is the same craft.

line at its limitCheap baseloadlowest $/MWhMid-merit unitmoderate costPeakerexpensive — last resortGeneratorssubstationTransmission networkCitypower demandIndustrypower demandLoads
The decision, without equations: how hard should each generator run so demand is met at the lowest cost — while no transmission line is pushed past its limit (the red line is already there)? Optimal power flow answers exactly that. It is the same shape as allocating any scarce, networked capacity — the routing, scheduling, and dispatch problems BIS builds engines for.
The model

Two models, one honest relationship — written in AMPL

The fast model, DC‑OPF, assumes flat voltages and no reactive power; it is convex and clears in milliseconds. The true model, AC‑OPF, keeps the full physics — reactive power, voltages, losses, transformer taps, and apparent-power limits at both ends of every line. It is nonconvex, so a solver reporting “optimal” has found a local optimum — which is why BIS also computes a convex lower bound to certify how close that is. AMPL keeps the model readable and the data separate, so a customer’s own team can read every line and change a limit without touching the engine.

DC-OPF · the fast screenlinear and convex — one global optimumclears in millisecondsassumes flat voltages, ignores lossesblind to reactive power & voltage limitsAC-OPF · the true physicsfull nonlinear physics of the gridreactive power, voltages, real lossesnonconvex → solver finds a local optimumcertified with a convex lower boundhand the fast dispatch to the true physics — and see what it overloaded
Two models, one honest relationship. The DC model screens in milliseconds but cannot see voltage, reactive power, or losses; the AC model keeps the full physics but is nonconvex, so “optimal” means a local optimum — which is why BIS also computes a convex lower bound to certify how close it is.
model/dcopf.mod — the screening model, in full
minimize cost:
    sum {k in GEN} (c2[k]*p[k]^2 + c1[k]*p[k] + c0[k]);

subject to balance {i in BUS}:                      # power in = power out
    sum {k in GEN_AT[i]} p[k] - Pd[i] - Gs[i]
      = sum {l in BR_FROM[i]} f[l] - sum {l in BR_TO[i]} f[l];

subject to flow_max {l in BRANCH}:  f[l] <= rate_a[l];   # thermal limit
subject to angle_diff {l in BRANCH}:
    angmin[l] <= theta[f_bus[l]] - theta[t_bus[l]] <= angmax[l];
Proof

Reproduces the published answer, then survives the real physics

Trust starts with reproducing a known result. On all four IEEE systems the AC objective matches the published PGLib‑OPF baseline to a relative error of 1×10⁻⁵ or better, and the convex bound reproduces the published optimality gap to the decimal.

CaseBusesAC objective ($/h)Publishedrel. errSOC gap
IEEE 14142,178.082,178.19.2e-60.11%
IEEE 30308,208.528,208.52.4e-618.84%
IEEE 575737,589.3437,589.09.0e-60.16%
IEEE 11811897,213.6197,214.04.0e-60.9%

An independent power-flow check — written in NumPy, not AMPL — confirms every reported solution satisfies Kirchhoff’s laws to 2.8e⁻⁶ p.u. Then the judgment call: take the fast DC dispatch, hand it to the true AC physics, and see what the linear model could not.

0255075100125% of line ratingrating 100%11849–69111100–10311047–6910089–9294–10069–7077–8065–6842–4969–7515–1726–30
IEEE 118-bus: hold the DC dispatch and its generator voltages, then solve the true AC power flow. Four branches (red) exceed their rating — worst 118.2% — a constraint violation the linear screening model is blind to.
0%5%10%15%20%bound gap to AC0.11%IEEE 1418.84%IEEE 300.16%IEEE 570.9%IEEE 118
The convex (Jabr SOC) relaxation gives a certified lower bound on the AC cost. The gap is tight (≤1%) on three systems and honestly loose (18.8%) on IEEE 30 — a real property of that network, reported rather than hidden.
Congestion, priced

Derate the busiest IEEE 14 line by 10% and re-solve: cost rises 21782859 $/h and the nodal price splits across the now-binding line — 7.9 vs 44.9 $/MWh. Prices diverging across a constraint is exactly what an operator expects; seeing it is the explainability check.

Delivery

Built to run in your stack, and to be handed over

  1. 01

    Frame

    Name the real decision and what “feasible” must mean to the operator — before a line of model is written.

  2. 02

    Model

    Write it in AMPL with data separate from model and check statements guarding the inputs, so the customer’s team can read and change it.

  3. 03

    Prove

    Reproduce a known answer, then confirm the solution survives the true physics and bound its optimality.

  4. 04

    Ship

    Run it in your stack as a service with solve budgets and a status your systems can act on — not a notebook.

  5. 05

    Own it

    Hand over the repo, the tests, and a runbook. Your team runs and maintains it without us.

The patterns behind a 5‑day‑to‑5‑minute model deployment at an insurer, and an in-house distance service that cut roughly $60K/month, apply directly: a containerized amplpy service, solve budgets, a solver status your systems can act on, and results versioned with the input snapshot.

For AMPL & its customers

BIS builds the models AMPL license customers need — a formulation reviewed against the literature, made reproducible, and handed to the customer’s team to own. If a customer needs model development, this is what they get. Referrals welcome.

BIS has not delivered a utility or power-systems engagement. Every optimal-power-flow number here was computed on public IEEE test cases with open-source solvers (HiGHS + IPOPT, $0 in licenses), and can be reproduced from the linked repository. The four measures at the top come from those solves — the grid size, the least-cost dispatch, the overloads the linear model missed, and the match to the published baseline — not from a prior engagement.

Have a decision worth modeling?

We start with a conversation, prove the value on a focused proof-of-concept with your real data, then ship it — measurable ROI, not a model demo.