Introduction
tellegen is a reactive visualization interface for power flow cases. The name refers to Tellegen’s theorem and the adjoint sensitivity calculations.
The app uses a gradient preview, exact commit interaction model. Perturbations update the display from KKT sensitivity columns. Exact solves (DC OPF, AC power flow, and the SOCWR relaxation) run in the browser in WebAssembly. Case parsing uses powerio.
Demo
The public demo at tellegen.dev serves three TAMU ACTIVSg synthetic grids and the CATS California Test System at their staged geographic coordinates. These are synthetic grids on geographic footprints, not surveyed infrastructure:
| case | territory | buses | branches |
|---|---|---|---|
| ACTIVSg200 | central Illinois | 200 | 245 |
| ACTIVSg500 | South Carolina | 500 | 597 |
| ACTIVSg7000 | Texas | 6717 | 9140 |
| CATS | California | 8870 | 10823 |
Each case solves as DC OPF by default; a selector switches to the SOCWR relaxation, solved in the browser in WebAssembly. Bus color shows locational marginal price. Selecting a bus shows the dLMP/dd column for a demand perturbation at that bus. Moving the demand slider applies the local sensitivity immediately; releasing it computes the exact solution in WebAssembly.
Local Files
Dropped .m, .raw, and .aux files are parsed in the browser by the
WebAssembly build of powerio. Files with coordinates render on the map. Files
without coordinates can be placed by clicking the map, or paired with local
geographic files in .csv, .json, or .geojson form. A dropped PowerWorld
.pwd file is decoded as display data and rendered as approximate substation
positions. Parsed local case files solve in the browser and are not uploaded.
API
GET /api/healthGET /api/casesGET /api/cases/{id}/caseGET /api/cases/{id}/networkGET /api/cases/{id}/solutionGET /api/cases/{id}/sensitivity/lmp/d/{bus}GET /api/cases/{id}/solve
The sensitivity and solve endpoints accept ?d=bus:mw,bus:mw, where each value
is a MW delta from the base case. The solve stream emits status, solution,
optional sensitivity, and done events.
Direction
Where the project is going and why. Architecture describes the boundary as shipped; this page describes the intent behind it. The ecosystem claims date from a June 2026 review; sources at the end.
Landscape
The sources below show no web native, developer facing framework for reactive power systems (public sources; a private implementation could exist). The closest tools:
- Electrisim runs pandapower and OpenDSS from the browser; the compute is server side, and it reports no locational marginal prices.
- RTE’s GridSuite (PowSyBl) is the most mature browser grid application in the field: closed operator software without a reactive price map.
- GridStatus.io has a polished nodal price map of ISO published prices the user cannot recompute.
- PowerPlots.jl is hover to inspect, driven from Julia.
None of them let a user load a case, click a bus, drag demand, and watch prices and flows re-solve live against exact KKT sensitivities. tellegen ships that interaction. PowerDiff.jl worked out the sensitivity columns behind it; tellegen exposes them as a framework, and the demo is one application built on it.
The boundary
Sensitivity columns give an immediate matrix vector preview during a drag; the exact solve fires on release and reconciles the preview. Around that loop:
- powerio (Rust): parsing, encoding, the formats, the network data model, and the canonical display format (display-data.md).
- tellegen (browser): interaction, the fast math, rendering. Its Rust is built in this repository against powerio and compiled to WebAssembly.
- tellegen backend (Rust): the same numerical core compiled native. It
hosts the bundled cases; its compute endpoints can serve browsers without a
working WebAssembly path and ship disabled behind
TELLEGEN_SERVER_COMPUTE, a single switch. Per endpoint control and authentication come before AC OPF ships as a server product.
PowerDiff.jl remains the reference harness for parity checks.
Browser solver status
Julia has no production WebAssembly path: the runtime port has been dormant since 2021, and the function level compilers cannot reach BLAS or JuMP. The numerics are therefore written in Rust and compiled to wasm.
- DC OPF (sparse LP/QP): shipped. Clarabel.rs, a pure Rust interior point solver with no BLAS dependency, solves 200 to 7000 bus cases in the browser as the exact commit.
- DC sensitivities (the dLMP/dd columns): shipped. One linear solve against the KKT factorization at the active set, reimplemented in Rust on faer.
- AC power flow (Newton with sparse LU): shipped. The browser package runs the same polar Newton formulation as the native engine and exposes exact commit plus Newton sensitivities.
- AC OPF (nonconvex): native development capability. The non-default
acopffeature now compiles and solves PowerIO’s exact polar model through POUNCE, validates the primal solution independently, and emits a portable solution. An opt-in development build now runs it in a dedicated WASI worker with hard cancellation, but no shipping adapter or deployment enables it. Distribution awaits solver, license, benchmark, and release gates.
The browser owns the whole DC pipeline: parse, solve, differentiate, render (issue #2).
Decisions
- wasm-pack and wasm-bindgen stay. Both shipped releases in 2026 (wasm-bindgen 0.2.125 in June). The WebAssembly Component Model targets server and edge with no browser DOM host, so it does not apply here.
- deck.gl and MapLibre on WebGL2 stay. deck.gl holds 60 fps to about a million elements; grids run at ten thousand to a hundred thousand. WebGPU in deck.gl lacks picking and basemap interleave today and can be adopted later without touching the rendering code.
$state.rawon large payloads. Shared reactive state is scoped through context, so the packages stay SSR safe.
Roadmap
Near term: harden the framework package boundary as outside apps consume
@tellegen/engine and @tellegen/svelte. The hosted demo is the reference
consumer.
Mid term: prebake the bundled cases as static assets and make the no backend deployment the default. The DC pipeline in the browser has landed, including the Safari sensitivity gap (issue #8).
Long term: graduate the native AC OPF feature and experimental browser WASI
worker after their solver, distribution, and benchmark gates. The worker
already supports hard cancellation. WebGPU follows when deck.gl’s backend
gains picking and basemap support. Synthetic grid generation already runs in the browser through tellegen-synth
(Synthetic Grid Generation).
Sources
- Rust to wasm toolchain: wasm-bindgen, wasm-pack (both active in 2026)
- wasm features and browser support: caniuse wasm-simd, wasm-threads, COOP/COEP
- In-browser solving: Clarabel.rs (wasm support, issue #133), faer (wasm sparse caveat)
- Rendering: deck.gl performance, deck.gl WebGPU status
- Svelte: $state, packaging
- Julia to wasm status: julia-wasm (dormant), WasmTarget.jl (early)
- Landscape: GridSuite, GridStatus, Electrisim, PowerPlots.jl
Framework Quickstart
There are two integration references:
examples/svelte-minimalimports@tellegen/svelteand renders the full viewer for local files only.examples/browser-minimalimports@tellegen/enginedirectly and builds its own simple UI.
Install
For a Svelte app, with the map libraries it takes as peer dependencies:
npm install @tellegen/svelte maplibre-gl @deck.gl/core @deck.gl/layers @deck.gl/maplibre
For a custom UI:
npm install @tellegen/engine
For local development in this repository:
npm ci
npm run wasm
npm run build:engine
npm run build:svelte
npm --workspace @tellegen/example-svelte-minimal run dev
The engine package resolves wasm assets relative to its packaged modules with
new URL(..., import.meta.url). Vite and SvelteKit handle that path for the
Svelte package and for custom engine consumers.
Svelte Viewer
<script lang="ts">
import { TellegenViewer } from "@tellegen/svelte";
import "@tellegen/svelte/styles.css";
</script>
<TellegenViewer />
For local files only:
<script lang="ts">
import { TellegenViewer } from "@tellegen/svelte";
import "@tellegen/svelte/styles.css";
</script>
<TellegenViewer loadDefaultCases={false} showFooter={false} />
The viewer accepts at most 32 files in one ingestion batch. No individual file and no batch total may exceed 128 MiB.
Run the local example:
npm --workspace @tellegen/example-svelte-minimal run dev
Engine Flow
Run the engine example:
npm --workspace @tellegen/example-browser-minimal run dev
import { createStudy, formatOf, ingestCase } from "@tellegen/engine";
const format = formatOf("case14.m");
if (!format) throw new Error("unsupported case format");
const bytes = new TextEncoder().encode(caseText);
const parsed = await ingestCase(bytes, format);
const study = await createStudy(parsed.module_json, "dcopf");
try {
const preview = await study.preview({ 3: 25 });
const committed = await study.commit(parsed.name, { 3: 25 }, {}, { bus: 3 });
console.log(preview.objectiveDelta, committed.sensitivity);
} finally {
study.free();
}
The call sequence is:
- detect the case format;
- parse the case in browser WebAssembly;
- create a
Study; - preview a demand edit without a solve;
- commit the edit with a sensitivity request; and
- free the
Study.
JSON Drops
Use ingestJsonDrop when a .json file may be a PowerIO module, model JSON, or a
transmission or distribution document:
import { ingestJsonDrop } from "@tellegen/engine";
const bytes = new Uint8Array(await file.arrayBuffer());
const result = await ingestJsonDrop(bytes);
if (result.kind === "unknown" || result.kind === "ambiguous") {
console.log("JSON was not ingested", result.kind);
} else {
console.log(result.kind, result.format, result.payload);
}
The result is discriminated by kind; payload is null only for unknown
and ambiguous input.
Privacy Boundary
Dropped files stay in the browser when the app uses the browser wasm path. The parser, solve, preview, commit, and sensitivity paths all run in WebAssembly in the page. A host app only sends data to a server if it chooses an HTTP path or writes its own upload path.
Framework Packages
The reusable browser packages live under packages/. The first framework
release publishes both @tellegen/engine and @tellegen/svelte.
Use @tellegen/svelte when a Svelte app wants the map, panels, local file flow,
and solve card as components. Use @tellegen/engine when an app wants case
parsing, browser WebAssembly solves, studies, previews, and sensitivities
without the tellegen UI.
apps/web is the hosted demo. It consumes @tellegen/svelte and keeps only
route level concerns such as SEO pages, /credits, and /privacy.
Svelte UI Package
Install:
npm install @tellegen/svelte maplibre-gl @deck.gl/core @deck.gl/layers @deck.gl/maplibre
maplibre-gl and the three @deck.gl packages are peer dependencies: the map
shares their instances with the host through extraLayers and onMapReady, so
the app installs them and resolves one copy of each.
Render the full viewer:
<script lang="ts">
import { TellegenViewer } from '@tellegen/svelte';
import '@tellegen/svelte/styles.css';
</script>
<TellegenViewer />
The default viewer loads bundled cases from /api, parses dropped local case
files in the browser, and runs supported local solves in WebAssembly.
TellegenViewer accepts:
apiBase, default/apiloadDefaultCases, defaulttruedocsHreforgHreforgLabelshowFooter, defaulttruetheme,light(default) ordarkcartoApiKey, the basemap key (see Basemap)
theme and cartoApiKey follow their props. The others are read once, when
the viewer mounts; remount it to change them.
Use a different backend base path like this:
<TellegenViewer apiBase="/tellegen/api" />
Use local files only by disabling bundled case loading:
<script lang="ts">
import { TellegenViewer } from '@tellegen/svelte';
import '@tellegen/svelte/styles.css';
</script>
<TellegenViewer loadDefaultCases={false} showFooter={false} />
For apps where state should survive route changes, mount the provider in a persistent layout and render the shell on the page:
<script lang="ts">
import { TellegenProvider } from '@tellegen/svelte';
import '@tellegen/svelte/styles.css';
let { children } = $props();
</script>
<TellegenProvider>
{@render children()}
</TellegenProvider>
<script lang="ts">
import { TellegenShell } from '@tellegen/svelte';
</script>
<TellegenShell />
The provider owns the controller and its cases. Unmounting it disposes the controller, which frees every case’s browser Study and multiconductor session in the engine worker, so a provider that should keep its cases across pages belongs in a layout that stays mounted.
Command palette and zen mode
Press Cmd+K (Ctrl+K on Windows and Linux), or the Commands button in the header, to open the command palette. Type to filter; each word you type must start a word of the command or its keywords. Use the arrow keys to move and Enter to run. The shell lists its commands in three groups:
- Actions: run the calculation for the displayed case, fit the network to the view, switch between the light and dark themes, enter or exit zen mode, and reset the panel layout.
- Cases: open a case file, or switch to any case in the header.
- Panels: open or close each panel, including panels a host registers, such as the web app’s Agent panel.
Zen mode hides the panel toolbar, every panel, the footer and the zoom buttons so only the map and header remain. The case strip collapses to the active case and shows the rest on hover or focus, and the map attribution collapses to its (i) button. Escape, the Exit zen button in the header, or running the command again restores the previous view. Zen mode is saved with the display preferences, so it survives a reload.
Components under TellegenProvider can add commands. register adds one
command; registerSource adds a function the palette calls each time it
filters, for lists that follow live state:
import { onDestroy } from 'svelte';
import { getCommandRegistry } from '@tellegen/svelte';
const commands = getCommandRegistry();
onDestroy(
commands.register({
id: 'export-report',
title: 'Export report',
hint: 'Download the current results as a PDF',
keywords: ['pdf', 'save'],
run: () => exportReport()
})
);
onDestroy(
commands.registerSource(() =>
scenarios.map((s) => ({
id: `scenario:${s.id}`,
title: `Load scenario ${s.name}`,
group: 'Cases',
run: () => load(s)
}))
)
);
Both return an unregister function. Registering the same id again replaces
the earlier command, and title and hint may be functions when the label
depends on state.
@tellegen/svelte also exports lower level pieces for custom shells:
TellegenMap, with basemap, theme, projection, camera, extra-layer andonMapReadyprops (see below)AppState,CaseState,LocalCase, andcreateAppStateControllerandcreateController, includingopenBalancedModulecreateApiClientPanelHost,NotificationCenter,ShellEnvironment, panels and controls from@tellegen/svelte/components- basemap helpers, colors, display helpers, formatting helpers, and public types
Custom shells
TellegenShell is one arrangement of exported parts. A host can mount its own
inside TellegenProvider:
<!-- +layout.svelte -->
<script lang="ts">
import { TellegenProvider } from '@tellegen/svelte';
import '@tellegen/svelte/styles.css';
import MyShell from './MyShell.svelte';
</script>
<TellegenProvider loadDefaultCases={false} apiBase={null} theme="dark">
<MyShell />
</TellegenProvider>
<!-- MyShell.svelte: reads the controller from context, so it must be a child -->
<script lang="ts">
import { PanelFrame, getController } from '@tellegen/svelte';
import { TellegenMap } from '@tellegen/svelte/map';
import { NotificationCenter, PanelHost, ShellEnvironment } from '@tellegen/svelte/components';
const ctrl = getController();
</script>
<ShellEnvironment />
<TellegenMap
theme="dark"
projection="globe"
onbusclick={ctrl.selectBus}
onlocalbusclick={ctrl.selectLocalBus}
onmultibusclick={ctrl.selectMultiBus}
onplacecase={ctrl.placeCase}
onmapclick={ctrl.clearSelection}
/>
<PanelHost showToolbar={false} />
<NotificationCenter />
<PanelFrame id="region" title="Region" side="left">...</PanelFrame>
ShellEnvironment is renderless and keeps the compact-layout, pointer and
viewport state in step, as the default shell does. PanelHost reads
--tellegen-dock-left, --tellegen-dock-right and --tellegen-dock-bottom
from an ancestor for its dock insets (defaults 20px, 20px and 100px), so a
shell with its own rail or status bar moves the docks without restyling them.
When a panel closes, focus moves to its toolbar button. Without the toolbar, focus goes back to the control that had focus when the panel opened. If there is none, it goes to the panel’s dock, a region named “Left panels” or “Right panels”. On narrow screens that region is the drawer, named “Panels”.
A shell that shows app.error itself can also read app.errorDetail. When
it is set, app.error is a message written for people, and the detail holds
the technical text behind it. NotificationCenter shows that text in a
collapsed disclosure.
Optional WebMCP adapter
Hosts that expose browser tools can install the optional @tellegen/webmcp
peer and import the shared controller adapter from its own entry point:
npm install @tellegen/webmcp
import { createTellegenWebMcpAdapter } from '@tellegen/svelte/webmcp';
const adapter = createTellegenWebMcpAdapter(controller);
Pass this adapter to registerTellegenWebMcp from @tellegen/webmcp, with the
host’s model context and lifecycle signal. Registration remains the host’s
responsibility. A host can select only the adapter methods it exposes;
MapToGrid uses the same inspection, query, sensitivity, focus, preview,
update, and reset operations as the demo. The shared implementation owns
revision guards, serialized mutations, validation bounds, and output budgets.
Agent calculations retain the displayed result’s accepted settings.
The entry point also exports caseRevision and structural host interfaces
for planning activities and saved-study evidence. Optional host arguments
connect these features to the host’s own persistence and approval workflow.
Importing the ordinary viewer entry point does not load this adapter or
require the optional WebMCP peer. See the package README for the full host
integration contract.
Basemap
CARTO’s vector styles suit a network overlay best: quiet roads, flat land and
clear water. CARTO’s basemap terms ask for an API key, which you can get from
carto.com/basemaps/apikey. No account is
needed, and non-commercial use (personal projects, research, teaching,
non-profits) is free up to 5 million requests a month. The browser sends the
key with every style, tile, glyph and sprite request as ?key=, so it is
public by design: restrict it to the hosts that serve your app in CARTO’s key
dashboard, and use one key per project.
The default order depends on the key:
- With
cartoApiKey: the map loads the CARTO style. That ispositron-nolabelsfor the light theme anddark-matter-nolabelsfor the dark theme, or the labelled styles withhideBasemapLabels={false}. It falls back to the matching OpenFreeMap style. - Without a key: the map loads the OpenFreeMap style (
positronordark) and falls back to the keyless CARTO style.
The map switches to the fallback in three cases:
- the primary style cannot be fetched;
- its tiles answer 401, 403 or 429;
- tile fetches keep failing with nothing arriving.
Only the basemap style’s own sources count. A source the host adds to the map never triggers the switch, and its errors are logged to the console.
Whenever an OpenFreeMap style renders, as primary or as fallback,
openFreeMapEdits tunes it towards CARTO’s look. Road lines start at zoom 8.
In the dark theme, water and waterways take Dark Matter’s colours and land
fills take one tone. The edits match layers by source-layer, not by id.
Label layers are hidden by default. The attribution control is always on and shows the credits of the style on screen.
TellegenMap (also exported from @tellegen/svelte/map) accepts these props
besides its click callbacks:
mapStyle: a style URL or inlineStyleSpecification. Default: the CARTO style forthemewith a key, else the OpenFreeMap style.fallbackMapStyle: the style used when the primary fails;nulldisables the switch. Default: whichever of the two is not the primary.cartoApiKey: the CARTO key. It is trimmed, and an empty, blank or absent key means none.theme:'light'(default) or'dark'. Picks the default styles and the overlay palette (MAP_PALETTE).projection:'mercator'(default) or'globe'. Re-applied after every style load, so a basemap switch keeps it.initialCamera:{ center, zoom, bearing, pitch }, read once per mount.hideBasemapLabels: defaulttrue.extraLayers: deck.gl layers drawn after tellegen’s own, in the same overlay.attribution:'compact'(default) or'full'. There is no off switch.onMapReady(map, overlay): called with the MapLibre map and the deck overlay once they exist. It may return a cleanup, and it fires again after a context-loss or basemap rebuild. If it throws, the map and its window and document listeners are still released when the map is torn down. A switch to the fallback does not call it again (see below).onBasemapFallback(reason): the switch to the fallback happened.reason.fromandreason.toname the two providers.onBasemapError(reason): no basemap can be shown. The network layers still draw.reason.fromnames the provider that failed last, andreason.toisnull.
The switch to the fallback replaces the whole MapLibre style, so sources and
layers the host added to the map are gone after it. The network,
extraLayers and projection carry over. A host that adds its own sources
and layers adds them on every style.load, not once in onMapReady, which
runs before the first style loads, so one listener covers the primary and the
fallback:
import type { Map as MapLibreMap } from 'maplibre-gl';
function onMapReady(map: MapLibreMap) {
const addFeeders = () => {
map.addSource('feeders', { type: 'geojson', data: '/feeders.geojson' });
map.addLayer({ id: 'feeders', type: 'line', source: 'feeders' });
};
map.on('style.load', addFeeders);
return () => map.off('style.load', addFeeders);
}
TellegenProvider and TellegenViewer also take cartoApiKey, and pass it,
together with theme, to the default shell’s map. Both follow their props:
changing either rebuilds that map in place. A SvelteKit 3 host can
declare the key as an optional public build-time variable:
// src/env.ts
import { defineEnvVars } from '@sveltejs/kit/env';
export const variables = defineEnvVars({
PUBLIC_CARTO_BASEMAP_KEY: { public: true, static: true, schema: (value) => value ?? '' }
});
<script lang="ts">
import { TellegenProvider } from '@tellegen/svelte';
import { PUBLIC_CARTO_BASEMAP_KEY } from '$app/env/public';
</script>
<TellegenProvider cartoApiKey={PUBLIC_CARTO_BASEMAP_KEY}>...</TellegenProvider>
On SvelteKit 2, import it from $env/static/public instead; that module
needs the variable defined at build time, even if empty.
Changing mapStyle, fallbackMapStyle, theme, hideBasemapLabels,
cartoApiKey or attribution rebuilds the map in place and keeps the camera.
The helpers behind the defaults are exported too:
OPENFREEMAP_STYLESandCARTO_STYLES;cartoStyleUrl(url, apiKey);defaultBasemap(theme, { cartoApiKey })andresolveBasemap(props);attachBasemapFallback(map, spec, handlers);isOpenFreeMapStyle(style)andopenFreeMapEdits(style, theme).
defaultBasemap and resolveBasemap also say who serves each style, so a
host can word its credits and fallback notice without reading URLs. Their
primaryProvider and fallbackProvider are 'carto', 'openfreemap', or
'custom' for a style the host passed, and fallbackProvider is null when
the fallback is off. defaultBasemap is typed DefaultBasemap: two style
URLs, one CARTO and one OpenFreeMap, so its providers are never 'custom' and
its fallback is never null. The fallback reasons use the same names in
from and to.
A Content Security Policy must allow https://tiles.openfreemap.org and
https://*.cartocdn.com in connect-src and img-src. The style, vector
tiles, fonts and sprites are all fetched. The engine underneath also needs
script-src 'wasm-unsafe-eval' (never 'unsafe-eval') and worker-src 'self', since its workers are same-origin.
@deck.gl/core, @deck.gl/layers, @deck.gl/maplibre and maplibre-gl
are peer dependencies (^9.4.0 for deck.gl, ^6.15.0 for maplibre-gl), so
the host’s copies are the ones the map uses, including the deck.gl layers it
passes in extraLayers and the MapLibre map it gets from onMapReady. When
two deck.gl versions load, deck.gl throws “multiple versions detected”; if
another dependency pulls in a second copy, point both at one version with npm
overrides (or resolutions in pnpm and Yarn).
The map needs no Vite settings, in a build or in the dev server. MapLibre’s
worker comes from a ?worker&url import, which a production build bundles
with its shared chunk. Vite’s dev server pre-bundles this package and cannot
pre-bundle that import, so the package’s ./maplibre-worker export has a
development condition that loads it at run time, outside the pre-bundle.
That export is internal to TellegenMap. A host that excluded
@tellegen/svelte from optimizeDeps to work around this can drop the
exclusion.
Dark theme
<TellegenProvider theme="dark"> (or <TellegenViewer theme="dark">) sets
data-theme="dark" on the document root while mounted, which switches every
token in styles.css. The default shell passes the theme to its map, so the
basemap and the overlay palette follow. A custom shell passes
theme="dark" to TellegenMap itself. A server-rendered host can put the
attribute in its template to avoid a light first paint. With no theme prop,
no attribute in the template and no saved viewer choice, the provider follows
the operating system’s prefers-color-scheme, and styles.css paints the dark
tokens from the first frame. Text tokens keep at least 7:1 against the panel on
either ground.
Opening a module from memory
A host that produces a balanced powerio module itself opens it without a file:
import { getController } from '@tellegen/svelte';
const ctrl = getController();
const local = await ctrl.openBalancedModule({ name: 'synthetic grid', moduleJson });
// or, with the payload the engine's ingestCase already returned for it:
await ctrl.openBalancedModule({ name, payload, frame: false });
// swap it for a new result in place
await ctrl.replaceLocalCase(local, { name, payload });
Options: geoLayer (a .geo.json document, for a module without
coordinates; a module that carries Bus.location needs none),
formulation, activate (default true; false returns the prepared case
without adding it) and frame (default true). replaceLocalCase keeps the
case’s slot in the header, its formulation and display mode, and the selected
bus when the new case has it. With loadDefaultCases={false} the controller
fetches nothing on load(); with apiBase={null} it has no API client at all
and every server path reports compute off.
Engine Package
Install:
npm install @tellegen/engine
Use the engine package when you want to build your own UI:
import { createStudy, formatOf, ingestCase, solveModule } from '@tellegen/engine';
ingestCase and solvable JSON ingestion return a retained PowerIO module in
module_json. Both createStudy and solveModule accept that
PowerIO IR module. Geographic transforms update and return the same module.
The engine package resolves its wasm files relative to the package module. Apps
must serve package asset files from node_modules; Vite and SvelteKit handle
that path.
Analytics Package
Install:
npm install @tellegen/analytics
@tellegen/analytics is the usage analytics the hosted demo and MapToGrid
share: a Vocabulary of the page paths, event names, property keys and
property values a site may report, a sanitiser that rebuilds every payload
from it, and a sender that posts the result to Umami Cloud’s collection
address from the site’s own code. No third-party script is loaded, no cookie
is set, and nothing is sent from a host the site did not list, over plain
http, under Do Not Track or Global Privacy Control, or after the visitor opted
out. The package has no dependencies.
import { createAnalytics, localStorageOptOut } from '@tellegen/analytics';
const analytics = createAnalytics({
website: 'your-umami-website-id',
hosts: ['example.org'],
pages: { '/': 'Site' },
events: { 'calculation.solve': ['calculation', 'result', 'duration_ms'] },
enums: { calculation: new Set(['dcopf']), result: new Set(['completed', 'failed']) },
numbers: new Set(['duration_ms']),
optOut: localStorageOptOut('umami.disabled')
});
analytics.page(location.pathname);
analytics.track('calculation.solve', {
calculation: 'dcopf',
result: 'completed',
duration_ms: 812
});
A site keeps its vocabulary in one file and asserts checkVocabulary in a
unit test; apps/web/src/lib/analytics/client.ts is the hosted demo’s.
Examples
examples/svelte-minimalimports@tellegen/svelteand runs withloadDefaultCases={false}for local files only.examples/browser-minimalimports@tellegen/enginedirectly and has no map stack.
Downstream apps should not import from apps/web/src/lib or from generated wasm
folders.
Saved Studies
A Study is a saved case with its changes and results. Open Studies, give the current case a name, and select Save study. A planning goal is optional. Saving keeps the current result when it matches the case; an unsolved case can also be saved. Saving does not move the network or reset the camera.
Case, History, and Plan
- Case shows the selected saved state. Demand rows show base demand, current demand, and the accumulated change in MW. Edits at different buses remain part of one cumulative set of changes.
- History holds saved states and activity. Select a state to inspect it or branch from it to explore another option. Observations, edits, solves, planning trials, and decisions have distinct labels. An observation adds evidence without inventing an electrical state.
- Plan is optional. Choose a goal, then explicitly choose the whole network, an area, or selected equipment. Searchable tables show bus names and IDs, line endpoints, weights, limits, and units. The displayed counts include every selected element; there are no hidden bus or line limits.
Reset to base case restores the original electrical inputs and retains previous states and activity. The base is the network data supplied to the Study, which can differ from its starting state when demand was already edited. Older imported Studies without a base input report that reset is unavailable.
The saved state currently being inspected, the recommended candidate, and the applied state remain distinct. Selecting a candidate changes the displayed network. An agent proposal requires an explicit Apply action. Live case returns to the case outside the Study.
Planning
The OPF objective describes operating cost inside the power-system calculation. A planning goal describes what to improve across candidate cases, such as a weighted LMP or voltage target. Custom expressions remain available through the structured API: weighted observables, sums, scaling, squared target deviations, and direct intervention penalties.
Line capacity uses MW for DC OPF and MVA for SOCWR. Demand uses MW. Limits and increments apply to the cumulative changes from the goal’s starting state. Demand placement allocates a stated additional total; redistribution preserves the total through paired transfers.
Find a proposal uses the objective gradient to choose candidate edits, solves each candidate, and retains verified improvements. Every attempted solve counts against Solve budget, including failed trials and any required starting-point solve. The result is the best verified candidate found within that budget. It does not establish a global optimum. Expand the evidence for prediction error, active-constraint changes, failed trials, and numerical settings.
The derivative uses a combined adjoint calculation, including direct penalties, without constructing a dense observable-by-decision matrix. Changing the goal creates a new revision and retains earlier results. Changing a proposal’s goal or starting state invalidates its approval.
Save, reopen, and continue
The browser stores completed operations atomically in IndexedDB. Export creates a portable bundle containing PowerIO IR inputs and solutions, deduplicated SHA-256 artifacts, goals, states, and activity. Geographic layers, line paths, drawings, and the selected view travel with it. Import checks versions, hashes, identities, and references. It never restores approval tokens or executes imported text. Older journals remain historical evidence when their electrical states are unavailable.
A failed save reports the problem instead of discarding history. Free storage or export the saved Study before retrying. Cancellation retains completed trials and the best candidate after the running solve finishes.
Native and agent access
cargo build -p tellegen-cli --features conic
tellegen describe
tellegen study create study.json < create-request.json
tellegen study inspect study.json
tellegen study run study.json < operation-request.json
tellegen study export study.json > portable-study.json
tellegen describe lists commands and generated JSON schemas. Rust definitions
also generate the TypeScript types. Browser controls, WebMCP, and the CLI use
the same Study operations and revision checks.
The Python package’s MCP server, tellegen-mcp (see MCP server),
runs the engine in process. Its solve, solve_module, and plan tools handle
calculations; study_create, study_inspect, study_run, study_export, and
study_import handle saved cases. study_create also accepts a case file for
PowerIO to read. Applying a proposal is left to an explicit user action:
study_run refuses apply. PowerMCP’s Tellegen server
(powermcp run tellegen) offers the same tool names over the native CLI.
WebMCP list_cases and select_case change the visible case without proposal
approval. Network queries identify the displayed case and saved state, so an
LMP question refers to the same result shown on screen. Creating a Study is
needed only when saving or planning is requested.
Supported calculations are DC OPF, AC power flow, and, with the conic build
option, SOCWR. Unsupported objective and solver combinations are rejected
before planning.
Model details
Texas7k uses an explicitly configured convex quadratic or linear fit to its piecewise generator costs. Model details records the method, original and prepared costs, affected generators, units, and measured breakpoint errors. Those errors describe an approximation; they are not a relaxation bound. The prepared costs persist through saved cases, exports, and reset.
The same preparation is available for any balanced case through
tellegen prepare-model. The command returns prepared PowerIO IR and its
approximation report. Other cases retain their declared costs by default.
WebMCP
WebMCP lets a web page hand your AI assistant a toolbox. Tellegen’s map
offers tools such as inspect_case, query_network and update_case, so an
agent reads and changes the case through them instead of reading the screen
and clicking. Each call shows in the Agent panel and in a ribbon below the
header. The tools read and update the state shown in the interface and run the
same WebAssembly solver.
WebMCP is a new browser standard. Chrome and Edge each run their own origin
trial; https://tellegen.dev has joined Chrome’s. Browsers without document.modelContext run the application without these
tools, and manual use works as before.
Getting started (no setup knowledge needed)
Open Agent, then Connect, on the map. The panel checks your browser, tells you what, if anything, to change, and has copy buttons for every command and prompt on this page.
1. Use a browser that speaks WebMCP
| What the Connect tab says | What to do |
|---|---|
| Getting the tools ready… | Nothing. It turns into Ready for agents in a moment. |
| Ready for agents | Nothing. Go to step 2. |
| One switch away | Paste chrome://flags/#enable-webmcp-testing (edge://flags/... in Edge) into the address bar, set it to Enabled and relaunch. On https://tellegen.dev, Chrome needs no switch during its trial; local and preview copies, Edge, Brave and other Chromium browsers do. |
| Almost there | Update Chrome to 149 or later, or Edge to 150 or later. |
| … doesn’t speak WebMCP yet | Firefox and Safari have no WebMCP. Use Chrome on a computer, or an agent that brings its own browser (step 2). |
| Agents work from a computer | The agents that use page tools run on desktop, so phones and tablets, Android tablets included, get this note. |
The origin-trial token covers https://tellegen.dev only, not other hosts, and only Chrome: Edge’s trial is separate and needs a token from Microsoft, which tellegen.dev does not have yet. Chrome’s trial runs in a bounded range of releases (149 to 156, extended to 162), and the token expires on 30 March 2027; outside that window Chrome needs the switch too.
2. Connect an agent
Pick one. Only the last option touches remote debugging, and you don’t need it.
ChatGPT desktop app (no setup). Open https://tellegen.dev in the app’s built-in browser and ask for what you want. The agent finds the tools itself; the Site tools button in the address bar lists them. This works in the desktop app’s browser only, not in the Codex CLI, the IDE extension or the Chrome connector. Site tools need a model that supports them; if the button is missing, check Settings > Browser > Permissions > Enable site tools. Some work and school workspaces do not have it yet.
Claude Code with Claude in Chrome. Install the Claude in Chrome extension (1.0.36 or later), sign it in to the same Claude account and organization as Claude Code, and start Claude Code with:
claude --chrome
This needs a Claude Pro, Max, Team or Enterprise plan signed in with
/login. With an API key, a claude setup-token token, Bedrock, Vertex or
Foundry, Claude Code keeps the browser off even with --chrome. Run
/chrome to check the connection.
Claude does not look for WebMCP tools on its own yet, so tell it where they are. The Connect tab’s Copy prompt for Claude button copies a prompt that starts:
Open https://tellegen.dev in Chrome. The page offers WebMCP tools; use them instead of clicking. List them by running
const tools = await document.modelContext.getTools()in the page (each has a name, description and inputSchema). Call one withawait document.modelContext.executeTool(tools.find((t) => t.name === '<name>'), { ...args }), passing the tool object and a plain object of arguments, not a name or a JSON string.
That is the call shape of Chrome’s
Imperative API:
executeTool takes a tool object from getTools(), and JSON-string input is
deprecated from Chrome 155. If the browser lacks getTools or executeTool,
the Connect tab says so and points to the DevTools route below.
This uses your own Chrome, so on https://tellegen.dev the origin-trial token applies and no flag is needed. Edge, Brave and other Chromium browsers, which Claude in Chrome also supports, need the flag.
Claude Code, Codex CLI, Cursor or another MCP client with Chrome DevTools MCP. Add Google’s Chrome DevTools MCP server once, with its experimental WebMCP tools turned on:
# Claude Code
claude mcp add chrome-devtools --scope user -- npx chrome-devtools-mcp@latest --categoryExperimentalWebmcp=true --chromeArg=--enable-features=WebMCP
# Codex CLI
codex mcp add chrome-devtools -- npx chrome-devtools-mcp@latest --categoryExperimentalWebmcp=true --chromeArg=--enable-features=WebMCP
It needs Node.js (for npx) and Chrome 150 or later installed. Then ask the
agent to open https://tellegen.dev and list its WebMCP tools. It gets list_webmcp_tools and execute_webmcp_tool. The server starts its own
Chrome window with a separate profile, which is why the command passes
--enable-features=WebMCP: flags you set at chrome://flags in your everyday
profile do not carry over.
Agents built into the browser. Gemini in Chrome and Copilot in Edge do not call page tools yet.
3. Ask
With the tools ready, the Connect tab numbers the steps: connect an agent, give it the prompt that explains the tools, then try one of a few requests, each with a copy button. For example: “Which lines are congested right now, and which buses pay the highest prices?”
Questions
Do I need to turn on remote debugging? No. Chrome DevTools MCP needs it
only to attach to a Chrome you already have open: --autoConnect needs remote
debugging turned on at chrome://inspect/#remote-debugging, and
--browserUrl needs a Chrome started with a debugging port. Neither is needed
for the setup above, which starts its own window. If you do attach, that
Chrome needs WebMCP itself (Chrome’s trial on tellegen.dev, or the flag),
because --chromeArg applies only to a browser the server starts.
Do I need to add an MCP server? Only for the Chrome DevTools MCP route,
with the one command above. The ChatGPT app and claude --chrome need none.
To work on case files without a browser, Tellegen has a separate stdio server;
see MCP server.
How do I know it’s working? The Connect tab says Ready for agents and counts the tools this tab offers. After the first call it says Agent connected, and the call appears under Activity.
The first-visit introduction at the bottom of the map opens the Connect tab and links to the application changelog.
Tools
| Tool | Behavior |
|---|---|
list_cases | List configured and imported cases, availability, and stable case IDs. |
select_case | Switch the displayed case without deleting saved Studies or applying proposals. |
import_case | Open case file text as a new case, the way a dropped file opens, and report PowerIO’s parse findings. |
export_case | Write the displayed case through PowerIO to an exchange format or a .pio.json module, download it, and report conversion findings. |
inspect_case | Read the displayed case or saved state, formulation, solve summary, IDs, units, and revision. |
query_network | Return a bounded set of buses or branches by stable identity or solved metric. |
analyze_sensitivity | Compute an LMP sensitivity column for the displayed state under its formulation (not AC power flow). |
focus_network | Select a bus or branch in the visible interface. |
preview_case_update | Predict demand or rating edits from cloned state. |
update_case | Solve and commit a bounded batch of demand or rating edits. |
reset_case | Solve and commit the base state with the current formulation. |
inspect_settings | Read the selected and accepted calculation settings, or this browser’s display preferences. |
update_settings | Validate and apply a settings patch atomically without solving. |
reset_settings | Return the selected calculation’s settings to their defaults without solving. |
run_calculation | Calculate with the selected settings; a failed calculation keeps the preceding result. |
solve_multiconductor_pf | Solve the displayed distribution case’s multiconductor AC power flow. |
simulate_dynamics | Run an RMS simulation of the displayed case with its .dyr data after events and return the screening verdict and figures. |
create_study | Save the current case and its results as a Study. |
inspect_study | Read a page of a Study’s goals, states, or evidence, or open a saved Study. |
revise_study_goal | Save a new goal revision. |
branch_study | Continue exploring from a saved state. |
compare_study_states | Compare two saved operating points, optionally under a goal. |
propose_study | Search for verified capacity or demand improvements and save the best one unapplied. |
edit_demand | Add bounded demand increments to a saved state. |
restore_base_case | Solve the original network data and save it as a reset candidate. |
record_study_evidence | Attach a stated rationale and evidence to a saved state. |
propose_capacity_plan | Use implicit derivatives to choose bounded capacity increase trials, verify them with exact solves, and stage an unapplied proposal. |
apply_capacity_plan | Apply an approved proposal after checking its session, case, and revision. |
inspect_webmcp_registration | Developer check: registered tools, the last registration error, exposed origins, and the browser’s WebMCP features. |
The general tools register for the page lifecycle. list_cases and select_case
also cover local files and distribution cases. Distribution queries return connected
load and equipment data; they do not claim computed LMPs or flows. Inspection and
queries use the saved state when one is displayed. Live edit tools require
returning to the live case through select_case.
propose_capacity_plan registers when the active formulation supports it.
apply_capacity_plan registers only while a staged proposal matches the current
state.
simulate_dynamics takes up to 16 events (bus_fault, line_fault cleared
by opening the line, branch_trip, generator_trip, load_change) with
buses as numbers, branches as from-to#circuit (the circuit may be left out
when it is unique) and units as bus#id; an unknown or ambiguous id returns
INVALID_INPUT naming the candidates. It answers with the verdict, the COI
frequency nadir, RoCoF and final value, the largest angle separation, the
lowest voltage and its recovery, counts of islands, held units and notes,
and, with trace_points, up to four traces (coi:f, f:<bus>, vm:<bus>,
omega:<unit>, dcoi:<unit>, pl:<bus>) of at most 40 points. It does not
change the case; the run shows in the Dynamics panel, marked as the agent’s,
unless show_in_app is false. import_case with a .dyr file attaches it to
the displayed case and returns what it linked.
export_case downloads the file to the user’s computer and returns its name,
size, and PowerIO’s findings about what the target format cannot represent; the
file text does not go to the agent. import_case reads text formats by
extension (.m, .raw, .rawx, .aux, .epc, .dss, .json, .xml,
.xiidm, .uct, .ucte, .cdf, .dyr) up to 4,000,000 characters. Binary
formats, archives, and geographic sidecars still need the file picker. A case
without coordinates opens as a diagram, or waits for placement, exactly as a
dropped file does; the result reports that as availability.
Tool contract
Tellegen follows the WebMCP draft of November 2026: tools register on
document.modelContext with registerTool() and an AbortSignal that
unregisters them.
Every tool declares an inputSchema and an outputSchema. Each response is
JSON in one envelope, { "ok": true, "data": … } or
{ "ok": false, "error": { "code": …, "message": … } }, and the output
schema states that envelope and the fields each tool’s data reports. The
data fields are typed but not required, because a response that exceeds the
output budget is trimmed: a committed change whose details do not fit reports
completed and output_truncated instead. An agent that rejects responses
that fail their schema never rejects one of tellegen’s. The browser tests
check the responses their tool calls receive against these schemas.
Annotations: read-only tools set readOnlyHint. Every tool except
inspect_webmcp_registration sets untrustedContentHint, because case names
and identifiers come from imported files. No tool sets consequentialHint:
every change stays in the tab and can be reset, and a capacity proposal
applies only after the user approves it in the interface.
inspect_webmcp_registration sets debugging, so agents for end users can
leave it out. The web app registers it only in a development build or when the
page URL has ?debug.
Enabling WebMCP
Chrome 149 and Edge 150 run separate WebMCP origin trials, each with its own
tokens; https://tellegen.dev carries a Chrome token. For local development,
enable chrome://flags/#enable-webmcp-testing. A deployment that registers
for the trial sets PUBLIC_WEBMCP_ORIGIN_TRIAL_TOKEN at build time, and the
prerendered pages carry each token in its own origin-trial meta tag. To cover
both browsers, put the Chrome and Edge tokens in the one setting, separated by a
comma or whitespace.
The tools are same-origin by default. To let a page that embeds tellegen call
them, list its origins, comma separated, in PUBLIC_WEBMCP_EXPOSED_TO; the
embedding page must also opt in from its side. A browser that refuses an
origin rejects the registration with a SecurityError, which the Agent
panel reports.
Revisions and mutations
Every page load receives a random session identifier. Each case has a monotonic revision within that session. A committed edit, reset, formulation change, or visible network selection advances the revision and expires pending proposals and approvals.
Preview, standalone sensitivity analysis, and planning operations use cloned state. Electrical mutations enter one queue, check their expected revision inside the queue, solve a candidate state, and commit once after the solve succeeds. A failed solve leaves the case, formulation, revision, proposal, and approval unchanged.
Tool callback options are optional because WebMCP clients do not all provide
an AbortSignal. When a caller supplies one, reads and planning stop at safe
boundaries. A mutation that has passed its commit point finishes even if the
caller cancels; the agent then receives no result, so the activity panel
marks the call as cancelled after completion. The browser reports dynamic
registration failures, naming the tool and the browser’s reason, instead of
claiming that a missing tool group registered successfully.
Capacity planning
propose_capacity_plan accepts a weighted LMP objective, stable candidate
branch identities, a total MW budget, a maximum increase per branch, a fixed
increment, a global line count, and an exact solve budget. The solve budget
counts the baseline and every accepted or rejected trial.
The planner computes a vector product through the solved DC OPF KKT system, orders capacity increases by that local direction, and checks each trial with an exact solve. It recomputes the direction after every accepted trial. Each solved trial records its first order prediction and exact result; a failed trial records the failure reason without an exact delta.
The proposal changes no electrical state. A visible control grants one use approval for its proposal ID and base revision. Applying it repeats every identity and revision check inside the mutation queue. A failed or stale application consumes neither the proposal nor its approval.
Persistence
While an agent works, a ribbon below the header names the running tool and its
elapsed time, then shows a one-line result or the failure for a few seconds.
It appears with the Agent panel closed and in zen mode, so people watching see
each call; clicking it opens the Agent panel. focus_network,
preview_case_update, update_case and analyze_sensitivity also fly the map
to the bus or branch they work on. Only focus_network changes the selection;
the others move the camera, so the revision an agent holds stays valid.
The activity panel records the last 100 completed tool calls in an experiment journal, including validated requests, bounded results, failures, and elapsed time. Export downloads that record with the retained capacity planning trials and their decisions. The export identifies its browser session and reports how many older records were discarded. Invalid requests are omitted from the recorded input.
When a preview and a successful update name the same case, revision, formulation, and edits, the panel shows the predicted objective change beside the exact change and absolute error. A failed update leaves the comparison empty. The relative error is undefined when the exact change is zero.
Journal exports contain data only; importing one never authorizes or executes
an edit. Proposals and approvals stay in memory. Saving a case writes
its materialized PowerIO module. Loading that module starts a fresh runtime
Study; its history records transformations applied to the stored value.
Saving an exact result writes a PowerIO solution module containing the
amended instance that was solved.
Package boundary
@tellegen/webmcp owns tool descriptions, input and output JSON Schemas,
runtime validation, annotations, bounded result shaping, and registration
lifecycle. It depends on
a TellegenWebMcpAdapter, not on Svelte or the Rust engine. The application
adapter connects that interface to the active controller and visible activity
panel.
Imported labels and identifiers are treated as untrusted content. Every mutation requires the active case ID and revision. The package rejects unknown fields, nonfinite values, duplicate edits, excessive arrays, and unsupported enum values at the execute boundary as well as in its schemas.
Testing
Run the package and application checks from the repository root:
npm run check:webmcp
npm run check:web
npm run build:web
npm run test:browser
The tests cover registration and teardown, calls with and without callback options, validation, output bounds, stale revisions, one use approval, transaction rollback, queued mutations, cancellation, and visible state. Playwright uses a test host that follows the WebMCP registration and execution algorithms: unique names, schemas serialized at registration, and JSON text in both directions. Before release, invoke the tools through native WebMCP in the in-app browser as a separate bridge check.
References
- WebMCP specification (repository)
- Chrome WebMCP documentation
- Imperative API
- Tool security
- WebMCP evaluations
Tellegen product showcase
Tellegen is a power-system laboratory shared by a user and an agent. The network stays central while a persistent Study records the goal, alternatives explored, exact results and recommendation. OPF supplies the operating point; an outer Study objective describes what the user wants to improve.
For example:
Lower demand-weighted prices in this region. Add at most 20 MW across two lines, and show how prices elsewhere change.
The goal interpretation resolves the region to equipment identities and weights. The user can inspect and edit that interpretation before exploration. A combined implicit derivative ranks feasible interventions, and exact solves determine whether a trial improves the objective. The Study preserves accepted, rejected and failed trials, constraint changes and the reason exploration stopped. Prediction error belongs in the expandable evidence beside those trials.
One Study across interfaces
The browser controls and WebMCP call the same Study controller. Both can create a
Study, inspect its history, revise a goal, branch from a saved state, compare
candidates, propose interventions and attach evidence. Capacity-tool compatibility
adapters create the same persistent Studies. Native Rust and CLI operations use
the same generated types; PowerMCP’s tellegen server invokes the CLI
directly and exchanges PowerIO IR with it.
Three pointers keep navigation clear: the inspected state, the recommended state and the applied state. Viewing an alternative does not apply it. Human approval binds a particular proposal, starting state and goal. A revised goal or changed proposal expires that approval.
Electrical inputs, instances and solutions use PowerIO IR. Study semantics live in a separate document with hashed, deduplicated artifacts. Browser IndexedDB and atomic filesystem storage preserve completed operations. A portable bundle can move from a browser to a headless agent and back. Import validates identities, hashes and references, and restores no approvals.
Showcase sequence
- Open a congested case and inspect dispatch, prices and limiting branches.
- State the regional objective, resolve its weights and review the intervention budget.
- Ask for a proposal. Inspect exact improvements and consequences elsewhere.
- Select a rejected candidate in the branching history to explain the explored alternative.
- Revise the goal to conserve total demand and redistribute it among selected buses.
- Compare candidates under the chosen goal revision. Expand a trial’s numerical evidence.
- Apply the reviewed recommendation through the explicit user control.
- Export, reload and resume the Study with another agent.
A small AC power-flow example instead minimizes squared voltage-target error
through demand transfers. This uses the existing AC power-flow solver.
Nonlinear AC OPF is outside the shipping WebMCP calculations; it exists only
behind a non-default native development feature. Multiconductor AC power flow
is available through solve_multiconductor_pf, but the Study objectives cover
balanced networks only.
Reproducible evidence
Studies describes the document and operations. The checked-in Study declarations and runner record executable and input hashes, exact trial outcomes, solve budgets and numerical tolerances. Browser tests run the same declared Study through native and WASM implementations and compare semantic results.
The Texas7k example explicitly records a lower-convex-cost scenario because the original input contains nonconvex piecewise cost curves. Its results describe that scenario, not an optimum for the original economic model.
The earlier capacity demonstration retains its own call records, revisions and hashes. Fresh native WebMCP evidence accompanies the persistent Study release. The showcase can be reproduced independently of a contest submission.
Verified examples
Fresh result records include the declared tolerances and all attempted trials. The values below are the outer objectives specified by each declaration; capacity and demand examples sum selected nodal prices, while the AC example measures squared voltage error.
| Study | Starting objective | Recommended objective | Planning solves |
|---|---|---|---|
| CATS capacity | 76.11900127 | 53.61631934 | 6 |
| CATS demand redistribution | 76.11900127 | 74.25936675 | 5 |
| Texas7k convex-cost scenario, capacity | 87.08117943 | 85.74773920 | 8 |
| Texas7k convex-cost scenario, redistribution | 87.08117943 | 87.08117943 | 3 |
| Three-bus AC voltage target | 0.00043750235 | 0.00040678296 | 6 |
Each Study also has one creation solve. The Texas7k redistribution search retains its starting state: the tested changes are below its recorded improvement tolerance. The planner reports that limit instead of presenting numerical noise as a gain. None of these searches applies its recommendation automatically.
The native WebMCP demonstration
records seven of the nine Study tools (all but edit_demand and
restore_base_case), reload, branching, goal revision and a rejected
stale request. Application and stale approvals have separate browser tests. On its synthetic three-bus case, a 5 MW
capacity increase lowers the target bus price but raises the price at another
bus. A second goal explores demand transfers from the original starting state.
The inspected capacity choice, demand recommendation and applied starting
point remain distinct.

References
Challenge Evidence
The checked in harness under docs/evidence/webmcp produces the large case records.
CATS and Texas7k each have one complete invocation spec. The runner parses the
named MATPOWER source through the PowerIO revision in Cargo.lock, invokes
tellegen plan, checks its solve accounting, and writes one machine readable
result.
Each result records:
- the SHA256 digests of the MATPOWER source, invocation spec, and lockfile;
- the exact Tellegen commit and tree and the reviewed PowerIO commit;
- the complete
CapacityPlanSpecrequest; - for success, the exact baseline and proposed summaries, every accepted and
rejected trial, plus the kind, termination, objective, and canonical JSON
digest of the final PowerIO IR (
pio-ir) solution on the amended instance.
A spec can name one enumerated preparation failure. A matching clean run records a typed error, its preparation stage, and zero completed exact solves. Any other failure exits nonzero and writes nothing.
Run from a clean repository checkout:
node docs/evidence/webmcp/run.mjs docs/evidence/webmcp/specs/cats.json docs/evidence/webmcp/results/cats.json
node docs/evidence/webmcp/run.mjs docs/evidence/webmcp/specs/texas7k.json docs/evidence/webmcp/results/texas7k.json
The runner refuses tracked or untracked changes other than earlier generated
JSON files in results/, and it refuses to replace an existing result.
--allow-dirty is only a harness smoke test; its output always says
reproducible: false and is not submission evidence. A clean run can write
only the named result path for its case.
During review, the lock resolves every PowerIO component from one Git commit.
After publication, it records the common version and each registry checksum;
docs/evidence/webmcp/powerio-releases.json then supplies the checked release tag to
commit mapping. Both paths retain powerio_revision in the result.
Publish a numerical case claim only when its result file comes from a clean run
and validates against docs/evidence/webmcp/result.schema.json.
Native browser record
docs/evidence/webmcp/native/in-app-browser.json records the native WebMCP calls,
transaction checks, browser session change, and artifact hashes. Its screenshots
show the pending and applied proposal states. video-run.json records the calls
shown in the native browser video, ending with a second proposal expired by a
committed edit. The manifests name the exact Tellegen tree and PowerIO commit.
Engine API Reference
@tellegen/engine is the public browser engine package. It is independent of SvelteKit and the hosted demo.
Constants
ENGINE_VERSION: the@tellegen/enginepackage version.API_SOURCE_SHA256: thecrates/tellegen/src/api.rshash the generated TypeScript types were built from.FORMULATION_IDSandSOLVE_STATUSES: generated enum tags from the Rust API layer.FORMULATIONSandDEFAULT_FORMULATION: browser UI formulation list and default formulation.
Browser Wasm Transport
browserWasmTransport: object facade for the browser wasm transport.createBrowserWasmTransport(): returns the browser wasm transport facade.preloadEngine(): initializes the wasm package.
The package also exports its two large assets as files, so a host can preload
or budget them without a path into dist: @tellegen/engine/wasm is the
WebAssembly binary and @tellegen/engine/places the populated places table.
Vite imports them as URLs with ?url
(import engineWasmUrl from "@tellegen/engine/wasm?url").
The facade has the same methods as the direct exports:
classifyJson(bytes)ingestJsonDrop(bytes)ingestCase(bytes, format)parseDisplay(bytes)capabilities()solveModule(moduleJson, request)createStudy(moduleJson, formulation)
Case And Display Helpers
formatOf(name): returns the powerio format token for a supported case name.isDisplayFile(name): returns true for PowerWorld.pwddisplay files.classifyJson(bytes): asynchronously classifies JSON bytes and returns{ kind, format }.ingestJsonDrop(bytes, { retain }): classifies and parses a JSON drop in one call. Withretain: true, a multiconductor module stays parsed in the engine and the payload’sinputholds aBrowserMcInputin place ofmodule_json(see Multiconductor PF).ingestDistCaseBytes(bytes, format, { retain })takes the same option.ingestCase(bytes, format): parses case bytes and returns a retained PowerIO module plus derived display data, summary, and topology.parseDisplay(bytes): parses PowerWorld display data for diagram overlays.
ingestJsonDrop returns a discriminated IngestedJsonDrop union:
kind | format | payload |
|---|---|---|
module | null | balanced or multiconductor payload |
transmission | string | IngestedCase |
distribution | string | IngestedDistCase |
ambiguous or unknown | null | null |
Use the kind discriminant before reading payload. format carries the
reader selected for transmission and distribution documents.
Solves And Studies
DC requests and Study options accept branch_susceptance_formula. See the
DC optimality compatibility matrix for tokens, equations,
benchmark assumptions and persistence semantics.
capabilities(): returns available formulations, operands, and parameters.solveModule(moduleJson, request): stateless solve from a PowerIO module. Adcopfrequest may carryconstraints, linear limits on branch flows, bus net injections, and generator outputs; the response’sconstraintsblock reports each row’s value and shadow price. See Formulations. Anacpfrequest may setstart: "case"to start Newton from the case’s stored bus voltages (see Formulations). AC responses includeinitialization: the requested start, the strategy that converged (used: "case" | "flat" | "perturbed"), andattemptsincluding failed starts. A perturbed success also gives its one-basedrestartnumber. Compact browser and server solutions retain this block; older saved results may omit it.createStudy(moduleJson, formulation, options?): builds a browserStudyfrom a PowerIO module and solves its declared problem instance.Study/BrowserStudy: browser handle with:currentSolution()preview(deltas, rates?)commit(caseId, deltas, rates, target)sensitivity(caseId, deltas, rates, target)saveModule()saveSolutionModule()for an exact DC OPF resultplan(spec, signal?)for a read only, bounded capacity planning run on a disposable Study cloneexport(format)free()
deltas are demand deltas in MW keyed by bus; rates are thermal rating
deltas in MW keyed by branch. A key is the original numeric id (bus id, 1-based
branch position) or a PowerIO row uid string when the source carries one.
ingestCase returns null for topology and view UIDs when the source has none;
solve responses omit absent UIDs.
Three-winding transformers remain typed in the retained module, while topology and
view payloads include their lowered star rows so the rendered graph matches the
solver. Those display-only rows have editable: false; persist edits only on
canonical rows. Closed transmission switches, in-service storage, and
in-service HVDC links are rejected until their solver models are implemented.
n_bus and n_branch count canonical typed rows;
n_analysis_bus and n_analysis_branch count the lowered topology rows. The
analysis counts are optional in TypeScript so clients remain compatible with
older engine builds.
target is { bus } for the LMP/demand column,
{ branch } for the LMP/rating column (nonzero only on binding lines), or
null for no column.
Call free() when a host app discards a study.
CapacityPlanSpecJson accepts a weighted LMP objective, canonical
candidate branch identities, MW bounds and increments, a final line count,
and an exact solve budget. BrowserStudy.plan materializes the committed
PowerIO module onto a disposable host, so the returned
CapacityPlanOutcomeJson is an unapplied proposal and cancellation does not
invalidate the retained interactive Study.
RMS Dynamic Simulation
Runs execute in a dedicated worker (rms-worker.js) with its own wasm
instance, so a run never blocks the page or the static-study worker.
rmsSupport():{ rms, experimental }for this engine build.looksLikeDyr(text): whether text reads as PSS/E dynamic data.openRmsCase(moduleJson, dyrText, options?): prepare a case once (options:load_modeland theRmsOptionsfields). Resolves to aBrowserRmsCase.BrowserRmsCase.inspection: the linked models, elements, initial residual, reference unit, held units and notes, without a run.BrowserRmsCase.flatCheck(seconds = 2): the largest speed and voltage drift of a run without events.BrowserRmsCase.run(request, { signal, onProgress, criteria }): run the events (RmsEvent[], default 20 s at 2.5 ms, recorded every 10 ms) and resolve to anRmsRun:time,keys,series(key)(a zero-copy view of one transferred buffer), the Rustscreening,notes,events,steps,newtonIterations,outputStepandworkerMs. Keys are the engine’s channels (vm:,omega:,delta:,pe:,pl:,ql:) and the derivedcoi:f,coi:omega,coi:deltaandf:<bus>. Abortingsignalterminates the RMS worker; the case reopens itself on its next call.BrowserRmsCase.linear(request?, { signal })(experimental): modes with participation factors; throwsExperimentalUnavailablewithout the feature.rmsDynamize(moduleJson, dyrText, request)andrmsLibrary()(experimental): default dynamics with typical parameters.setRmsWorkerFactory(factory): supply the worker (tests, custom bundling).
The request, inspection, options and screening types are generated from the
Rust schema (src/generated/rms-types.ts, checked by npm run types:check).
Synthetic Grid Generation
createSynthSession(request, { osm?, places?, signal? }): opens a staged generation on a dedicated synthetic worker and returns aBrowserSynthSession:advance({ withPreview? })runs one stage (context,site_buses,topology,electrify,dc_opf,calibrateonce per iteration,ac_pf,finalize) and returns itsStepOutcome;run(onStep?, signal?)loops it and resolves to theGenerationReport;preview()returns transferred typed arrays for binary map layers;report(),takeModule()(pio-ir with bus locations and branch routes),ingest()(theIngestedCasea dropped.pio.jsonof that module produces;coords_method: "generated"marks its synthetic coordinates as sites on real geography), andexportGridfm();cancel(reason?)terminates the synthetic worker (interactive studies are untouched), andfree()releases the session;hostKindis"worker", or"direct"when the page runs it.
generateSynthetic(request, options?): every stage in one request; returns{ moduleJson, report, ingest }.syntheticOverpassQueries(request): the Overpass QL for a region, one query per bounding box. Pass the fetched documents as theosmoption withsource: "osm".loadSyntheticPlaces(bytes),fetchSyntheticPlaces(),syntheticPlacesUrl(): the GeoNames places table (CC BY 4.0) shipped asdata/populated_places.json; sessions load it on first use.- Refusals reject with
SynthEngineError, whosecodeis one ofinvalid_request,region,places,osm,osm_insufficient(with bus and branch counts),build,engine,state,cancelled. @tellegen/engine/synthexports the generated request and report types;synthSchema, exported from the package root, validates a pasted request at run time.
See Synthetic Grid Generation for the pipeline.
Migrating To 0.2
ingestCasenow takesUint8Array, not a string. Encode an in-memory string withnew TextEncoder().encode(text); usenew Uint8Array(await file.arrayBuffer())for a browserFile.classifyJsonnow takes bytes, is asynchronous, and returns{ kind, format }:const { kind, format } = await classifyJson(bytes).@tellegen/svelteno longer exportsisStudyPackageText. For classification only, check(await classifyJson(bytes)).kind === "module". To identify the module value family and parse the drop, useawait ingestJsonDrop(bytes).JsonDropKindnow usestransmissionanddistributionwith a separateformat, plusambiguousandunknown. The formerbmopfandpmdkinds are distribution formats;not-jsonis nowunknown.
Types
Public types include:
SolveRequest,SolveResponse,ProblemCaps,PowerFlowStart,SolveDiagnosticLinearConstraint,ConstraintTerm,ConstraintTermKind,ConstraintResultSensRequest,SensitivityMatrix,SensitivityColumnNetwork,NetworkBus,NetworkBranchSolution,SolveIteration,DemandDeltasImplicitObjectiveJson,CapacityPlanSpecJson,CapacityPlanOutcomeJsonIngestedJsonDrop,JsonDropClassification,JsonDropKindBrowserFormulation,FormulationId,SolveStatus
The generated file is committed at packages/engine/src/generated/api-types.ts and checked in CI.
Python
The tellegen Python package binds the engine through PyO3 and ships as a
cp311-abi3 wheel built with maturin. One wheel per platform covers Python
3.11 and newer. The base package has no runtime dependencies: case parsing and
the solvers are compiled in, so import tellegen never reaches for numpy,
scipy, or the powerio wheel.
import tellegen
case = tellegen.load("case30.m") # parsed in Rust
solution = case.solve() # dcpf | dcopf | acpf | socwr
solution = case.update(demand={2: 50.0}) # absolute deltas, exact re-solve
column = case.sensitivity({"Price": "Active"}, {"Demand": "Active"})
Demand and rating edits are absolute deltas from the base case, the same
convention the browser protocol uses: update(demand={2: 50}) twice is the
same state as once. reset() returns to the base case. Engine errors arrive as
TellegenError subclasses with a stable .code such as SOLVE.INFEASIBLE or
EDIT.UNKNOWN_ELEMENT; a panic that crosses the boundary is converted to a
TellegenError with code BIND.PY.PANIC rather than escaping as a
BaseException.
Installing
Install the published package from PyPI:
python -m pip install tellegen
Wheels are provided for Linux x86_64/aarch64, macOS arm64/x86_64, and Windows x64. A wheel installation needs no Rust toolchain. To build from a checkout instead:
python -m pip install "maturin>=1.7,<2.0"
maturin build --profile release-py --out dist
python -m pip install dist/tellegen-*.whl
Install the wheel rather than running maturin develop: python/tellegen
holds no compiled extension, so a develop install on sys.path would shadow
the wheel with a source tree that cannot import its own extension.
The release-py profile builds the engine at opt-level = 3. The workspace
release profile is opt-level = "s" for the browser bundle, which is the
wrong trade for a native solver.
MCP server
The optional mcp extra adds the mcp SDK and the powerio wheel. It runs
capability, solve, plan, and Study tools in process over stdio, with a case
index resource and a congestion prompt. MCP server covers setup in
Claude Code and Claude Desktop, the tools, and an example session.
python -m pip install "tellegen[mcp]"
tellegen-mcp # or: python -m tellegen.mcp
The MCP extra uses the PowerIO 0.12 series of the Python wheel, the line the compiled engine is built on, so it reads the IR documents the engine writes (a 0.11 wheel refuses them). Installing the base package does not install or require the Python PowerIO package.
Case and Study paths are confined to POWERIO_MCP_ALLOWED_ROOTS, the policy
shared with PowerMCP. Proposals stay unapplied; applying one is a human action, and
there is no tool for it.
Versions
crates/tellegen-py/Cargo.toml carries the same version as the tellegen
crate so that pip install tellegen==X and cargo add tellegen@X name the
same solver. The release version job updates both manifests together, and
CI checks their parity. After a crate release, the crate workflow dispatches
Python publishing for the same tag. The publisher uploads only the wheels
and source archive that passed the Python gates.
Source layout
crates/tellegen-py/: the PyO3 extension, a JSON-in/JSON-out seam that mirrorscrates/tellegen-wasmand releases the GIL around every solve.python/tellegen/: the pure-Pythonload,Case, and error layer, plus the optionaltellegen.mcpserver.python/tests/: pytest suites run against the installed wheel in CI on Python 3.11 and 3.13, with wheels built for Linux, macOS, and Windows.
DC branch conventions
case = tellegen.load("case.m", branch_susceptance_formula="series_susceptance_no_phase_shift")
result = case.solve()
assert result["branch_susceptance_formula"] == "series_susceptance_no_phase_shift"
case.branch_susceptance_formula = "tap_adjusted_reactance"
Changing the property invalidates the cached solution; demand/rating edits and
reset retain it. None inherits a typed instance’s convention or the legacy
network default. The engine rejects conflicts with typed instances and rejects
DC options for AC solves. See the optimality compatibility matrix.
MCP server
tellegen-mcp serves the Tellegen engine to an MCP client, such as Claude Code
or Claude Desktop, over stdio. It reads case files from disk, solves them in
process, and keeps durable Studies. It offers nine tools, two kinds of
resource, and one prompt. The browser’s WebMCP tools work on the
case open in a tab; this server works on files.
Install
The server is the mcp extra of the Python package. Install it into a virtual
environment and note the absolute path of the entry point:
python -m venv ~/.venvs/tellegen
~/.venvs/tellegen/bin/python -m pip install "tellegen[mcp]"
ls ~/.venvs/tellegen/bin/tellegen-mcp
From a checkout, build the wheel and install it with the extra
(Python explains why maturin develop is not used):
python -m pip install "maturin>=1.7,<2.0"
maturin build --profile release-py --out dist
python -m pip install "$(ls dist/tellegen-*.whl)[mcp]"
python -m tellegen.mcp starts the same server.
Allowed roots
The server opens and writes files only under the directories listed in
POWERIO_MCP_ALLOWED_ROOTS, separated by : (; on Windows). A path outside
them is refused. When the variable is unset, the only root is the directory
the server started in, which depends on the client, so set it explicitly. The
policy is powerio.mcp.sandbox, shared with PowerMCP.
Claude Code
claude mcp add tellegen \
-e POWERIO_MCP_ALLOWED_ROOTS=/absolute/path/to/cases \
-- /absolute/path/to/venv/bin/tellegen-mcp
claude mcp list should report tellegen as connected. In a session, /mcp
shows its tools, and the prompt runs as
/mcp__tellegen__investigate_congestion /absolute/path/to/case.m. The
command adds the server for the current project only (--scope local); use
--scope user to add it everywhere. claude mcp remove tellegen removes it.
Claude Desktop
Add the server to claude_desktop_config.json
(~/Library/Application Support/Claude/ on macOS,
%APPDATA%\Claude\ on Windows) and restart Claude Desktop:
{
"mcpServers": {
"tellegen": {
"command": "/absolute/path/to/venv/bin/tellegen-mcp",
"env": {
"POWERIO_MCP_ALLOWED_ROOTS": "/absolute/path/to/cases"
}
}
}
}
Claude Desktop does not start servers from your shell, so it does not see your
PATH or an activated virtual environment. Use the absolute path to
tellegen-mcp.
Tools
| Tool | Title | Effect | What it does |
|---|---|---|---|
capabilities | Report engine capabilities | read-only | Versions, and per formulation whether it is available and which sensitivity operands and parameters it supports. |
solve | Solve a power network | read-only | DC power flow, DC OPF (LMPs, dispatch, flows, binding limits), AC power flow, or SOCWR, with optional edits and sensitivities. |
solve_module | Solve to a solution module | writes out_path if given | The DC OPF solution as a PowerIO DcOpfSolution module, inline or written to a file. |
plan | Plan capacity increases | writes out_path if given | A bounded search for branch rating increases that lower a weighted sum of LMPs, verified by exact solves. The proposal is not applied. |
study_create | Create a study | creates a file | A Study file from a case and a declared goal. Never replaces an existing file. |
study_inspect | Inspect a study | read-only | A Study’s summary, or bounded JSON pages of its goal, states, experiments or evidence. |
study_run | Run a study operation | appends a revision | Inspect, branch, revise a goal, compare, edit demand, restore the base case, propose, or record evidence. apply is refused. |
study_export | Validate a study for export | read-only | Validates a Study file as a portable bundle and returns its revision and SHA-256 digest. |
study_import | Import a study bundle | creates a file | Imports a bundle to a new path without restoring approvals. Never replaces an existing file. |
Every tool declares MCP annotations. readOnlyHint is true for the four
read-only tools. destructiveHint is true only for solve_module and plan,
because overwrite=true replaces an existing out_path. Every tool sets
openWorldHint to false: none reaches beyond the engine and the allowed roots.
Applying a proposal is a human action, so no tool does it.
Results
Each tool declares an output schema. A result arrives twice: as structured content that matches the schema, and as the same JSON in a text block for clients that read only text. Engine fields are typed loosely and every object admits extra keys, so a result never fails its own schema.
A solve result carries summary: bus, branch and generator counts, the LMP
range with the buses and sensitivity columns at each end, every binding branch
with its flow, rating and relief_per_mw (the objective decrease per extra MW
of rating), and the five most loaded branches. detail controls the
per-element arrays (lmp, flows, dispatch, …): "summary" leaves them
out and lists them in response.omitted, "full" keeps them, and the default
"auto" keeps them only when the result is under about 40,000 characters. A
500-bus DC OPF is about 260,000 characters in full and under 2,000 as a
summary. Arrays longer than max_elements arrive as
{"truncated": true, "count": n, "head": [...]}.
solve_module and plan return a solution module that can be large. Unless
out_path is given, module="auto" returns it only when it is under about
40,000 characters and otherwise explains how to write it; "inline" always
returns it and "omit" never does.
Object arguments
solve’s edits and sensitivities and plan’s spec are objects with
published schemas. Earlier versions took them as JSON text, which still works.
{
"path": "/absolute/path/to/cases/case3.m",
"edits": { "deltas": { "2": 30 }, "rates": { "2-3": 20 } },
"sensitivities": [
{
"operand": { "Price": "Active" },
"parameter": { "Demand": "Active" },
"indices": [1]
}
],
"detail": "summary"
}
deltas and rates are MW changes keyed by bus or branch id or PowerIO uid.
indices are zero-based sensitivity columns; summary.lmp.max_index is the
column of the highest-price bus. Omit indices only on small cases: a full
LMP-by-demand matrix has one row and one column per bus.
A plan spec:
{
"objective": {
"kind": "weighted_lmp",
"weights": [{ "bus": 337, "weight": 1.0 }]
},
"candidates": ["377-337", "182-185"],
"max_increase_per_branch_mw": 50,
"budget_mw": 50,
"increment_mw": 10,
"max_changed_lines": 2,
"exact_solve_budget": 8
}
An invalid value is refused with each field’s problem and an example, for
instance Argument `edits` is invalid (deltas.2: Input should be a valid number, ...). Example: {...}.
Resources
| URI | Content |
|---|---|
tellegen://cases | JSON index of case files under the allowed roots (up to 200, four directories deep, by suffix: .m, .raw, .rawx, .aux, .epc, .dss, .xiidm, .uct, .ucte, .cdf, .pio.json) with absolute paths. |
tellegen://cases/case3 | A bundled three-bus MATPOWER case. Its URI also works as a tool’s path. |
In Claude Code, @tellegen:tellegen://cases attaches the index to a message.
Prompt
investigate_congestion(case_path) asks the agent to confirm capabilities,
solve the case’s DC OPF as a summary, add demand if nothing binds, compute the
LMP sensitivity at the highest-price bus, explain the binding branches, and,
when a branch binds in the stored case, run plan and report the unapplied
proposal.
Example session
The PGLib 500-bus case ships with the repository at
crates/tellegen-server/fixtures/pglib/pglib_opf_case500_goc.m. With its
directory as the allowed root, a session runs as follows; the numbers are from
this build.
- Read
tellegen://cases. The index listspglib_opf_case500_goc.mwith its absolute path. - Call
solvewith thatpath,formulation"dcopf"anddetail"summary". Statusoptimal, objective 440,548.51. LMPs range from 28.15 at bus 381 to 53.93 at bus 337 (max_index336). One branch binds:377-337at its 278.49 MW rating, withrelief_per_mw32.88. - Call
solveagain withsensitivities: [{"operand": {"Price": "Active"}, "parameter": {"Demand": "Active"}, "indices": [336]}]. One more MW of demand at bus 337 raises its LMP by 0.0516 and the LMPs of buses 338 to 340 by 0.0316: the buses behind the binding branch move together. - Call
planwith the spec above. Three 10 MW trials on377-337are accepted; the third predicted a change of -1.21 and measured -8.94. The proposal is +30 MW on377-337, which lowers the LMP at bus 337 from 53.93 to 42.73 in four exact solves. Nothing is applied. - To keep the work, call
study_createwith a Study path under the allowed root andinput_pathset to the case, then usestudy_runoperations such asproposeandrecord_evidenceto save proposals and the reasoning behind them. Applying a proposal stays with a person.
WebMCP and MCP
The browser tools act on the case shown in a tab and keep a live session; this server is stateless between calls except for Study files. The closest equivalents:
| WebMCP (browser) | tellegen-mcp |
|---|---|
list_cases | tellegen://cases resource |
select_case, import_case | the path argument of each tool |
inspect_case, query_network | solve, with detail |
analyze_sensitivity | solve with sensitivities |
preview_case_update | solve with edits |
update_case, reset_case | none: there is no live case; pass edits on each call |
propose_capacity_plan | plan |
apply_capacity_plan | none: applying is a human action |
create_study | study_create |
inspect_study | study_inspect |
revise_study_goal, branch_study, compare_study_states, propose_study, edit_demand, restore_base_case, record_study_evidence | study_run with kind revise_goal, branch, compare, propose, edit_demand, restore_base or record_evidence |
| none | solve_module, study_export, study_import |
export_case, settings tools, run_calculation, solve_multiconductor_pf, focus_network, inspect_webmcp_registration | none |
Both surfaces set readOnlyHint on read-only tools. WebMCP’s
untrustedContentHint has no MCP counterpart; here, too, case names and
identifiers come from the files an agent opens.
The tool names and arguments match PowerMCP’s Tellegen server
(powermcp run tellegen), which runs the native CLI instead of the engine in
process.
Multiconductor AC power flow
Tellegen solves prescribed-load AC power flow on PowerIO’s MulticonductorNetwork. Frederik Geth contributed the fixed-point solver, winding models, and independent comparison fixtures in PR 109.
Import a BMOPF JSON case or load the 4-conductor example from Studies. Run AC power flow, then inspect terminal voltages, conductor currents, and source powers. Results use volts, degrees, amperes, watts, and var. A declared neutral also allows phase-to-neutral voltage comparisons. This calculation does not optimize generation or calculate LMPs.
Geographic GeoJSON can accompany the case or be attached to the selected case later. Bus points use equipment identities; line routes can use bus_from and bus_to. Geographic positions appear on the map. Drawing positions appear on a plain canvas. Attaching geometry retains the electrical input and any current result.
Supported calculations
The solver uses one complex sparse LU factorization and updates compensated load currents until both voltage changes and physical KCL residuals meet their tolerances. Constant-power, constant-current, constant-impedance, ZIP, and exponential loads are included, along with ideal voltage sources, lines, shunts, explicit neutral conductors, and supported winding equipment. Phase-to-phase single-phase transformers, a two-winding entry expressed using BMOPF’s n-winding representation, and PowerIO’s three-coupled-winding lowering of a BMOPF centre-tap transformer are supported.
Finite source impedance, active device controls, generator/IBR injections, unsupported load models, unsupported per-phase taps, ideal zero-leakage winding models, and arbitrary multiwinding transformers require additional numerical models. Such data can remain available for inspection, but the calculation reports unsupported physics instead of silently simplifying it. Draft BMOPF 0.2 data remains subject to Task Force review.
A current result belongs to the input that produced it. Cancelling or failing a new calculation retains the preceding result. Numeric columns exported to PowerIO are ordered by bus/terminal and source/terminal identities, with missing or duplicate identities rejected.
After an initial solve, select a bus to edit each attached load branch’s active and reactive power. The browser coalesces rapid changes and automatically warm-solves from the last converged voltages. It retains the same sparse factorization because load power changes alter the nonlinear current injection, not the passive network operator. The physical impedance and voltage-envelope terms still follow the edited power; only the fixed-point compensation reference is frozen. Resetting a row removes its override, and saved results contain the edited input and its qualified result. An edit changes only the solver’s load laws: the network is not copied, and each edit returns a small summary in one round trip. The Studies panel then fetches only the selected bus and one page of equipment results. The portable input, optional canonical solution, and complete result are built only for save, export, geography attachment, or an explicit full rebuild. Multiconductor PF performance states the latency target and payload budgets with measurements.
Solver settings and OpenDSS comparison
Open Settings from the header, Network or Studies to edit the next explicit run. Choose Apply settings, then run explicitly. See the common settings menu and API. Network and Studies share these settings. Editing a value does not solve; use the single context-sensitive solve button. A successful solve scrolls Studies to the overview with violations, losses and voltage ranges. Failed runs retain the preceding result and its recorded settings. Reopening a saved study restores the settings that produced that result.
| Setting | Default | Meaning |
|---|---|---|
Use load-model envelope (voltage_envelope) | Enabled | Permit the low/high-voltage fallback described below. |
Vlow (v_low_pu) | 0.50 pu | Below this breakpoint, use nominal constant impedance. |
Vmin (v_min_pu) | 0.85 pu | Lower end of the original load-law band; below it, transition toward the low-voltage impedance law. |
Vmax (v_max_pu) | 1.15 pu | Above this breakpoint, use impedance matched to the original law at Vmax. |
Maximum iterations (max_iterations) | 100 | Maximum number of fixed-point iterations. |
Damping (damping) | 1 | Full voltage update; values in (0, 1) damp the update. |
Voltage-change tolerance (tolerance) | 1e-4 V | Maximum absolute change in complex terminal voltage between iterations. |
Zero-voltage tolerance (zero_voltage_tolerance) | 1e-9 V | Near-zero voltage guard when evaluating load currents; not a convergence tolerance. |
Absolute KCL tolerance (absolute_kcl_tolerance) | 1e-4 A | Absolute current-mismatch allowance at each unknown terminal. |
Relative KCL tolerance (relative_kcl_tolerance) | 1e-5 | Dimensionless current-mismatch allowance scaled by incident-current magnitude. |
The three convergence tolerances were previously 1e-8 V, 1e-6 A and 1e-8, respectively. The new defaults reduce unnecessary iterations in interactive studies while retaining a physical current-balance check. All other defaults are unchanged. These are stopping criteria, not guaranteed bounds on solution error; use tighter tolerances for sensitive comparisons or small differences between large quantities. Frozen numerical-oracle tests retain their explicit tight settings.
Convergence requires both the voltage-change check and, at every unknown
terminal, |KCL residual| <= absolute_kcl_tolerance + relative_kcl_tolerance * I_scale.
I_scale is the larger of the summed incident device-current magnitudes and the
magnitude of the net load current. The reported scaled residual must be at most 1.
For example, at a 100 A scale the new KCL allowance is 0.0011 A.
OpenDSS documents a default solution tolerance of 0.0001, applied to voltage magnitude changes and normalized by the bus voltage base when one is defined. Tellegen’s 1e-4 V is not 1e-4 pu, and its complex-voltage and KCL checks are not OpenDSS’s stopping rule. At a 240 V base, 1e-4 pu corresponds to 0.024 V, versus Tellegen’s 0.0001 V absolute update threshold. There is no universal conversion from OpenDSS’s voltage tolerance to Tellegen’s KCL tolerances. This change follows the practical goal of avoiding excessive iteration; it does not claim identical accuracy, iteration counts, or results. See EPRI’s solution options and the OpenDSS maintainer’s explanation of tolerance.
OpenDSS’s documented load defaults are Vminpu=0.95, Vmaxpu=1.05, Vlowpu=0.50. Tellegen deliberately retains its wider 0.85–1.15 pu band and its existing 100-iteration cap. Users can choose 0.95 and 1.05 for a closer load-band comparison, but that alone does not make the two solvers equivalent. These load thresholds change equations; they are separate from engineering voltage limits and the Overview’s violation counts. See EPRI’s load properties.
The fallback moves a constant-power load toward constant impedance, not toward constant power. EPRI explains this as a way to maintain convergence at extreme voltages in Load Models That Nearly Always Converge. Tellegen makes the consequence explicit: after convergence it checks the original load law at the final voltages. A result that used changed equations is labeled Modified load model — non-canonical result in the UI and exports. Disabling the envelope evaluates the original equations at all voltages, without promising convergence. Merely going outside the band does not mark an unchanged impedance load as modified.
Energized-network scope and saved results
Loading a case detects bus islands without a voltage source. Network and Studies show Run power flow when all islands have source coverage, or Solve energized network with counts and an expandable exclusion list before the first run. With no source-covered island, solving is disabled and the full case remains inspectable. Clicking the energized action explicitly selects the source-covered subset; loading alone does not select it. This connectivity check does not prove conductor-level solvability. Retained inputs are prepared inside the engine, so selecting energized islands and rerunning with new settings does not serialize the full network into IR text.
All buses and equipment stay in the map, diagram and saved input. Excluded buses have no calculated result; they are not reported as zero voltage or zero load. Unsupplied loads are omitted from solved totals. Scope and load-model fidelity are separate qualifications and both are retained in CSV and Study JSON. Component coordinates on excluded equipment remain in the full input; only attachments to retained equipment accompany the solved subset.
Version 2 studies save the input, effective settings, qualification and full
result. A canonical PowerIO solution module is included only for an original-model
result; otherwise solution_module is null. Version 1 studies are reassessed on
replay. Replay checks exclusions, model qualification, and terminal, source and
component quantities against the saved voltages and network equations without
running another power flow. Unconverged iterates remain unavailable.
Operating-point overview
Above the detailed results, the Studies panel summarises the displayed operating point: limit violations, losses, the voltage range for each declared voltage reference, the most heavily loaded branch, and the largest voltage unbalance. Selecting a tile selects its bus or branch on the map. Issues are ranked with violations first, then by how far they exceed their limit: voltages outside the case’s declared phase-to-neutral or phase-to-phase limits, and branches at 90 % of their declared rating or more (a violation above 100 %). A transformer’s loading is its apparent power at each bus it connects, against its largest winding rating there, so the two halves of a centre tap are judged together; a transformer with several windings counts once in the losses and the issue list. A case that declares no limits or ratings shows no issues and says so; nothing is ranked against invented bounds.
For a selected bus, bars place each terminal-pair voltage within its declared band. Unbalance is the voltage unbalance factor |V2|/|V1| from terminal phasors, shown beside the phase-to-neutral magnitude spread; when the spread is much larger, the difference is neutral shift, which the unbalance factor excludes. For a selected branch, bars show the current in every conductor at both ends on one scale, with the neutral’s share of the largest phase current.
Show diagram in the Overview replaces the map with the diagram renderer. The same button in the case’s Network panel opens it before any solve, for topology and equipment alone: useful for cases the power flow cannot solve yet, such as those with generators or inverter-based resources. Colouring and values appear once a solve succeeds. It opens on the case’s own positions, Geographic over the same basemap, or Source positions for a drawing, so the view continues from the map: in Geographic it opens at the map’s own view when that shows part of the feeder, and closing from Geographic returns the map to the diagram’s view. Schematic then switches to a schematic of the case, laid out by the engine; that layout is computed on opening, so the switch is immediate. Buses are placed by branch steps from the sources, with tree branches drawn as right-angled routes. Tidy packs subtrees as closely as their rows allow; Leaf order gives every leaf its own row; branches that close a loop and open switches are drawn straight so they cannot be mistaken for the tree. Geographic (or Source positions for a drawing) shows the case’s own positions instead, and switching between the two moves each bus from where it is on screen to its new place, keeping the selection; it switches instantly when the system asks for reduced motion. Colour by voltage within the declared band or by loading as a percentage of the rating; a faint underlay keeps the network visible where results are unremarkable. PNG and SVG exports of the visible view carry a title block with the case, layout, colouring, camera and solve. Layout downloads the schematic as a PowerIO diagram layer (.geo.json, powerio_geo.space = "diagram", positions marked as computed): one point per bus and one route per line, matched by line id. Load it together with the case to use the schematic as the case’s drawing, or pass it to PowerIO tooling. In source positions the schematic follows the routes the case carries.
Equipment is drawn with symbols once they are large enough to read. A transformer shows as two overlapping winding circles, drawn once however many windings it has. A three-phase unit carries each winding’s connection inside its circle (Δ, Y, or Y with a tail when its neutral is brought out, IEC 60617), a split-phase unit a tap brought out below its secondary, and a single-phase unit plain circles; zoomed out, the fixed-size transformer markers keep these marks. Closest in, a label gives the vector group without its clock number and the rating, such as “Dyn · 500 kVA” or “1φ split · 25 kVA”. A switch is a blade between two contacts, lifted when the switch is open; the branch line breaks where the symbol sits, and a plain line has no symbol. Loads, generators, inverter-based resources, sources and shunts hang below their bus, one symbol per kind and connection with a count when several connect alike: three single-phase loads on different phases are three symbols. Each symbol’s drop carries its conductors the way a line does (one slash per phase, a circled slash for the neutral), and closest in a label gives its terminals in the model’s own names, led by its connection: “a–n”, “Y 123n”, “Δ abc”. Several symbols of one kind hang side by side from a short rail, so they do not read as in series. A shunt is drawn as a general admittance block because BMOPF shunts can be conductive as well as capacitive. A shunt connected to its bus’s neutral and nothing else is a neutral earth, such as an MEN electrode, and is drawn as an impedance box in series with the earth symbol (three shrinking bars, IEC 60617); it is not drawn as a solid earth, since a shunt always has a finite admittance. A bus’s perfectly grounded terminals are drawn as a solid earth, the earth symbol alone, in a slot of their own; its tooltip names the terminals. In the schematic each bus has room below it for its symbols, so they never overlap the next row. Hover a symbol for its ids, or click it to select its branch or bus. When colouring by Equipment and topology, a legend lists the symbols in the drawing. Zoomed far out, the symbols give way to plain lines in their kind colours.
Closer in, each line carries its conductors across it: one slash per phase, and a slash ending in a small circle for the neutral. Hovering a line gives the same count in words. Closer still, buses are named. Long ids are shortened around an ellipsis, such as lv_extension_0…c28d5, and the full id shows on hover and in the overview. Buses and branches that no source reaches through closed branches are drawn faint in every colouring, and the toolbar counts them. Selecting a bus or branch outside the schematic, from an issue, search, a table or the profile, brings it to the middle of the uncovered part of the view, zooming in until its symbols are legible. Clicks in the schematic itself leave the view where it is.
Where branches are drawn along exactly the same segment, as when an MV and an LV line hang between buses at the same positions, the route shows a count badge (×2) once conductor marks are visible. Hovering the route fans its branches a few pixels apart, tapering into the shared ends so each still meets its buses, and a card lists them with kind, voltage level, conductors and loading. Each fanned line and each row can be hovered and selected; clicking the route or its badge keeps it open, and Escape or a click elsewhere closes it. With the cursor on a bus, Tab steps through the branches on shared routes there. Separate overlapping buses and lines in the key keeps every shared route fanned and every stack of buses spread, for example for screenshots; the true positions are unchanged. Clicking an issue that is already selected brings it back into view. When the diagram opens, an existing selection is centred if it is off screen, but not zoomed into, so the view still continues from the map.
In Geographic, buses the case places at exactly the same point, such as the MV and LV buses of a pole transformer, would hide each other. Such a stack shows a thin ring with a count badge (×2) once symbols are visible. Hovering it spreads its buses on a small circle of fixed screen size, with spokes back to the true point; their lines and symbols move with them. A card lists the buses with voltage level, attached equipment and, after a solve, the worst voltage; each bus and row can be hovered and selected. Clicking the stack keeps it open, and Escape or a click elsewhere closes it. A click on a stacked bus while the stack is closed opens the stack rather than guessing which bus was meant. The keyboard cursor spreads the stack it is on and says that its bus is one of several at that point.
The schematic can be walked from the keyboard. Focus it, then use Left to go to the feeding bus, Right to go onward, and Up and Down to move between buses fed from the same place, in drawing order. Home returns to the source, Enter selects the bus, and Escape stops. A ring and the bus name mark the cursor, the view follows it, and a screen reader hears where the bus sits, what feeds it, what is attached, and its worst voltage against the declared band. Shift with the arrow keys pans.
Once the power flow is solved, the close-up schematic shows values. Each load, generator, inverter-based resource, source and shunt carries its P and Q beside its symbol: consumption for loads and shunts, output for the others. Each branch has an arrow showing which way active power flows. The symbol key in the lower left can be collapsed. Hovering a bus or branch highlights it in the schematic and the results table together.
Each galvanic zone without a source is marked as one network: the buses that are joined by lines and closed switches, separated from the rest only by transformers, which on a feeder are the LV networks. In the schematic the outline follows the drawing column by column, so neighbouring networks stay apart. The outline is orange when a branch inside, or its transformer, is near its rating, and red when a voltage is outside its band or a branch is over its rating. Hover an outline for the transformer feeding it, its size and its state; click it to fit the view to that network. On geographic positions a network is drawn instead as a corridor: a translucent band of fixed screen width along its own lines and around its buses, shown while zoomed out. Neighbouring LV networks often interleave along streets, so outlines around them (such as convex hulls) would overlap even though every bus belongs to exactly one network; a corridor covers only where its network runs. Corridors of networks within limits share one quiet tint; orange and red stay reserved for networks with a problem.
Hovering shows where something sits, the same way on MV and LV. A network’s feeders are the branches leaving the bus it is supplied at: on MV, the feeders leaving the source bus; on LV, the circuits leaving the transformer. Hovering a bus or line, here or in the tables, darkens its feeder strongly and the rest of its network faintly, and rings the network’s supply point (its source bus, or its feeding transformer). Hovering a transformer shows the network it feeds, and hovering a corridor its whole network. With Path to source on, the hover also traces the drawn path back to the source in green, across transformers. Feeders follow the drawing’s tree, so through a closed loop a feeder is the drawn one rather than a unique electrical path. Bus, line and load tooltips name their feeder, such as “feeder 2 of TX 1234”. Once an outline is wide enough on screen, a tag at its corner names the feeding transformer and gives the network’s size, and after a solve its lowest phase–neutral voltage and highest loading.
Lines are weighted and, in Equipment and topology, coloured by voltage level, as on a paper single-line diagram: MV and above (from 1 kV) heavier than LV, in shades of blue that darken from MV through subtransmission (from 25 kV) to transmission (from 100 kV), and LV in grey. A network’s level is the declared rating of a transformer winding or source in it, else its declared limits, else its solved voltages; the key lists the levels in the drawing, such as “MV · 11 kV”. Zoomed out, LV lines fade and LV bus dots are left out, so the MV backbone, the network outlines and their states read first; LV detail returns as you zoom in. In Voltage within declared band colouring every bus dot stays.
Sources, generators, inverter-based resources and transformers stay findable when zoomed out. They are drawn as landmarks: their symbol at a fixed size on screen, on a paper halo, handing over to the full symbols as you zoom in. Landmarks are placed by priority so the overview never fills with markers. Sources always show. Next come transformers whose network has a problem (drawn in its colour), then generators and inverter-based resources of at least 1 % of all generation, then other transformers by the size of the network they feed, and last the small inverter-based resources such as rooftop PV, which therefore appear only as there is room. Sources and generators carry their name. Hover a landmark for what it is, click it to select it. The Landmarks box in the key turns them off.
In Geographic, the schematic draws over the same basemap as the main map (CARTO Positron, without labels), kept in step as you pan and zoom. The basemap fades in as the buses move to their geographic places and fades out, staying where it was, as they move back to the schematic. The Basemap box in the toolbar turns it off. A bus the case gives no position (often an LV stub behind a pole transformer) is drawn next to the nearest connected bus that has one; the toolbar counts such buses and their tooltips say so. The main map leaves them out. PNG and SVG exports leave the basemap out. A transformer whose two buses share one location gets its symbol at that point, so it stays visible on the map.
For a selected branch, a multi-wire view draws every conductor between the two buses’ terminal rails, so a crossed terminal map shows as crossing wires, with grounded terminals, terminal attachments and each conductor’s current. A transformer is drawn as a winding box with wires meeting it from each side: its windings couple magnetically, with no conductor continuity across them.
Once a study is saved, the address bar records it with the selection and view (?study=…&sel=bus:…&view=schematic), and Copy view link copies that address. The link reopens the study in a browser that holds it, saved there or imported from an export; it does not carry the data itself.
Search finds buses and branches by ID. The bus and branch tables sort, filter to issues, and follow the selection; arrow keys move it. CSV exports keep full precision and begin with the case and solve that produced them. Cases with more than 25,000 buses compute the overview when asked rather than after every load edit, because reading a full result of that size takes a noticeable fraction of a second (evidence).
Save a result in Studies to retain its input, solver options, terminal values, and, when the original load model is verified, its canonical PowerIO solution. Import/export moves the saved result between browsers. Reopening checks that its input and results agree without solving again. A geographic attachment updates both saved modules and retains all electrical values. These versioned multiconductor snapshots do not offer the balanced-network planning objectives or sensitivities.
Raw OpenDSS files remain available for inspection. The multiconductor calculation requires supported BMOPF data or a typed PowerIO AC power flow input with explicit source and device settings.
Native and browser APIs
The native API accepts a typed McAcPfInstance:
let result = tellegen::solve_mc_ac_pf_instance(&instance, &tellegen::McPfOptions::default())?;
let portable = result.to_powerio_solution(&instance)?;
The command line accepts either PowerIO IR or BMOPF JSON:
tellegen solve-mc < case.pio.json
tellegen solve-mc-bmopf '{"max_iterations":200}' < case.bmopf.json
OPTIONS_JSON also takes two keys that choose what the command prints; neither is a solver setting:
"output"selects the view."full"(the default) prints the completeMcPfResult, as before."summary"prints the constant-sizeMcPfSummary(convergence, iterations, residuals, load voltage range and violation count, source power, passive loss, counts) without building per-terminal records."tables"prints{"summary": McPfSummary, "tables": McPfResultTables}(themc_pf_tables_viewschema), the full result’s rows as columns with each name stored once and complex values interleaved[re, im]."profile": trueadds aprofileobject to whichever view is printed: theMcPfProfilephases in milliseconds (parse_ms,prepare_ms,factor_ms,load_evaluation_ms,kcl_and_matvec_ms,linear_solve_ms,summary_ms,total_ms, withiterationsandlinear_solves), plus two output phases the CLI times itself:output_ms, building the printed view from the solved session, andserialize_ms, writing that view as JSON text.total_mscovers the solve phases only. Writing the text to stdout and process start-up are outside the profile. Themc_pf_solve_profileschema describes this object.
tellegen solve-mc '{"output":"summary","profile":true}' < case.pio.json
tellegen solve-mc-bmopf '{"output":"tables"}' < case.bmopf.json
The views other than the default solve through McPfSession, so solve-mc then applies the same input checks as a multiconductor Study: the module must hold a MulticonductorNetwork or an McAcPfInstance. Every view except profile is deterministic for a given case and options; the profile’s durations vary between runs.
tellegen describe includes the options and result schemas, the McPfSummary, McPfResultTables and McPfProfile schemas, and the printed tables view (mc_pf_tables_view) and profile object (mc_pf_solve_profile).
The browser’s distribution graph carries the case’s declared limits when present, in volts: DistGraphBus.voltage_limits lists phase-to-neutral (vpn_min, vpn_max) and phase-to-phase (vpp_min, vpp_max) bounds, the latter ordered by the pairs (1,2), (2,3), (3,1) of the phase terminals and named in vpp_pairs, phase-to-ground bounds keyed by phase terminal (v_min_by_terminal, v_max_by_terminal, from BMOPF v_min/v_max or PMD vm_lb/vm_ub), and the sequence and neutral-to-ground bounds (vpos_min, vpos_max, vneg_max, vzero_max, vn_max). DistGraphEdge.rating gives per-conductor ampacity (i_max) or, for a transformer, its largest winding rating in volt-amperes at each bus it connects (s_rating_by_bus). The overview ranks voltages against the phase-to-neutral, phase-to-phase and phase-to-ground bands. The McWorkbench component in @tellegen/svelte renders it from a result snapshot and the graph’s inputs. MulticonductorCase.overviewSnapshot holds the active case’s snapshot of overviewResult, built once per operating point and shared with the schematic, and overviewInputs and overviewSearch hold the network-only inputs, rebuilt only when the graph is replaced. controller.multiFullResult(case) reads the full result from a stored solve or the live session.
mcSchematicLayout(graph, { strategy, dx, dy, attachment_gap }) lays out a distribution graph in the engine (tellegen::schematic::schematic_layout natively). It returns columnar bus positions, routed segments, each branch’s role (tree route, loop, or open) and the display forest (breadth-first from the sources), which also orders the keyboard walk. attachment_gap (22 by default, 0 to disable) is the room reserved below a bus for each kind of attached equipment; attachment_slots reports the reserved slots per bus: one per kind, plus one when the bus has perfectly grounded terminals. The layout version is recorded in exported layers. The JSON result carries complex terminal voltages, currents, device powers, source reactions, iteration counts, and KCL residuals.
The browser package provides solveMcModule(moduleJson, options, signal) and solveMcBmopf(text, options). The module operation runs in a separate worker so cancelling it leaves other calculations intact. Environments without workers check cancellation after synchronous execution and discard a cancelled result.
For interactive load changes, createMcPfSession(input, options) creates a BrowserMcPfSession in the shared engine worker. input is PowerIO IR text, or a BrowserMcInput: the module the engine kept when the case was ingested with { retain: true }. A kept module never crosses the worker boundary as text, which matters for a whole-city model whose pretty-printed IR exceeds the 128 MiB input limit. BrowserMcInput.moduleJson() writes the text on request and free() releases the module. initialSummary describes its first solve. Its replaceLoadPowers(edits) method takes the complete absolute override set, warm-starts from the previous solution, reuses the prepared LU, and returns an McPfSummary: convergence, residuals, load voltage range and violation count, source power, passive loss, and counts. lastTiming records the edit’s engine, transfer, and parse time, and profile() the engine’s own phases. Detail is fetched on demand: detail({ bus, element, port_offset, port_limit }) returns one bus’s terminals and a page of equipment ports, terminalIds() with terminalVoltages() and terminalCurrents() return interleaved Float64Arrays, and result() builds the complete McPfResult; resultTables() returns the same rows as columns (McPfResultTables: names interned once, values in transferable typed arrays), which whole-network views read, and mcPfResultTables(result) gives a stored result the same form. loadBranches(), inputModule(), input(), and snapshot() expose the editable identities and materialize the current solved state (input() keeps it in the engine as a BrowserMcInput); materializationCount() confirms that ordinary edits build no edited network. summarizeMcPfResult and mcPfResultDetail give a stored result the same shapes. Native callers use McPfSession (from_module, summary, detail, terminal_voltages, build_result, edited_instance, input_module) and McLoadPowerEdit. A session must be rebuilt after structural changes such as topology, taps, source voltages, load connection maps, voltage-model parameters, or solver options.
solveMcStudy, replayMcStudy, and applyMcStudyGeo create, reopen, and update saved multiconductor results. Native callers use McStudySnapshot for the same operations.
An agent can use inspect_case, solve_multiconductor_pf, and query_network. A solve requires the case ID and displayed revision. Querying voltage_v ranks buses by their largest terminal-to-ground voltage; terminal_values lists the individual terminals. price remains unavailable for AC power flow.
Evidence
The test suite includes analytic resistive feeders and comparisons against OpenDSS reference results for grounded, floating, and impedance-grounded neutrals, three-phase lines, delta loads, multiple winding connections, and a loaded split-phase centre-tap transformer. The centre-tap oracle checks voltage plus aggregated physical-terminal current orientation and complex power. The published tolerances distinguish voltage, current, and complex-power comparisons. These fixtures establish the supported calculations; they do not establish universal convergence or multiconductor AC OPF support.
Further tests exercise the real WASM worker, unsupported-data rejection through IR reload, geographic points and multi-point routes after attachment, and unchanged electrical results after geographic edits. Session tests check that edits reuse the factorization and build no edited network, that the summary equals the complete result it summarizes, and that portable output is byte-identical to the previous implementation. A generated ~10,000-bus regression runs in CI (performance).
Settings
Open Settings in the header or panel toolbar. The Network and Studies power-flow settings buttons open this same panel.
Calculation settings belong to the selected case. Edit the draft, choose Apply settings, then run explicitly. Applying, resetting, or selecting another calculation does not solve or replace the displayed result. Until a new run succeeds, the result retains its preceding calculation and settings. A failed or cancelled rerun retains that result. Load edits and sensitivity calculations use the accepted Study/session settings, independently of pending choices.
The panel groups load-model and constraint behavior separately from numerical controls. Advanced multiconductor tolerances are collapsed. The load envelope changes equations, and angle/thermal selections change the DC OPF optimization model. These are distinct from engineering limit assessments. Source-less-island exclusion remains an explicit Solve energized network action, with exclusions visible before execution. Once an energized solve succeeds, or an input carrying the selection is opened, that case solves only its energized network; re-import it to solve the full network. Clearing a numeric field restores its case default.
Scope and defaults
| Scope | Storage | Examples |
|---|---|---|
| Calculation | Case and saved result | Multiconductor PF options, AC PF initial voltages, DC OPF limit enforcement |
| Display preferences | This browser | Theme, bus sizing, preferred coloring |
| View state | Existing view controls | Camera, selection, map/diagram mode and panel positions |
Hosted-case manifests (pf_options in distribution-cases.json, see Deployment) accept any of the ten multiconductor options and validate them through the common Rust resolver; an unknown or invalid option makes that case unavailable.
Calculation settings resolve in this order: engine defaults, hosted-case or restored-study baseline, explicit overrides. Restore case defaults removes the overrides and restores that baseline, including hosted-case overrides. It does not reset every case. Display defaults are restored separately. If browser preference storage is unavailable, changes remain usable for the current visit and a message identifies the persistence failure.
All ten multiconductor PF options are described in the power-flow guide. Balanced AC PF supports start: "flat" | "case". DC OPF supports angle_difference, thermal ("all", "rated", or { "branches": [ELEMENT_KEYS] }) and optional lazy (null or { "max_rounds": 20, "near_binding": 0.98 }). Other calculations describe their availability and any public options; this interface adds no numerical parameters to those solvers. The isolated browser AC OPF backend remains separately available according to the host configuration.
The Rust resolver owns calculation defaults and validation. Generated TypeScript descriptors expose labels, units, types, defaults and constraints. The running engine’s catalog reports its build capabilities. Unknown or unsupported settings and invalid combinations are rejected before selected state changes. A partial nested option object is replaced as a unit and its omitted fields receive that option’s typed defaults.
Display preferences also hold experimental (default off): it shows the
experimental dynamics tools of Dynamics mode, small-signal modes
and default dynamics, whose results carry an Experimental label. It is
validated and saved with the other preferences in this browser.
TypeScript
import {
describeSettings,
resolveSettings,
calculateWithSettings,
createSettingsHttpClient
} from '@tellegen/engine';
const catalog = await describeSettings();
const settings = { calculation: 'mc_ac_pf', overrides: { damping: 0.8 } };
const resolved = await resolveSettings(settings);
const result = await calculateWithSettings({ module_json, settings }, signal);
// Same request and result contracts, through a server with compute enabled.
const http = createSettingsHttpClient('/api');
const remoteResult = await http.calculate({ module_json, settings }, signal);
A resolved response carries version, calculation, engine_defaults, the full baseline, the supplied overrides, and full effective settings. The calculation response pairs these settings with its existing solver result. Multiconductor results retain load-model qualification and excluded-island provenance.
For an interactive Svelte host, controller.inspectSettings(case) reads next-run and accepted-result settings. controller.updateSettings(case, calculation, patch, expectedSettingsRevision) validates and applies an atomic patch without solving; pass true as its final argument to restore the case baseline. controller.runSettings(case, signal) explicitly calculates. Mutations reject changes during a solve and recheck revisions after asynchronous validation. Display preferences are available through app.preferences.inspect(), update(patch) and reset().
createStudy(input, formulation, { settings }) and Rust Study::new_with_settings retain accepted options for later edits and sensitivities. PowerIO saves of such a Study carry a tellegen.calculation_settings extension: { "version": 1, "calculation": "dcopf", "overrides": { … } }, where overrides holds only the options whose values differ from the engine defaults. A later engine therefore applies its own defaults to everything the user never changed. A saved DC OPF instance states the actual active angle/thermal constraints; lazy enforcement does not remove its original enforceable limits.
Reopening restores the recorded options over the current engine defaults. A recorded option this engine does not know, such as one written by a newer version, is dropped with a warning rather than refusing the file: Rust Study::new reports it as a settings_ignored diagnostic on every solve, and the Svelte app logs it when the file opens. Study::new also ignores, with the same diagnostic, a record of another format version and settings recorded for a different calculation than the one it opens. Known options keep their full validation. Legacy inputs without this extension retain their existing defaults and do not acquire invented historical provenance. Existing versioned multiconductor snapshots keep their own effective options and replay checks.
Native and CLI
use tellegen::settings::{Calculation, CalculationRequest, SettingsRequest};
let settings = SettingsRequest::new(Calculation::McAcPf).with_overrides(overrides);
let resolved = tellegen::settings::resolve(&settings)?;
let request = CalculationRequest::new(module_json, settings).with_energized_only(true);
let result = tellegen::settings::calculate(&request, cancel_flag)?;
let catalog = tellegen::settings::describe();
Calculation names a calculation; its JSON form is the wire name ("mc_ac_pf", "dcopf", "acpf", "dcpf", "socwr", "acopf"), which as_str, Display and FromStr also use. The request and result types are #[non_exhaustive], so build requests with new and the with_* methods.
tellegen settings describe
printf '%s' '{"calculation":"mc_ac_pf","overrides":{"damping":0.8}}' | tellegen settings resolve
tellegen calculate < calculation-request.json
tellegen solve-mc '@pf-options.json' < case.pio.json
tellegen solve-mc resolves its options through the same resolver, so an unknown option key is an error rather than being ignored. The output and profile keys choose the printed view and are removed before resolution (Multiconductor power flow).
tellegen describe includes the settings catalog and calculation request schema. Existing solve commands remain available. A calculation request contains a module_json string, settings, optional balanced-network edits, and optional energized_only (multiconductor PF only). Multiconductor load edits belong in the input module.
HTTP and WebMCP
GET /api/settingsdescribes settings supported by this server.POST /api/settings/resolveaccepts a settings request and returns resolved settings without running a solver.POST /api/calculateaccepts a calculation request. It uses the existing compute gate, rate limit, concurrency permits and timeout. The request body is limited to 64 MiB; a larger declared body is refused with 413 before it waits for a solver permit, and the body is read only once a permit is held, within the solve timeout. Requests never modify shared hosted-case state. Legacy solve-stream and sensitivity fallbacks that cannot carry custom settings are refused rather than silently using defaults.
WebMCP exposes inspect_settings, update_settings, reset_settings, and run_calculation. Inspection defaults to calculation settings; use scope: "display" for browser preferences or field to inspect one calculation-setting descriptor. Calculation mutations require case_id, expected_revision, and settings_revision; display mutations require the preference revision. update_settings accepts patch and optional calculation. Updates and resets do not solve. run_calculation explicitly uses the selected settings and requires a fresh case/settings binding. Saved Study views remain read-only. The existing solve_multiconductor_pf tool and its max_iterations argument remain available.
Backend URLs, asset locations and application branding remain embedding configuration rather than user preferences.
RMS dynamic simulation
tellegen::rms simulates electromechanical (RMS, phasor-domain) dynamics. A
PSS/E .raw case is paired with its .dyr dynamic data; PowerIO reads the
.dyr records through typed PSS/E schemas and links them to the case’s
generators; tellegen initializes every machine from the AC power flow,
integrates the network and device equations, applies events, and records the
trajectories.
The boundary
| Layer | Owns |
|---|---|
| PowerIO | .dyr parsing (loss-preserving), typed model views (typed_model), PSS/E machine and circuit ids, ZSORCE, linking records to generators (DynamicStudy::machines()) |
tellegen (tellegen::rms) | model equations, initialization, the DAE integrator, events, small-signal analysis, live sessions, the JSON front door (simulate_module_json, inspect_module_json) |
A .dyr file is attached to a case explicitly; nothing reads one implicitly.
Cargo features
Neither is a default feature of the tellegen crate.
rms(impliessensitivity): the engine, its initialization from the AC power flow, the integrator, the models validated against PowerSimulationsDynamics.jl, events and recording, and the JSON front door (simulate_module_json,inspect_module_json).rms-experimental(impliesrms): the less validated product layer: controller block graphs (RmsSimulation::with_models), small-signal analysis (RmsRequest::small_signal,linear_analysis), live sessions, checkpoints and replay, packed result buffers, DYR parameter editing, the model library and dynamize, andtellegen::case_edit. Without it a request for small-signal analysis or checkpoints is noted in the result and skipped. The request and result types have the same fields under both features (RecordSpec::checkpoint_step,RmsResult::checkpoints), so turning onrms-experimentalbreaks no code written againstrms. Small-signal analysis (a denseO(n³)eigensolve) runs only when a request asks for it (small_signalis false by default).
Julia is not a dependency. PowerSimulationsDynamics.jl is the reference the equations are translated from (BSD-3, see third-party notices) and the validation reference (RMS validation).
Models
| Role | PSS/E models |
|---|---|
| Machine | GENCLS, GENROU, GENROE, GENSAL, GENSAE |
| Exciter | SEXS, ESAC1A, EXST1 |
| Governor | TGOV1, GAST, HYGOV |
| Stabilizer | IEEEST |
| Renewable plant | REGCA1 + REECB1 + REPCA1 (WECC generic converter, electrical and plant control) |
| Loads | each load’s static law (constant power, ZIP, exponential), or one law for every bus |
RmsSimulation::with_options (with graphs, with_models_and_options) takes RmsOptions, fixed for that simulation
only: whether renewable plants are simulated (the default) or held at their
power flow output, whether the initialization enforces reactive limits (the
default), the loads’ low-voltage behaviour, PowerSimulationsDynamics.jl
0.16.2’s low-voltage gain and saturation in place of the PSS/E ones (for
comparing with that tool), and whether step matrices are factorized by blocks
(the default) or as one sparse LU.
Initialization
The initialization starts from the static study’s AC power flow, with the
generators’ reactive limits enforced (PV→PQ switching), so the dynamic run
starts where the static study is. A generator bus released at a limit starts
there, its voltage off the setpoint; the notes name each such bus with its
reactive power and the voltage difference. RmsOptions::reactive_limits = false holds every generator at its setpoint whatever reactive power that
takes, as PowerSimulationsDynamics.jl does; the notes then name each bus whose
reactive generation exceeds its limits, and by how much. A generator that
regulates a remote bus holds its terminal at the case’s voltage instead (the
static AC power flow refuses remote regulation). Each machine is then solved
for its states and references so every derivative vanishes and it injects its
power flow current: ‖f(x0)‖∞ is below 1e-8 on every shipped case
(RmsSimulation::initial_residual). The exciter and governor steady states
are checked against their limits, as PowerSimulationsDynamics.jl does at
initialization. SEXS’s field voltage and ESAC1A’s regulator voltage VA are
their non-windup lags’ states clamped to EMIN/EMAX (VAMIN/VAMAX), as in
PSS/E, so a step that carries the state past a limit does not pass the
overshoot on (PowerSimulationsDynamics.jl applies the state itself). A
dispatch that needs one beyond its limits still rests there, as in
PowerSimulationsDynamics.jl (the non-windup lag holds a state it is pushing
further out): that unit’s clamp is widened to its starting value, and a note
names the unit, the limit and the value. With TE = 0 (TA = 0) the lag is
algebraic and cannot rest past its limit, so that breach fails as below. No steady state exists when the
dispatch needs ESAC1A’s VR beyond VRMIN/VRMAX, EXST1’s voltage error
beyond VIMIN/VIMAX or its field voltage beyond VT·VRMIN − KC·Ifd/VT·VRMAX − KC·Ifd, a TGOV1 or GAST
valve beyond VMIN/VMAX, GAST power above AT, or a HYGOV gate beyond
GMIN/GMAX. Then the initialization fails with an error that names the unit,
the limit and the value.
Loads
With LoadModel::PowerFlow (the default) each load keeps the law the AC power
flow solved it with: the constant-power part, the ZIP constant-current and
constant-impedance parts, and exponential loads, the decomposition of
load_voltage. A part with exponent γ and power P0 at the power flow
voltage V0 draws P(V) = P0 (V / V0)^γ (a ZIP part c (V / v_nom)^γ is
c (V0 / v_nom)^γ (V / V0)^γ), as the current I = (P − jQ) V / |V|²; the
constant-impedance parts enter the admittance matrix. At t = 0 the loads
draw exactly the power flow demand. ConstantImpedance, ConstantCurrent and
ConstantPower are a global override: the whole bus demand at V0 follows
that one law (PSS/E CONL with all of P and Q in one class).
Below a breakpoint the parts with γ < 2 (constant power, constant current,
exponential loads with γ < 2) draw the constant admittance of their power
there, P(V) = P(V_b) (V / V_b)², as PSS/E converts constant-power loads
below PQBRAK: RmsOptions::low_voltage_load is Break { v_break: 0.7 } by
default (PSS/E’s default PQBRAK; a bus starting below it breaks at its own
V0). The power is continuous at V_b and the current falls linearly to zero
with the voltage, where an unconverted constant-power load would draw an
unbounded current. Exact keeps every law down to 20 % of V0 (below that, a
smooth floor keeps the current’s direction defined at 0 V), as
PowerSimulationsDynamics.jl does. The power drawn by the loads of each bus is
recorded as pl:<bus> and ql:<bus>.
Following PowerSystems.jl, a generator without a machine record, or a
GENCLS with zero inertia, is a Thevenin source behind its ZSORCE (an
infinite bus); a missing exciter holds the field voltage and a missing
governor the mechanical torque. Records of other models are kept and named in
the run’s notes, not simulated.
A renewable plant whose unit carries all three of REGCA1, REECB1 and
REPCA1 is simulated (rms/renewable.rs, a translation of
PowerSimulationsDynamics.jl’s RenewableEnergyConverterTypeA,
RECurrentControlB and Active/ReactiveRenewableControllerAB, with every
flag combination it implements). Its states, the converter currents, the
REECB1 voltage filter and reactive current state and the REPCA1 filters and
integrators, are recorded as inv.<state>:<unit>. Where PowerSimulationsDynamics.jl
0.16.2 departs from the PSS/E definition, tellegen follows PSS/E: the
low-voltage active current gain between Lvpnt0 and Lvpnt1, and Xc in the
compensated voltage, the converter ramp limits as rates on the currents, and
the high-voltage reactive current clamp (Khv, Iolim). A unit
with other inverter records, or without the plant controller, keeps its power
flow output as a constant-current injection; so does a plant whose REECB1
or REPCA1 regulates another bus (IREG), which the controllers do not
measure. The notes say which.
Limits in the dynamic data must be ordered (each minimum at most its maximum,
HYGOV’s VELM not negative, REGCA1’s Zerox below Brkpt and Lvpnt0
below Lvpnt1): a generator’s swapped limits refuse the case with the unit
and parameters named, and a renewable plant’s hold the plant with a note.
A renewable plant whose power flow output lies past a controller limit
(REPCA1 Qmin/Qmax or Pmin/Pmax, REECB1 Pmin/Pmax, Qmin/Qmax or
Vmin/Vmax, the current limits or the LVPL ceiling), or whose terminal lies
below Lvpnt1 or above Volim with Khv > 0 so the converter injects another
current than the power flow’s, has no steady state there: it is held at its
power flow output, with a note naming the limit and the value.
A controller can also be a block graph (BlockGraph: lags with and without
non-windup limits, lead-lags, washouts, second-order filters, PI, integrators,
sums, gains, products, limits), given with RmsSimulation::with_models for
one exciter, governor or stabilizer slot of a unit. template turns a typed
PSS/E record into the graph of the same model, so a graph starts from a
validated model.
What a run records
By default a run records every channel at every output step: two per bus (four
at a bus with load), four per branch and about eight per unit. A request’s record (RecordSpec)
narrows that without coarsening anything:
channels: the watch set, recorded at the full output step (keys such asomega:2178, or prefixes ending in:such asomega:). The values are bit-identical to a full recording’s.frameswithframe_step: further channels at their own step, exact samples.checkpoint_step: the full state every so many seconds, with what the integrator carries from step to step.RmsSimulation::replayruns the same request from a checkpoint and records any other channel after the fact: the samples are the run’s, bit for bit.
A live session (RmsSimulation::live) advances on demand and takes events at
its current time; it reproduces a batch run of its event log. It takes the
same watch set (set_record) and gives any channel at its current time
(snapshot).
Screening
RmsSimulation::screen(request, result, criteria) gives a finished run a
verdict against versioned criteria (ScreeningCriteria, version 1 by
default; every field can be changed), from the run’s own samples. It needs
omega:, delta:, vm: and va: recorded (RecordSpec::display() records
them) and names any that are missing.
- Centre of inertia (COI). Per island, the machines in service weighted
by
H · MBASE; a tripped machine leaves the COI from its trip, and each island formed by the events is screened on its own COI. An island holding a voltage source (an infinite bus) is referred to the source. - Pole slip. A machine whose rotor angle relative to its island’s COI passes ±180°: Unstable, loss of synchronism, naming the unit and time.
- Island runaway. An island whose COI speed ends more than 0.05 pu from 1: Unstable, island frequency runs away.
- Settling. COI frequency within ±0.01 Hz of its final value and the largest angle separation within ±1° over the last 2 s, which must follow the last event; otherwise Inconclusive.
- Voltage recovery. Every live bus at or above 0.8 pu within 1 s of the last event; a miss is reported as a voltage concern.
- Reported figures. COI frequency nadir and peak, RoCoF over a 0.5 s
window, the largest
|δ − δ_COI|(the figure the pole-slip criterion reads), the largest angle separation from the first event on (pair, time) next to the steady-state separation before it, the first swing (per machine, the largest excursion ofδ − δ_COIfrom its value before the first event up to its first peak after the last event), the lowest unit speed and bus frequency, the lowest voltage and the final voltage range. - Swing trend. From the peaks of the separation’s distance to its final value after the last event, counting only peaks above 0.5° and above 10 % of the largest distance (smaller wiggles are numerical): decaying or growing when the last three counted peaks each shrink or grow by more than 2 %, damped out when the last peak is below that floor and within the settling criterion’s angle band, sustained when three or more peaks count, the last among them, without a monotone trend, otherwise undetermined (too few counted peaks to tell).
derived_series gives coi:omega, coi:delta, coi:f and f:<bus>, each
bus’s frequency estimated as f0 (ω_ref + (1/ω0) d(va)/dt) with the
derivative through a 20 ms first-order filter (the PSS/E FRQ convention),
held over the sample at each event and below 0.2 pu, and NaN while the bus is
dead.
These are screening criteria chosen by tellegen, not a planning standard.
In the browser
tellegen-wasm exports RmsCase (features rms, and rms-experimental for
modes, default dynamics and DYR parameters): prepared once from a stored
module and DYR text, inspected without a run, checked with a flat run, and run
with the display channels, packed channel-major into one Float64Array with
the screening in a JSON head. The bus angles are replaced by the bus
frequencies; a run past 4e6 values records at a coarser output step and says
so. @tellegen/engine runs it in a dedicated worker (openRmsCase,
BrowserRmsCase, see Engine API Reference); the app’s
Dynamics mode is built on it.
Linear analysis
RmsSimulation::linear_analysis linearizes M ẋ = f(x, u) at the operating
point. Modes are the eigenvalues of M_d⁻¹ (J_dd − J_da J_aa⁻¹ J_ad) with
participation factors |v_ki w_ik|; algebraic states with an all-zero row and
column in J_aa are dropped first, as PowerSimulationsDynamics.jl does.
Frequency responses solve the descriptor system at each frequency, so no
algebraic elimination is needed.
Formulation
The state is [Vr; Vi; device states] with M ẋ = f(x): the bus rows are the
algebraic current balance in rectangular coordinates, each machine works in its
own dq frame, and the control blocks keep their time constants in M, so a
zero time constant makes a state algebraic. The reference frame is the speed of
a dynamic machine at the slack bus, or the synchronous frame when a source
holds it. Each step solves the implicit trapezoidal rule with Newton’s method
(device Jacobian blocks by forward differences with the step
1e-7 · max(|x|, 1) rounded to the step actually taken, the network and load
blocks exactly). The rule is of second order: halving a 4 ms step quarters
the difference to the next finer run (tests/rms_physics.rs; on a
single-machine line trip, 3.3e-5 rad of rotor angle from 4 to 2 ms, 8.2e-6
rad from 2 to 1 ms), so the default 2.5 ms step is within about 2e-5 rad of
the converged trajectory there. That holds for a trajectory on which no
limit switches. A limiter, non-windup bound or rectifier that switches inside
a step is not located in time, so through such a switch the error no longer
falls with the step: on a 0.1 s fault at the same unit through half its line
reactance, which drives its exciter to the ceiling, the rotor angle of runs
at 5, 2.5, 1 and 0.5 ms lies 1.4e-4, 8.3e-5, 7.0e-5 and 6.8e-5 rad from a
0.05 ms run, and through a twentieth of it 6.2e-4, 2.4e-4, 1.5e-4 and 1.4e-4
rad (sexs_field_voltage_never_passes_emax in tests/rms_physics.rs). The step is fixed: there is no local error estimate or step-size
control. A run takes at most 1e7 steps (t_end / dt), with dt ≥ 1e-6 s.
The step matrix is factorized by blocks where every unit is a machine: each
unit’s states are eliminated onto its bus by a small dense LU, and a sparse LU
(faer) factorizes the network with a 2 × 2 contribution per unit and the frame
speed as a bordered column; otherwise the whole matrix goes to one sparse LU.
Both solve the same system. A factorization is reused while the step size, the
method and the topology are unchanged. An event is applied at its exact time
and the algebraic variables are re-solved with the differential states held.
The Newton iteration is damped (backtracking on the residual): a step that
does not lower the residual is never taken; the iteration refactorizes, and if
a fresh factorization finds no descent either, the step falls back to backward
Euler, then halves, so rectifiers and limiters that switch inside a step (an
ESAC1A with KC ≠ 0 chattering at its bounds) do not stop a run. A limit a
state slides along (a PI output held at a limit while its proportional path
pulls inside, the REGCA1 active current on its rising low-voltage power limit)
is written so the state’s rate is continuous there, and every implicit step
has a solution. When a step still fails, the error names the variable with
the largest residual.
Events are checked before a run starts: each needs a finite time in
[0, t_end), and more than a billionth of a step before t_end (an event at
t_end would act on nothing the run records), an
element the system has (judged in time order, as the run applies them), a
fault impedance with r ≥ 0 and x ≥ 0, and a load scale ≥ 0, or the run
is refused with the event named. A run ends exactly at t_end: when t_end
is not a whole number of output steps, the last output interval is shorter.
An output step of more than 10⁷ integration steps is refused.
After a topology event, an island apart from the reference bus that keeps a
synchronous machine or source is named in the run’s events: it runs at its
own frequency (renewable plants there measure the reference’s frequency, as
PowerSimulationsDynamics.jl’s FixedFrequency does, so an island fed by one
can run away). An island left with only inverters or held units, the
reference bus’s included, has nothing to hold its voltage: those units trip
and its buses go dead. When the
integration fails with the network split, the error names the islands.
Known limitations
- Loads are static: no induction motor or composite load models, and no frequency dependence.
- Remote voltage regulation is held at the case’s terminal voltage, not solved (the static AC power flow refuses it).
- Step size is fixed (see Formulation), and switching limiters are not located inside a step.
- HVDC lines are not modelled: a case with an in-service HVDC line is refused (the static AC power flow holds them as fixed injections).
- Islands run on (see Formulation); there is no under/over-frequency or overspeed protection, so an island without load accelerates without bound (WECC 240 with transformer 1004-1034 open: bus 1034’s units reach 1.9 pu speed in 9 s).
- Inverter-based resources other than the
REGCA1+REECB1+REPCA1plant (for exampleREECA1,WTGT*) are not modeled: such a unit keeps its power flow output as a constant-current injection, named in the notes. Voltage-dip freezing (Vdip,Vup,Vfrz) and a plant controller’s remote branch flow are not modelled, as in PowerSimulationsDynamics.jl, nor is remote voltage regulation by a plant (IREG; such a plant is held). - Models outside the table above are preserved by PowerIO and named in the notes, not simulated.
- Trajectories have no PowerIO value yet.
Differences from the PSS/E Model Library
Where PowerSimulationsDynamics.jl 0.16.2 departs from the PSS/E definitions, tellegen follows PSS/E for:
- the REGCA1 low-voltage active current gain between
Lvpnt0andLvpnt1(unlessRmsOptions::psid_lv_gain) andXcin the compensated voltage; - the REGCA1 ramp limits
Rrpwr,Iqrmax,Iqrminas rates in pu/s on the converter currents (unlessRmsOptions::psid_converter_ramp, which limits theTglag’s error instead: an effective rampRrpwr/Tg, 500 pu/s forRrpwr = 10,Tg = 0.02 s); - the REGCA1 high-voltage reactive current clamp: above
Volimthe injected reactive current falls byKhv (V − Volim), down toIolim(PowerSimulationsDynamics.jl adds the term and ignoresIolim); - the SEXS field voltage and the ESAC1A regulator voltage
VA: the non-windup lag’s state clamped to its limits, so a step that carries the state pastEMAX(VAMAX) does not pass the overshoot to the machine (PowerSimulationsDynamics.jl applies the state, which then rests past the limit while the input pushes further; a unit that starts past it keeps that rest, see Initialization); - the IEEEST output cut-off:
VCUandVCLeach ignored only when it is zero (PowerSimulationsDynamics.jl ignores both when either is); - a non-windup lag with a zero time constant (SEXS
TE, ESAC1ATA, REGCA1Tg, REECB1Tpord): algebraic, its output the clamped input; - exciter saturation points in either order (IEEE 421.5 lists
E1 > E2); - the non-windup PI (HYGOV, REPCA1, REECB1): its integrator stops only while
its input drives the output further past a limit, and integrates as soon as
the input points back inside (PowerSimulationsDynamics.jl stops it whenever
the output is limited, so with
Kp = 0it never leaves the limit). Near a limit the integrator’s outward rate is capped at(limit − y)/(Ki τ),τ= 1 ms, so an output sliding along the limit has a solution (the same for the REGCA1 low-voltage power limit below); - quadratic saturation
B (x − A)²/xwithSe = 0forx ≤ A(unlessRmsOptions::psid_saturation; the formula alone rises again belowAand diverges asx → 0); - an ESAC1A’s rectifier current
IN = KC Ifd / VEwithVEfloored at 1e-3, so it stays finite asVEcollapses, andTBas the lead-lag’s mass, soTB = TC = 0bypasses it; - constant-power and constant-current loads below
PQBRAK(see Loads; unlessLowVoltageLoad::Exact); - the initialization with reactive limits enforced (unless
RmsOptions::reactive_limits = false); - an ESAC1A with
TR = 0: no transducer lag (PowerSimulationsDynamics.jl substitutes 1 s); - a washout (rate feedback) with
T = 0: the block is off.
It follows PowerSimulationsDynamics.jl, and so differs from PSS/E, in:
- the REECB1 reactive current PI with
QFLAG = 1, which has no limit; - the placement of the REGCA1 low-voltage power limit (
LVPLSW = 1): the active current ismin(Ip, LVPL)andIpstops rising at the ceiling (PSS/E limits theTglag itself, so after a faultIprecovers from the ceiling atRrpwr).Ipholds above the ceiling; below it, where PowerSimulationsDynamics.jl switches the rate ofIpto zero at the ceiling, tellegen caps the rising rate at(LVPL − Ip)/τ,τ= 1 ms, soIpcan ride a recovering ceiling (with a switched rate no implicit step has a solution there).
A fault needs a finite, nonzero impedance; a bolted fault is a small reactance.
Dynamics in the app
The app’s Dynamics mode runs the RMS (electromechanical) engine of RMS dynamic simulation in the browser: what the machines, exciters, governors and renewable plants of a case do in the seconds after a fault, a trip or a load step. Switch to it with Steady state | Dynamics in the header, the Dynamics panel button, or the command palette (“Open Dynamics”).
Opening a dynamic case
Dynamics needs PSS/E dynamic data (.dyr) for a balanced case opened from a
file:
- WECC 240 demo. The Dynamics panel’s first button (or the palette command “Open WECC 240 dynamics demo”) opens the reduced 240-bus WECC system with its dynamic data and bus coordinates. Sources and licences are on the Credits page.
- Your own case. Drop a
.rawwith its.dyr(and a geographic file if the case has no coordinates). A.dyrdropped alone attaches to the active case; a second one replaces the first after a confirm. A.txtthat reads as DYR is taken as one.
Attaching initializes the simulation from the AC power flow, once. The panel
then reports what was linked (machines, renewable plants, units held at their
power-flow output, voltage sources, DYR records), the initial residual
‖f(x₀)‖∞, which unit’s speed turns the angle reference frame, and a
flat-start check: a 2 s run with no events. A case at rest drifts by less
than 1e-6 pu in speed; more is shown as “the case is not at rest; results
include that drift”. The engine’s notes are listed verbatim, grouped.
Dynamics uses the case as loaded: steady-state demand and rating edits are not included, and the panel says how many there are.
Events
Select a bus or branch on the map, or type a bus number in the Network panel’s bus lookup, and pick an action in the Network panel:
| Selection | Action | What runs |
|---|---|---|
| Bus | Apply a fault here | a bolted three-phase fault (j1e-4 pu) at 1.0 s, cleared after 6 cycles of the base frequency |
| Bus with load | Step load ±% | the bus’s load scaled at 1.0 s |
| Bus with units | Trip (per unit) | the unit disconnected at 1.0 s |
| Branch | Trip circuit | the circuit opened at 1.0 s (parallel circuits are listed) |
| Branch | Fault on this line | a fault 1 % from the chosen end, cleared by opening both ends of the line |
Each event is a sentence in the panel with its time and clearing time (cycles or milliseconds) editable in place. Up to 16 events; each is checked as the engine checks it before a run, and an engine refusal is shown verbatim.
Validated scenarios (WECC 240 only) are the four runs of RMS validation. Choosing one also sets that study’s options: constant-impedance loads, PowerSimulationsDynamics.jl’s renewable low-voltage gain, saturation and converter ramp, exact load law, no reactive limits at initialization, a 5 ms step and 20 s, on the network with the study’s load values. The run then carries the badge “Validated scenario: matches PowerSimulationsDynamics.jl 0.16.2 within 3.2e-6 pu speed, 1.2e-5 pu |V|”. Change any of that and the badge says which settings differ instead.
Running
Duration (5–120 s), step (2.5 ms standard, 5 ms fast, 1 ms fine) and the load model are in the Run section; Advanced holds the low-voltage load law, reactive limits at initialization, held renewable plants and the PowerSimulationsDynamics.jl comparison switches. Run (Ctrl/Cmd+Enter) starts the run in its own worker with a progress bar; Stop ends it at once without touching steady-state results. The last three runs stay as chips.
Reading the result
- The map plays the run back: bus voltage magnitude on a fixed scale (neutral 0.97–1.03 pu, amber to maroon as voltage sags, lavender to purple above 1.05 pu), rings at generating buses whose size grows with the machine’s speed deviation (teal below nominal, magenta above, grey for held units), the faulted bus while the fault is on and opened branches. The legend’s “What am I looking at?” explains it for a first visit.
- The timeline plays, pauses (Space), steps (←/→, Shift for 100 ms),
jumps between events (
[/]) and slows to 0.25× around each event. After a run it plays from half a second before the first event; with reduced motion it waits one cycle after it. Its accessible value reads the time, the time since the last event in cycles, the system frequency and the lowest voltage. - Traces: Frequency (centre of inertia in bold, the five buses with the lowest frequency, the range of all bus frequencies), Rotor angles relative to the centre of inertia (the three largest swings highlighted), Voltages (range of all buses, faulted buses, 0.8 and 0.9 pu lines) and Loads. Hovering a trace highlights its bus on the map; clicking pins it and selects the bus. Drag to zoom. “Show as table” lists the shown traces every 0.5 s.
- The verdict leads with an icon and a word: Stable, Unstable: loss of synchronism, Unstable: island frequency runs away, Inconclusive: not settled, or Run failed at t (with the engine’s message). The rows below state each figure with its criterion; see Screening.
Screening criteria are tellegen’s own, versioned (tellegen-rms-screening-1)
and stated in the card: they are not a TPL-001 or WECC planning assessment,
and no protection, under-frequency load shedding or motor loads are modelled.
Experimental tools
Settings → Experimental → Show experimental dynamics tools adds, with an Experimental label on everything they affect:
- Modes: eigenvalues of the system linearized at the operating point, plotted against frequency with 5 % and 10 % damping rays, and the states that take part most in each mode. The analysis is dense: WECC 240 (1,658 states) takes about 8 s natively and many minutes in the browser; Stop ends it.
- Add default dynamics for a case without
.dyrdata: typical models from published unit data, stamped “Synthetic dynamic data: typical parameters, not the owner’s”.
Agents
The simulate_dynamics WebMCP tool runs the same simulation for an agent and
answers with the verdict and its figures; see WebMCP.
RMS validation
The RMS engine is validated against PowerSimulationsDynamics.jl 0.16.2, an open-source tool, in the time domain. The validation runs as tests:
| Test | Cases | Data | Runs |
|---|---|---|---|
tests/rms_psid_validation.rs | single-machine cases built from WECC 240 (the renewable plant included) | ships with the code | always |
tests/rms_psid_validation.rs | WECC 240, four 20 s scenarios | ships with the code | release profile (just rms-validation; ignored in debug) |
tests/rms_validation.rs | PowerSimulationsDynamics.jl’s PSS/E benchmark cases (test/benchmarks/psse) | case data repository ($TELLEGEN_CASE_DATA) | where the data is |
No closed-source tool’s output is used. The tests need the rms feature;
just rms-test runs the RMS suite in debug, just rms-validation every
validation in release (CI runs both). The comparisons simulate what
PowerSimulationsDynamics.jl simulates where tellegen’s defaults differ
(RmsOptions with reactive_limits: false, psid_saturation: true,
psid_converter_ramp: true, low_voltage_load: Exact; one helper,
tests/support/psid.rs, for both test files), so they compare like with
like.
The per-quantity bounds below are regression bounds: about three (single
machines) or two (WECC 240) times what tellegen showed in the validation
study, so a change to the trajectories shows. Every run also meets two fixed
physical tolerances on every machine’s speed and rotor angle against the
reference: |Δω| < 1e-4 pu (6 mHz at 60 Hz, below governor deadbands) and
|Δδ| < 0.5° (small against the swings a transient stability study judges).
The largest differences are 2.1e-6 pu and 0.0076° on the single machines,
3.2e-6 pu and 0.013° on WECC 240.
Single-machine cases from WECC 240
One case per model combination of WECC 240 (tests/support/smib.rs): the first
in-service unit with the combination, with its DYR records, dispatch, MBASE,
ZSORCE and voltage setpoint, on the one-machine infinite-bus system of the
PowerSimulationsDynamics.jl PSS/E benchmarks (two parallel lines scaled with
MBASE to the unit). Two events each: one line opens at 1.0 s; a three-phase
fault at the unit through half its line reactance from 1.0 to 1.1 s.
The reference is PowerSimulationsDynamics.jl’s mass-matrix model with Rodas4
at reltol = abstol = 1e-8 (1e-6 where it does not solve at 1e-8).
tellegen runs at a 1 ms step. Every machine channel (vm, va, omega,
delta, pe, qe, efd, tm; angles relative to the infinite bus) must
stay within three times the difference of the validation study at 1 ms:
| Models | Event | Largest |V| difference (pu) | Largest relative difference |
|—|—|—|—|
| GENROU, SEXS, TGOV1 | trip | 1.5e-7 | 7e-6 (pe) |
| GENROU, SEXS, TGOV1 | fault | 7.8e-6 | 2e-3 (efd) |
| GENROU, SEXS, GAST | trip | 1.5e-7 | 8e-6 (pe) |
| GENROU, SEXS, GAST | fault | 7.7e-6 | 2e-3 (efd) |
| GENROU, SEXS, HYGOV | trip | 1.7e-8 | 5e-6 (va) |
| GENROU, SEXS, HYGOV | fault | 2.1e-7 | 3e-5 (pe) |
| GENROU, SEXS, GAST, IEEEST | trip | 1.3e-6 | 2e-4 (efd) |
| GENROU, SEXS, GAST, IEEEST | fault | 3.3e-6 | 6e-4 (efd) |
| GENROU, SEXS, HYGOV, IEEEST | trip | 4.5e-5 | 7e-4 (efd) |
| GENROU, SEXS, HYGOV, IEEEST | fault | 1.7e-6 | 3e-5 (efd) |
| GENROU, SEXS, TGOV1, IEEEST | trip | 5.0e-6 | 3e-4 (efd) |
| GENROU, SEXS, TGOV1, IEEEST | fault | 3.0e-6 | 6e-5 (efd) |
The differences at 1 ms are tellegen’s step error: at 0.1 ms they shrink by one to two orders of magnitude.
The renewable plant (REGCA1 + REECB1 + REPCA1) is compared against
IDA with dtmax = 0.1 ms on its voltage, angle and ten states, in three
events: the line trip and a shallow fault (through 8 times the line
reactance) keep its voltage above the low-voltage gain range, so they check
tellegen’s own (PSS/E) plant; a deep fault (through 1/8 of it) passes that
range and runs with PowerSimulationsDynamics.jl’s gain. Its network-side
powers are not compared, since PowerSimulationsDynamics.jl 0.16.2 derives
them in post-processing.
WECC 240
The system of PowerSimulationsDynamics.jl’s tutorial (PowerSystemCaseBuilder
“WECC 240 Bus”): the raw and dyr files of this repository with the loads as
that system stores them, constant power at the solved voltage, with its 37
renewable plants (REGCA1 + REECB1 + REPCA1) set, for this comparison, to
PowerSimulationsDynamics.jl’s low-voltage active current gain. The reference
is its residual model with IDA (dtmax = 1 ms). Four scenarios over 20 s:
- the tutorial’s event, a trip of line 1101–1401 at 1.0 s;
- a trip of Palo Verde unit 1431 N (2355 MW) at 1.0 s;
- three-phase faults at bus 1032 (through j0.05 pu) and at bus 1101 (through j0.01 pu), 1.0 to 1.1 s.
tellegen runs at its 5 ms step on its own double-precision network. Compared are, every 100 ms, the channel with the largest difference of every quantity in the validation study (bus angles relative to bus 3933, rotor angles to unit 1032 C, a tripped unit up to its trip):
| Quantity | Largest difference | Where | Bound |
|---|---|---|---|
| bus |V| (pu) | 1.2e-5 | bus 1131, fault at 1101 | 3e-5 |
| bus angle (rad) | 5.1e-5 | bus 1034, unit trip | 1e-4 |
| machine speed (pu) | 3.2e-6 | 1032 G, fault at 1101 | 7e-6 |
| rotor angle (rad) | 2.2e-4 | 3133 NG, fault at 1101 | 5e-4 |
| machine P (pu, 100 MVA) | 3.8e-3 | 1431 G, unit trip | 8e-3 |
| machine Q (pu, 100 MVA) | 1.2e-3 | 1131 G, fault at 1101 | 3e-3 |
| mechanical torque (pu) | 3.4e-6 | 1032 C, fault at 1101 | 7e-6 |
| field voltage (pu) | 5.3e-4 | 6533 C, fault at 1101 | 1e-3 |
| plant states (pu) | 4.3e-5 | 1032 S, fault at 1032 | 1e-4 |
The response of the whole system, from every machine speed and rotor angle and every bus voltage on the 10 ms grid (a tripped unit up to its trip):
| Quantity | Largest difference | Bound |
|---|---|---|
| lowest machine speed (pu) | 5.5e-7 | 1.2e-6 |
| highest machine speed (pu) | 5.9e-7 | 1.2e-6 |
| mean speed at 20 s (pu) | 3.1e-10 | 1e-9 |
| largest rotor angle swing (rad) | 2.4e-5 | 5e-5 |
| lowest bus voltage (pu) | 6.9e-6 | 1.5e-5 |
| lowest bus voltage at 20 s (pu) | 1.3e-6 | 3e-6 |
PowerSimulationsDynamics.jl’s PSS/E benchmark cases
tests/rms_validation.rs runs every case of PowerSimulationsDynamics.jl’s
test/benchmarks/psse in tellegen and compares every channel the two tools
share. The cases and PowerSimulationsDynamics.jl’s results on them are data,
read from $TELLEGEN_CASE_DATA/rms_validation and
$TELLEGEN_CASE_DATA/psd-reference/refs.
- Stage A (single-machine ladder and the IEEE 14-bus system): every shared channel within 1e-3.
- Stage B (the remaining cases, one model each): the same comparison, reported.
| Case | Models | Largest difference |
|---|---|---|
smib_gencls | GENCLS (infinite bus), GENCLS | 3.1e-4 |
smib_genrou | GENCLS (infinite bus), GENROU | 4.8e-4 |
smib_gensal | GENCLS (infinite bus), GENSAL | 1.8e-4 |
smib_genrou_sexs | GENCLS (infinite bus), GENROU, SEXS | 4.8e-4 |
smib_genrou_esac1a | GENCLS (infinite bus), GENROU, ESAC1A | 1.3e-4 |
smib_gensal_exst1 | GENCLS (infinite bus), GENSAL, EXST1 | 1.3e-4 |
smib_genrou_sexs_tgov1 | GENCLS (infinite bus), GENROU, SEXS, TGOV1 | 4.8e-4 |
smib_genrou_esac1a_gast | GENCLS (infinite bus), GENROU, ESAC1A, GAST | 1.3e-4 |
smib_genrou_sexs_hygov | GENCLS (infinite bus), GENROU, SEXS, HYGOV | 4.8e-4 |
smib_genrou_sexs_ieeest | GENCLS (infinite bus), GENROU, SEXS, IEEEST | 1.1e-4 |
ieee14 | GENROU, ESAC1A, GAST | 1.3e-4 |
omib_gencls (B) | GENCLS | 3.1e-4 |
genrou, genrou_nosat, genrou_highsat (B) | GENCLS, GENROU | 4.8e-4 to 5.8e-4 |
genroe, genroe_highsat (B) | GENCLS, GENROE | 5.1e-4 |
gensal (B) | GENCLS, GENSAL | 5.1e-4 |
gensae (B) | GENCLS, GENSAE | 1.2e-4 |
sexs, sexs_note (B) | GENCLS, GENROU, SEXS | 6.2e-4, 1.2e-3 |
esac1a, esac1a_sat (B) | GENCLS, GENROU, ESAC1A | 2.9e-3, 1.1e-2 |
ieeest, ieeest_filter (B) | GENCLS, GENROU, SEXS, IEEEST | 2.5e-4, 1.2e-4 |
tgov1 (B) | GENCLS, GENROU, ESAC1A, TGOV1 | 1.2e-3 |
gast (B) | GENCLS, GENROU, ESAC1A, GAST | 1.2e-3 |
hygov (B) | GENCLS, GENROU, SEXS, HYGOV | 6.2e-4 |
load_constant_power, load_constant_current (B) | GENCLS, GENROU | 3.1e-4, 2.8e-4 |
tvc_exst1 (B) | GENCLS (infinite bus), GENSAL, EXST1, HYGOV | 1.1e-2 |
Every single branch trip of the IEEE 14-bus system runs to completion
(ieee14_every_branch_trip_completes). After the trip of line 1-2 the slack
machine’s ESAC1A (KC = 0.2) chatters between its rectifier and limiter bounds;
a damped Newton iteration handles it, and the run agrees with
PowerSimulationsDynamics.jl to 7.8e-4 in voltage and 5e-5 in speed
(ieee14_line_1_2_against_psd).
Findings
Tripped branch flows. After a trip, PowerSimulationsDynamics.jl’s branch-flow post-processing still evaluates the opened line’s pi model (about 0.53 pu); tellegen reports zero. Those channels are not compared.
GENSAE electrical power. PowerSimulationsDynamics.jl 0.16.2 computes the
GENSAE stator current in post-processing with the GENSAL formula
(post_proc_generator.jl): its pe at t = 0 is 3.49 pu against a power flow
dispatch of 1.0 pu. tellegen’s pe is 1.0, and its delta and branch flows
agree with PowerSimulationsDynamics.jl to 1e-4.
ESAC1A field voltage with KC ≠ 0 (IEEE 14-bus). PowerSimulationsDynamics.jl
reports Efd(0) = 0.540 for machine 1, but Xad·Ifd on its own initial states is
1.2596, which steady state requires Efd to equal; tellegen’s Efd(0) is 1.2596.
The machine dynamics are unaffected: delta, omega and |V| agree to 1e-6.
ESAC1A field forcing (esac1a, esac1a_sat). During the forcing at
t ≈ 1.2–1.5 s the field voltage differs from PowerSimulationsDynamics.jl by up
to 1e-2. Refining tellegen’s step tenfold changes it by 1e-3 and moves it away
from the reference, so the difference comes from the reference’s IDA
tolerances at the non-windup switching.
Transports
The transport boundary is the line between a host app and the tellegen engine.
Browser Wasm
@tellegen/engine ships the browser wasm transport today. It wraps the wasm-pack output from crates/tellegen-wasm and exposes direct functions plus browserWasmTransport.
Use this transport when cases should stay local to the browser. Dropped case
files are parsed in WebAssembly, and solves, Study.preview, Study.commit,
and sensitivity requests run there as well. No case text or PowerIO module
leaves the browser unless the host app sends it.
The wasm instance lives in a dedicated Web Worker, so a multi-second solve never blocks the page. When the browser cannot run a module worker the same requests execute on the calling thread instead; the API is identical either way.
The transport has one wasm package carrying parsing, all solves, Study,
capabilities, and generalized sensitivity requests.
The loader is lazy. Host apps can call preloadEngine() to control when the browser downloads and initializes wasm.
HTTP
The hosted demo also uses HTTP for bundled case metadata and native server fallback paths. That server is a demo consumer, not a requirement for using @tellegen/engine.
An HTTP transport can implement the same shape as EngineTransport: parse or
fetch a PowerIO module, call a native module solve endpoint, keep a server side
study handle, and return the same generated TypeScript types.
That transport is optional for apps that need server sized cases, audit logs, or native deployment.
Tauri
The desktop and mobile path can use the same transport contract with a Tauri command layer. The UI keeps the Study workflow; only the call boundary changes from browser wasm to native commands.
The Rust types stay the source of truth. New transports should return the generated SolveResponse, ProblemCaps, and sensitivity matrix shapes instead of defining parallel types.
Getting Started
Repository Layout
apps/web/: private SvelteKit hosted democrates/: the tellegen engine and its wasm, server, CLI, and benchmark adapterspackages/engine/: public@tellegen/enginebrowser packagepackages/svelte/: public@tellegen/sveltecomponent packageexamples/browser-minimal/: minimal downstream Vite exampleexamples/svelte-minimal/: minimal Svelte example using the component packagescripts/: data staging and docs build helpersdeploy/: deployment compose files and proxy notesdocs/src/: mdBook documentation source
Prerequisites
- Rust from
rust-toolchain.toml, includingrustfmt,clippy, and thewasm32-unknown-unknowntarget - Node.js 22 or newer
wasm-pack0.15.x for browser WebAssembly builds- mdBook 0.5.x for local documentation builds
tellegen backend
cargo run -p tellegen-server
Set TELLEGEN_ALLOW_FALLBACK=1 to run without staged demo data:
TELLEGEN_ALLOW_FALLBACK=1 cargo run -p tellegen-server
WebAssembly Module
npm ci
npm run wasm
npm run build:engine
npm run build:svelte
tellegen frontend demo
npm ci
npm run wasm
npm run build:engine
npm run build:svelte
npm --workspace tellegen-frontend run dev
The Vite dev server proxies /api to http://localhost:8000. apps/web
resolves @tellegen/svelte through its built dist/, so build:svelte must
run before the dev server starts.
Framework Packages
Preview the package contents before publishing:
npm run pack:engine
npm run pack:svelte
Use @tellegen/svelte for the map, panels, local file flow, and solve card. Use
@tellegen/engine for apps that want case parsing and browser solves without
the tellegen UI. The hosted app is a private demo workspace that consumes
@tellegen/svelte like another Svelte app would.
Data
The ACTIVSg and CATS distributions are downloaded by the operator and are not
vendored. With the distributions under ~/Datasets:
scripts/stage-data.sh ~/Datasets
The script stages any complete case pairs it finds into data/. The backend
serves the staged subset; if nothing is staged, it exits unless
TELLEGEN_ALLOW_FALLBACK=1 is set. That fallback serves two pglib cases with
synthetic coordinates for CI and local smoke checks.
Docs
Install mdBook, then build the public docs:
scripts/build-docs.sh
CI pins mdBook to v0.5.3. For local work, any recent mdBook 0.5.x release
renders the book.
Local Case Files
Dropped case files stay in the browser. The current public demo does not upload
local .m, .raw, .aux, .epc, .pwb, .dss, .pwd, .csv, .json,
or .geojson files.
MATPOWER .m, PSS/E .raw, PowerWorld .aux/.pwb, and PSLF .epc files
describe balanced network topology; OpenDSS .dss opens the multiconductor
viewer. If a balanced case includes complete coordinates, tellegen draws it
directly. Otherwise it creates a local synthetic layout and asks the user to
place it on the map. PowerIO classifies dropped JSON by content. A stored
PowerIO IR (pio-ir) document opens by its value type: a balanced network or
DC OPF instance becomes a case, while supported multiconductor networks,
instances, and solutions open in the viewer. AC PF and AC OPF instance modules
retain their declared calculation and original problem definition. AC PF is
available in the ordinary browser build; AC OPF solving requires the
experimental worker.
Without that worker, AC OPF instances can be viewed but cannot be solved.
Transmission exchange JSON opens as a balanced case, and BMOPF or
PowerModelsDistribution documents open the multiconductor viewer. The retired
bare model-JSON shape is unrecognized; regenerate it from source data as
pio-ir. Tellegen does not define a separate saved case format. Other
unrecognized JSON falls through to the geographic reader.
After a parsed local case has coordinates, either from the file, a geographic file, or manual placement, tellegen solves the selected formulation in browser WebAssembly. Local case files do not call the tellegen backend solve endpoints.
Builds with PowerIO collection support also offer ZIP and folder imports. The chooser preserves shared paths, lets you select independent cases, and retains completed imports if another selection fails. Imported collection cases keep their saved calculation settings and wait for an explicit calculation. Switching tabs does not start a solve. The standard build hides these optional controls; individual case files continue to open normally.
Manual Placement
For case files with no coordinates, such as a plain case14.m, tellegen
computes a deterministic topology layout from buses and in-service branches. The user then
clicks the map to center that synthetic layout at the chosen location.
The placed local case can be moved later with the case panel move action. The first version uses explicit click placement rather than drag movement.
After placement, the local case enters the same bus selection and demand slider workflow as the bundled demo cases. The solve card reports the browser solve time and does not show backend iterations.
Geographic Files
Some case files contain network topology but keep map coordinates in separate
GIS files. tellegen accepts those files as local geographic files: drop the case file
with one or more .csv, .json, or .geojson files, or drop the geographic files
after selecting a parsed local case.
All files stay in the browser. The tellegen backend does not receive dropped case files or geographic files.
Parsing is powerio’s GeoLayer tolerant reader, running in WebAssembly: it
accepts headerless OpenDSS buscoords CSV, CSV and JSON records with the aliased
field names below, and GeoJSON Point/LineString features, and it rejects
input carrying no usable coordinates. Applied coordinates land on the network
itself (Bus.location, Branch.route), so a saved PowerIO case module or an
exported case carries the placement on screen. Loading that module starts a
fresh runtime Study at the saved point. Its history records transformations
applied to the stored value. The case panel can also download the current
layout as a .geo.json layer that PowerIO and Tellegen read back.
Bus Coordinates
The geographic file must identify buses by the same ids used in the case file. CSV and JSON records can use these field names:
| Meaning | Accepted fields |
|---|---|
| Bus id | bus_i, bus, bus_id, bus number, number, id |
| Latitude | lat, latitude, y |
| Longitude | lon, lng, longitude, x |
Example:
bus_i,Lat,Lon
1,37.77243572,-122.2429162
2,37.77848161,-121.6259513
A geographic file does not need to cover every bus: matched buses place, and
the panel reports the matched and unmatched counts. Buses left without
coordinates are omitted from the map with a warning; a file that matches
nothing is rejected and the case stays placeable. Records can also match by
powerio row uid (buses:3) or by case insensitive bus name.
Branch Paths
Branch geometry is optional. Without branch paths, tellegen draws straight segments between placed buses.
CSV and JSON branch records can use:
| Meaning | Accepted fields |
|---|---|
| Branch id | branch, branch_id, branch number, cats_id, id |
| From bus | f_bus, from, from_bus, bus_from |
| To bus | t_bus, to, to_bus, bus_to |
| Endpoint coordinates | Lat1, Lon1, Lat2, Lon2 and lowercase variants |
GeoJSON LineString features are also accepted. The reader matches a route by
uid or branch id when present, then by the unordered from/to bus pair. A
LineString endpoint can also provide bus coordinates for its f_bus and
t_bus properties. Applied routes land in Branch.route and render as
polylines instead of straight segments.
Piecewise Costs
A dropped case with MATPOWER model 1 piecewise linear generator costs solves the declared convex curve exactly (formulations). Malformed rows and rows with decreasing segment slopes are rejected before a solve.
Display Files
PowerWorld .pwd files supply drawing positions and branch paths. Drop one
with its case or attach it to the explicitly selected case. Tellegen reports
matched buses, matched routes, and unmatched objects. A file with no supported
equipment positions returns an error.
Drawings use a plain canvas with pan, zoom, and fit controls. Geographic files use the map. When both are supplied, Map and Diagram select the view; neither replaces the other. A later attachment to a demo case creates a local copy and preserves its current edits and result.
Supported New England PWB files include geographic bus locations. Their RAW revision 33 companions lack those records and need a matching geographic sidecar. Arbitrary drawing positions are never treated as latitude/longitude.
ZIP and folder case collections
These controls require the optional collection build (the tellegen-wasm
powerio-collections feature). The ordinary build hides collection controls
and continues to accept individual case files. Hosts can query collectionSupported() from
@tellegen/engine before offering ZIP or folder acquisition.
Drop a ZIP onto Tellegen, choose it with Open a case file, or use Open folder. Folder drops preserve relative paths. Each ZIP has its own namespace: a missing OpenDSS include cannot be supplied by another uploaded archive.
The chooser lists candidate paths and formats before parsing. Select the cases you want and choose Import selected cases. Several masters may share the same topology or profile files, and a MATPOWER or JSON comparison case remains independently selectable. Identical circuit names do not hide their source paths. Import does not run every discovered case. Close the chooser to inspect a case and choose its calculation.
Successful imports remain available when another selection fails or you cancel the remaining work. Missing dependencies are reported separately from malformed cases and solver restrictions. Distribution cases show their existing snapshot power-flow capability and the reason when they are view-only. Transport success does not enable unsupported controls, load laws or transformer models.
Use Choose a nonstandard entry or document group for an unusual master suffix or a format that needs an explicit choice. XML is not assumed to be one CGMES network: choose XIIDM for independent networks, or explicitly group the profiles belonging to one CGMES case. GO problem/solution grouping is likewise explicit. Nested transport ZIPs are not recursively flattened; extract them and open the folder. Format-owned native ZIPs can be selected with their reader format. Unsupported structural values, such as time series in a snapshot-only view, are reported rather than flattened.
Files are read locally. PowerIO owns discovery, dependency resolution and electrical parsing; no OpenDSS commands are executed by the browser and no missing file is fetched from the host or network. Geographic sidecars are not attached to every case in a mixed archive. Import first, select the intended case, and attach its geographic file using the existing sidecar workflow.
The chooser limits one batch to 4096 members and 64 MiB of uploaded/expanded file bytes, at most 32 ZIP uploads and 32 selected imports per operation. ZIP members have a 200:1 expansion-ratio limit. PowerIO also bounds inspection and cumulative parser input work; repeated operations can exhaust a session budget. Decoded electrical models may use more memory than their source files. Parsing is serial. Cancellation terminates the collection worker; on a synchronous fallback it discards the result when the current operation returns.
While the chooser is open, Download original ZIP returns the exact uploaded bytes. Export selected source ZIP makes a new archive with an explicit scope: selected members alone, or the entire permitted project (which can include other cases). A single master by itself need not be a complete project. Closing the chooser releases source collections. Imported PowerIO modules retain structured source origin and diagnostics but do not embed the archive; saving and restoring a module does not restore an original-ZIP download.
OpenDSS snapshot power flow
Qualified OpenDSS imports can run Studies → Run power flow after import. Existing typed module and BMOPF solving remain available under the same validation rules. The initial profile covers normalized finite sources with grounded references, explicit conductor impedances, bounded ZIP and exponential loads (including OpenDSS voltage bands and ZIP dropout), and supported finite-leakage transformers. An explicit fourth neutral conductor is supported. Source-defined load bounds always take precedence over the optional solver envelope; disabling that option does not remove the source model’s own voltage bounds.
Passive definitions, profiles and monitoring records remain in the module. This is a fixed equipment snapshot: daily/yearly simulation, control execution, and an OpenDSS script’s sequence of solves are not run. Active regulator/control objects, unresolved geometry or dependencies, floating source references, generator/IBR injections, voltage-dependent loads without a nominal voltage, general three-winding transformers, and unqualified transformer settings remain view-only with a reason. Convergence and operating voltage-limit compliance are reported separately. A runnable model can still fail to converge.
Data Provenance
The demo cases are synthetic grids from TAMU ACTIVSg and CATS. They are fictional networks built on geographic footprints. ACTIVSg200 and ACTIVSg500 coordinates come from PowerWorld aux exports. ACTIVSg7000 and CATS coordinates come from GIS bus CSVs. These positions are not surveyed infrastructure locations.
| case | territory | buses | branches | files |
|---|---|---|---|---|
| ACTIVSg200 | central Illinois | 200 | 245 | case_ACTIVSg200.m + ACTIVSg200.aux |
| ACTIVSg500 | South Carolina | 500 | 597 | case_ACTIVSg500.m + ACTIVSg500.aux |
| ACTIVSg7000 | Texas | 6717 | 9140 | Texas7k_20210804.m + Texas7k_lat_long.csv |
| CATS | California | 8870 | 10823 | CaliforniaTestSystem.m + CATS_buses.csv + CATS_lines.json |
The MATPOWER file feeds the DC OPF. For ACTIVSg200 and ACTIVSg500, the aux file
supplies the coordinates. For ACTIVSg7000, the bus coordinate CSV supplies
latitude and longitude. Operators download the ACTIVSg distributions from
electricgrids.engr.tamu.edu and stage
them with scripts/stage-data.sh; the repository does not vendor them.
CATS comes from the
WISPO POP CATS repository.
The server reads CaliforniaTestSystem.m for the network, CATS_buses.csv
for bus latitude and longitude, and CATS_lines.json for branch paths. The
staging script also copies CATS_gens.csv when present; the current map does
not render a separate generator geometry layer.
Aux coordinates
PowerWorld aux exports have used two coordinate layouts:
- ACTIVSg complete case exports repeat substation latitude and longitude on each
bus row in
Latitude:1andLongitude:1. - Later exports can leave the bus latitude and longitude columns empty and
reference the
Substationtable throughSubNumber.
PowerIO promotes the bus columns (Latitude:1/Longitude:1) into the typed
Bus.location at parse; tellegen keeps the two fallbacks upstream does not
cover — bare Latitude/Longitude bus columns and the Substation table join
— so dropped files using either layout resolve when the data is present.
Buses Sharing Coordinates
Multiple buses can share one substation coordinate. tellegen spreads each group on a deterministic ring of about 400 m around the substation point, ordered by bus id. The group remains visually associated with the substation at network zoom, and individual buses remain hoverable at street zoom.
Explicit Fallback
The embedded fallback (deployment) serves two PGLib cases whose coordinates are synthetic and labeled as synthetic.
Prepared generator costs
The Texas7k demo selects Tellegen’s reusable convex quadratic/linear fitting option. It fits each piecewise curve by least squares and retains a linear fit when the quadratic fit is nonconvex or singular. Other demo cases keep their declared costs. Model details retain the source and prepared cost rows and report RMS and maximum errors at the source breakpoints.
All four configured cases must load and solve for the deployment health check to pass. Unavailable cases remain in the catalogue with an explanation.
Synthetic generation inputs
Generated grids read the populated places table shipped with
tellegen-synth: GeoNames cities5000 (CC BY 4.0), 69,999 places of 5,000
people or more with name, position, population and country, derived by
scripts/derive-populated-places.py. Every place sizes and spreads demand; a
transmission-only grid sites its buses on the places of 50,000 people or more,
or on every place when a region has none that large. Generated buses are
labelled with coordinate provenance synthetic. OpenStreetMap mode reads the
Overpass answer the caller fetched and labels its buses source. Its
electrical parameters and loads are modelled, so its buses and lines are
mapped, not surveyed. See
Synthetic Grid Generation.
Data sources
Every table the generator ships names its source and the SHA-256 of the file
it was derived from, and the generation report repeats them under
provenance, so a host can show where each figure came from without a table
of its own.
| Table | Source | Licence | Report field |
|---|---|---|---|
data/populated_places.json | GeoNames cities5000 and countryInfo (geonames.org) | CC BY 4.0, attribution required | provenance.places (source, source_sha256, count, sha256) |
data/national_demand.json | Ember, Yearly Electricity Data, through Our World in Data’s energy dataset (demand and population) | CC BY 4.0 | provenance.demand_table (source, licence, year, sha256, source_sha256, peak_factor) |
data/country_areas.json | Natural Earth v5.1.2, 1:50m admin-0 countries | Public domain | provenance.demand_table (areas_sha256, areas_source_sha256) |
data/voltage_ladders.json | National transmission operators’ and regulators’ documents, the ENTSO-E members list and IEC 60038, cited per entry; copies no dataset | Compiled for tellegen | provenance.voltage_table (version, sha256) |
data/subnational_demand.json, data/subnational_fuel_mix.json | EIA-861, EIA-860 and the US Census Bureau’s state population estimates | Public domain (US government works) | context.demand_by_subdivision, context.fuel_mix_basis |
| OpenStreetMap mode | The Overpass answer the caller fetched (power=* features) | ODbL 1.0, © OpenStreetMap contributors | provenance.osm (document_sha256, elements, timestamp_osm_base, copyright) |
The country_areas.json keys are Natural Earth’s ADM0_A3, and the places
table carries the same code, so every lookup across the tables agrees.
Geographic data and drawings
Electrical case files describe equipment and operating values. Geographic and
drawing files describe where to display that equipment. Tellegen uses PowerIO’s
GeoLayer for both, keeping the coordinate system explicit.
GeoJSON, CSV, and AUX files can supply geographic bus positions and line routes. PowerWorld PWB files can also contain geographic bus locations. PowerWorld PWD files supply drawing positions and polylines. A drawing appears on a plain canvas; geographic coordinates appear on the map.
Drop companion files together, or select a case before attaching another file. The attachment report lists matched equipment and unmatched objects. A later attachment to a demo creates a local copy, preserving current demand changes, line capacities, and the current result. No unrelated recent case is selected.
When a case has both geographic data and a drawing, use Map or Diagram to choose the view. Save a Study to retain both layers, line paths, and the current camera position. Drawing coordinates stay in their source units.
Shared GeoJSON
A GeoLayer uses a FeatureCollection with Point and LineString features. The
powerio_geo member records geographic, projected, drawing, or unknown
coordinates. Equipment matches by stable identity, source ID, name, or branch
endpoints. BMOPFTools bus_from and bus_to names are accepted.
PowerIO reads the proposed BMOPFTools embedded bus[id].geo and line[id].geo
values. Explicit BMOPF output retains geometry under extras.geojson, which
is permitted by the currently identified draft schema. This supports edited
coordinates without claiming that the Task Force has approved new schema fields.
Download geography exports geographic positions and routes. Download drawing exports the selected drawing as a GeoLayer. Both can be reopened by other PowerIO consumers.
Routes across the antimeridian
Geographic route coordinates are stored with longitudes in [-180, 180].
tellegen-synth writes every bus location and branch route vertex that way.
A route that crosses ±180 is not split at the seam, so two consecutive
vertices can sit almost 360° apart: a line in Chukotka may run from 179.6 to
-179.7.
A map consumer draws the short hop between consecutive vertices. When two longitudes differ by more than 180°, move the second by a whole multiple of 360° until they differ by 180° or less, and measure the next vertex from the moved value. Joined as stored, that segment runs the long way round, and a route near ±180 appears to span the whole world.
@tellegen/svelte does this in its route layers on the flat map and on the
globe, in the selected-branch outline, and when it frames a selected branch.
The moved longitudes are for drawing only. Saved modules and exported GeoJSON
keep the stored values.
Transmission diagrams
Balanced (transmission) cases open as a single-line diagram. Single-line diagram beside the map’s zoom buttons (Diagram on a phone), or beside Fit diagram for a case drawn in diagram coordinates, or Show diagram in the network panel, replaces the map with a canvas; Show map or Close returns to the map at the view the diagram showed. The diagram opens at the map’s view when that shows the case at a useful size, and otherwise fits the case into the space the panels leave free. While the diagram is open, the network panel’s LMP, angle and demand buttons say they apply to the map and to the diagram’s Map display view; the diagram’s own key explains the other views.
Geographic
The diagram first draws the case on its own positions: geographic coordinates over the map’s basemap, or drawing coordinates as given. Zoomed out, the largest generators and the transformers stay findable as fixed-size landmarks, placed by priority so the view never fills with markers. Closer in, transformers are drawn on their branch as two interlocking circles, each winding in the colour of the voltage on its side, generators and loads hang below their bus, and buses are named. Out-of-service branches are dashed. The colour of a conductor or busbar fills the whole stroke, with a thin casing a shade darker so pale colours keep an edge against paper and the basemap. Colour carries the data, so it takes the stroke’s area: small marks need larger colour differences to be told apart. Busbars are heavier than branch conductors.
Loads use the same demand-arrow shape as the multiconductor schematic, with a filled triangle in a quiet grey: nearly every bus has load, so loads are context rather than the result. They appear with the full equipment detail. Generators use the shared machine-circle glyph in symbol ink and appear a step earlier. Both can be clicked or tapped to select their bus, and both fade with buses outside a highlighted voltage level. A bus with generation and load draws the symbols side by side, with visible connections back to the bus.
Voltage levels
The key lists the case’s own nominal voltages, highest first: “500 kV”, “230 kV”, “161 kV”. It holds at most six entries. A case with more levels merges adjacent levels into ranges, cheapest merge first, where a merge costs the voltage ratio it spans weighted towards higher levels; so closely spaced low levels merge first (“115–138 kV”, generator terminals as “13.2–13.8 kV”) and the highest levels stay distinct longest.
On a map any two lines can touch, so colour alone reliably separates only a few classes. Each level is therefore drawn with three cues together:
- hue by tier: magenta from 300 kV, blue from 100 kV, cyan from 35 kV, and neutral grey below. The three hues stay distinguishable from each other, and from the warning, violation and selection colours, under the common colour-vision deficiencies. When two of a case’s levels fall in one tier and a lower hue is unused, the lower level takes that hue, so the main levels differ in hue: ACTIVSg200’s 230 and 115 kV draw blue and cyan, 500/230/115 kV magenta, blue and cyan. Hues only move down, and never back up as voltage falls; 345/138/115/69 kV keeps 115 kV a lighter blue because 69 kV needs cyan;
- shade within a tier, darker for the higher level;
- width by rank, heaviest for the highest level.
The key groups the levels under their tier’s name, whatever hue they draw in. Hovering a level in the key keeps it and fades the others; clicking keeps it highlighted. Zoomed out, levels below the top three fade so the backbone reads first.
Results
On desktop the toolbar shows Voltage levels, Operating limits, OPF economics, Power transfers and Map display as tabs; arrow keys move between them. On phones, the labelled View selector lists all five views without a clipped horizontal tab strip. The layout selector, fit and zoom controls remain beside Display, which reveals basemap, shading and PNG export options. These settings start closed to leave room for the network. A view that needs a result explains what is missing instead of being disabled.
Each result view starts with what the available data supports. Operating summaries report how many lines and buses were checked, and distinguish missing flows from unknown rating metadata. Missing voltages or limits prevent an all-clear summary. Out-of-service and diagnosed de-energized equipment are excluded from checks. A checked voltage is compared with its available source bounds; this is not a guarantee about limits absent from the case.
Economics reports the range of supplied prices without inferring thermal binding status from price differences or uniformity. If constraint metadata is absent, its status is explicitly unavailable. Transfers distinguish absent results, a previous calculation’s retained result, missing flows and confirmed zero active power. A largest transfer is qualified as being among reported flows when other branch flows are missing.
Details expands the summary to show settings, lists and explanations; Summary collapses it again. Key and settings, Loading, binding and marginal relief explained, and MW, MVAr and MVA explained can be opened by touch or keyboard. Hover definitions remain available as shortcuts. A documentation link accompanies the expanded explanation.
Prices are in objective units per MW: the units of the case’s generator costs per hour. MATPOWER files give costs in $/h, so for them this is $/MWh; payloads do not carry a currency, so the diagram does not claim one. The diagram opens on Operating limits. AC power flow and AC OPF show solved voltage magnitudes and branch utilization together, independent of the map’s LMP or demand setting. DC shows utilization and explicitly states that voltage magnitudes are not solved. SOCWR is labelled as a relaxation.
Voltage uses a fixed 0.90–1.10 pu scale and each bus’s source bounds. Downward blue and upward red markers identify lower and upper violations, including uniform violating series. Shading (on by default) shades the area around the network by where each bus voltage sits in its own band: clear in the middle half, blue towards the minimum and brown towards the maximum, at full strength at a limit. Shading interpolates bus values in drawing space; it is not a measurement at every point on the map. Low- or high-voltage regions show by area before any number is read (Overbye et al., IEEE TPWRS 2003, found contours gave the fastest violation detection). Substation borders preserve the worst member violation. A station summary retains minimum and maximum values with bus identities, and links to the worst bus; it never substitutes an average.
Branches below the warning threshold are thin and grey. Branches from the warning up to and including the rating are wide and amber, and overloaded branches wider still and red. Stressed branches are drawn on top of the others, so they stay visible at the case overview. Key and settings exposes the warning threshold (0–99%, default 90%), remembered in browser storage. Local gauges show 0–125% with a visible 100% tick; their labels are not clamped to the gauge range. A leader joins each gauge to the middle of its branch. A heavy amber outline marks operation at the rating and a filled red gauge an overload, so the state does not rest on hue alone. Violations, warnings and selection receive priority when the view is crowded; a gauge moves around its branch to find space before it is left out. Gauges can be selected by mouse, touch or keyboard. Close in, static chevrons show active-power direction.
DC utilization is absolute MW over the effective MW rating; AC utilization is the larger end’s
apparent MVA over its MVA rating. Unknown ratings and synthesized DC bounds are faded and omit
equipment-percentage gauges. Out-of-service lines stay dashed, while diagnosed de-energized
buses are excluded from voltage extrema and violations. Display comparisons allow 1e-5 pu
voltage and 1e-5 fractional loading tolerance; these do not change solver feasibility.
At-rating operation does not establish economic binding or enforcement.
Open Exceptions to search voltage violations and loading exceptions by equipment ID. Voltage violations are ordered by distance beyond the case bound. Loading exceptions are ordered by overload, at rating and warning, then by utilization. Separate counts show how much voltage and loading data is unknown.
Hovering or focusing a row in a result list highlights its equipment on the diagram. Hover equipment for a preview. Select an exception or an item on the diagram to keep the equipment details visible. Frame brings the equipment into view. Clear or Escape clears the selection. The inspector shows the bus voltage and source bounds, solved generation, modeled demand and installed capacity. For branches it shows each available endpoint MW and MVAr value, the basis and effective rating, the limiting end and remaining capacity. When one end supplies the other, a sentence states the flow in words (“555 MW flows from bus 189 to bus 187”). Positive endpoint flow enters the branch from that bus. Values are rounded for reading: per-unit voltage to four decimals, percentages to one, and MW, MVA, MVAr and prices to about three significant figures. Hover a value for its exact figure. Missing quantities are marked unavailable.
The key retains formulation, solver status and freshness. Calculations in progress and errors identify retained results as potentially stale; legacy payloads without status say it is unavailable. These are base-case displays and do not establish contingency security.
Voltage levels preserves nominal kV identification in its own colour view. Nominal kV labels and tooltips remain available in operating mode, where transformer strokes stay neutral so nominal-voltage colours do not compete with result colours. Map display retains the map’s selected series; uniform economic or demand series use neutral grey. PNG export includes the operating gauges, result context and station range.
OPF economics
Choose OPF economics to see total locational marginal prices in objective units per MW. The default price scale is 0–50, with wider and signed presets. The scale stays fixed as results change, and values outside it use the end colours. A uniform price has a single numerical readout. When prices differ, Shading shades the area around the network by each bus’s distance from the median LMP: blue where power is cheaper and brown where it is dearer. The full-strength distance is the largest in the result, but at least 5% of the median or one price unit, so small spreads stay faint. The shading shows relative price differences, not their cause, and interpolates between buses. It uses a different reference from the bus colours, which keep the fixed absolute scale.
A wide purple branch identifies a binding DC thermal limit with positive marginal relief; other branches stay thin and grey. The binding list orders limits by the objective reduction from one more MW of symmetric rating. Select a branch to frame it and see the thermal status and exact equipment values. The final solver program supplies enforcement and binding independently of equipment utilization. If it used a synthesized solver bound, the inspector labels it.
Solved interface and other linear constraints list their bounds, value and signed shadow price, with links to branch members where available. The sign describes the objective reduction for an increase in the signed limit. AC OPF and SOCWR can show total LMP where supplied. SOCWR stays labelled as a relaxation, and the view marks unsupported or legacy constraint data as unavailable.
Loading is not marginal value
These quantities answer different questions:
| Readout | What it establishes | What it does not establish |
|---|---|---|
| 100% utilization | The reported flow reaches the effective rating, within display tolerance. | Whether the solver enforced that rating. |
| Binding constraint | An enforced limit is reached, within reporting tolerance. | Whether relaxing it would reduce optimal cost. |
| Positive marginal rating relief | Increasing the rating has a positive local rate of cost reduction. | That the actual flow will rise by the same amount, or that a large upgrade has this constant value. |
For example, an enforced line limit can sit at 100% with zero marginal relief. Another line at 100% can have relief of 20 objective units/MW: a small increase in its rating then has an estimated cost benefit at that local rate. The second line is purple; both can appear in the binding list. Changing the display warning threshold changes neither the optimization nor these values. Equal bus prices alone do not identify a unique marginal generator. Different prices can reflect constraints, separate islands, and, for AC, losses; interpret them with the reported constraint data rather than diagnosing a cause from colour alone.
Nominal kV identifies the voltage level. pu compares a solved voltage with that nominal value: 1.00 pu is nominal and 0.95 pu is 5% below it. MW is active power; MVAr is reactive power. Both contribute to MVA, the apparent power used for the AC equipment-loading check.
Power transfers
Choose Power transfers to see active power moving through the network. Blue line width shows the larger reported endpoint |P| in MW on a bounded square-root scale. The default cap is 500 MW, with 100 MW and 1,500 MW presets. Static chevrons follow the local direction of the route when one end supplies the other. Grey distinguishes a reported zero from faded missing flow. Red gauges and the Overloads list retain the independent rating check in percent.
Use Largest active transfers or select equipment on the diagram to inspect signed endpoint values. Positive flow enters the branch from the named bus. The lossless DC view gives equal and opposite endpoint MW. AC and SOCWR show both reported active and reactive values, and omit a through-direction arrow when the two ends supply the branch. Bus details separate solved generation where supplied, model demand including committed edits, and installed capacity.
Summary and Details collapse the results panel to its summary (the view, its counts and scale) and expand it again. The price-scale selector is hidden in the collapsed economics panel. It starts collapsed on a phone, where it would cover much of the diagram, and opens when equipment is selected.
On phones, the toolbar and voltage-key controls have 44-pixel touch targets, and the renderer allows a wider picking radius. Explicit zoom buttons supplement pinch zoom and the keyboard. The results key stays below the toolbar when it wraps. The equipment and voltage keys can be collapsed, and scroll within the available height. Tapping a symbol selects its bus and opens the same details used on desktop; information is also available through search and the panels.
Schematic
Schematic switches to a substation overview laid out in the engine. Each substation is a box with one busbar per bus, the highest voltage on the left, and the transformers between its busbars. Every connection has its own row in the box, so lines leave from the side facing the substation at their other end without overlapping. Substations sit at, or as near as space allows to, their geographic position, and substations in dense areas are drawn smaller, so the overview stays registered to the basemap: switching between the two layouts moves each bus from its geographic point into its substation. Lines run through the gaps between substations, spaced apart, and step around any substation in their way. Each substation is named once, at the corner of its box; closer in, its busbars carry their voltage.
A case without coordinates is placed on the map by a synthetic layout that says nothing about the grid. Its schematic lays the substations out by their connections instead: sparse stress (Ortmann, Klimenta and Brandes 2017) on the graph of substations, so substations a few lines apart are drawn near each other, fitted into the same frame as the synthetic positions. ACTIVSg2000 from its MATPOWER file lays out in about 30 ms, ACTIVSg70k in a little over a second.
The method follows Birchfield and Overbye (2018): independent substation interiors, greedy placement at the free point nearest each substation’s position, and line routing through the channels of a Delaunay triangulation of the substations. The layout evidence records its quality and speed: ACTIVSg200 lays out in under a millisecond with no overlapping substations and no line crossing another substation; 70,000 buses take about a third of a second.
Substations
The engine groups buses into substations from the strongest evidence a case offers:
- substations declared by the source: PowerIO voltage levels (CGMES, XIIDM, RAWX, PSS/E) or a
PowerWorld
SubNum; - buses at exactly the same coordinate (ACTIVSg buses carry their substation’s coordinate);
- the two ends of a transformer, unless both are located more than 2 km apart;
- the two ends of a bus-splitting jumper: a branch between buses at one voltage whose reactance is under a tenth of the case’s typical line, likewise unless more than 2 km apart, and only while the group stays under 32 buses.
Two buses declared in different substations are never joined by the weaker rules, and any bus none of them joins is a substation of its own. A branch is a transformer when PowerIO says so (a tap or phase shift) or when its ends have different nominal voltages. The grouping is a drawing aid, not an electrical claim.
Network payloads carry the result: NetworkBus.base_kv, NetworkBus.substation (an index into
Network.substations) and NetworkBranch.transformer. Each substation has a stable key
(sub:<declared id> or bus:<lowest bus id>), a name when declared, the rule that grouped it
(source) and its distinct voltages (kv). Cases without coordinates group by transformers and
jumpers: ACTIVSg200 from its MATPOWER file gives the 111 substations its aux file declares, its 23
jumpers having a fifteenth of the median line’s reactance.
Engine API
txSchematicLayout(input, options) in @tellegen/engine (tellegen::tx_schematic natively)
lays out the columns of a network: substation per bus, nominal kV, branch ends, service status and
seed positions. It returns bus positions, busbars, substation boxes, routed segments and each
branch’s role (line, inside a substation, or out of service), in the units of the seeds.
seeding: "stress" lays substations out by their connections rather than their positions;
route_iterations: 0 draws lines straight. txGraph and txLayoutInput in @tellegen/svelte
build the input from a Network.
Equipment models and DC networks
Equipment opens a searchable, keyboard- and touch-accessible inventory. It is available in every diagram view. The panel distinguishes a device’s source state, input settings and the selected formulation’s treatment. Its scroll area stays inside the screen, including at 320 CSS pixels.
| Equipment | Visual language | Calculation treatment |
|---|---|---|
| Transformer | Two winding circles | Fixed ratio and phase shift |
| PST | Winding circles with a regulation arrow | Identified by explicit phase-control metadata, including at zero angle; setting remains fixed |
| Capacitor bank / reactor | Separate capacitor plates / coil | Individual source shunts, including zero-output and out-of-service banks; fixed admittance |
| Mixed admittance | Generic shunt symbol | Conductance and susceptance remain distinct |
| Three-winding transformer | Three winding circles | One source device mapped to three analysis branches and an internal star bus |
| SVC | Distinct symbol and explicit label | DC omits reactive controls with a diagnostic; AC rejects active SVCs |
| Storage | Distinct symbol and explicit label | Active devices rejected by the ordinary formulations |
| Switch | Open or closed contact and state label | Open contacts disconnect; closed contacts require topology reduction |
| Reduced HVDC | Two converter boxes and a labeled DC connection | Fixed terminal injections in DC PF/DC OPF/AC PF; rejected in AC OPF/SOCWR |
| Detailed DC | Separate node/branch/converter graph | Source connectivity, with a qualified solver when sufficient data exists |
A nonzero transformer phase angle alone does not identify a PST. A fixed winding connection can introduce phase shift too. Tap positions, step tables and source regulation settings are retained as input metadata; their presence does not mean an automatic regulator is running. Shunt B is shown in Mvar at 1 pu: positive B supplies reactive power and negative B absorbs it. At voltage V pu, the reactive contribution is B V². The AC-network DC approximation omits reactive power.
The symbols use familiar single-line conventions and redundant text/state labels. They are not a claim of compliance with a particular IEC 60617 symbol variant. No breaker arrangement, pole arrangement or earth return is inferred from a reduced two-terminal HVDC link. Equipment strokes are included in the main diagram’s PNG export; the separate detailed-DC inspector is not part of that canvas export.
Detailed DC calculation
Expand Detailed DC network for actual source connections. Node dots denote junctions; crossings without dots do not. Unknown or disconnected terminal state is explicit. AC synchronous islands are never joined by introducing an AC branch for a DC connection. Source import diagnostics remain available under Import coverage, including omissions reported by readers.
Solve DC network uses explicit positive/return converter terminals, resistive
DC lines, nodal current balance and Pac = Udc Idc + a + b |Idc| + c Idc².
Units are kV, kA and MW. Positive Pac is withdrawal from the AC bus; negative Pac
supplies the AC bus. The explicit engine API also accepts power, current, voltage
and linear MW/kV droop controls. Every connected component needs a potential
reference and appropriate voltage regulation. Missing references, singular or
conflicting controls, nonpositive resistance and nonfinite parameters fail with
an error. The current dense solver is limited to 512 variables.
The source adapter qualifies VSC records with explicit connected terminals, polarity, AC-bus mapping, control targets, loss coefficients and a solid ground. It supports source VSC DC-voltage and active-power controls, and LCC DC-voltage, active-power and DC-current controls. LCCs require an explicit rectifier/inverter mode and fixed-power-factor reactive model. It refuses calculated commutation models, ambiguous source droop units, valve-current relations, DC switching or series-device reduction and missing parameters. It never fills unknown losses with zero. Back-to-back connections need no artificial DC line; a shared DC network can have two, three or more converters and radial or meshed wiring.
Numerical convergence and equipment feasibility are separate. Results list the bounds actually checked, unspecified bounds and violations. A converged point with missing ratings is not an all-clear. Point-to-point tests use the analytical quadratic voltage solution; multi-terminal tests independently check power/loss balance, reverse flow, outages, control loss and finite-difference sensitivities.
For imported local cases, Solve with AC power flow applies solved converter
Pac and Q to the original AC network. A VSC can hold fixed Q or regulate its AC
bus voltage by varying Q within stated min/max limits or a piecewise-linear
capability curve evaluated at the solved Pac. Positive Q is AC absorption.
These are PowerIO’s detailed VoltageSourceConverter records. The IIDM
VscConverterStation reduced-HVDC model has a different setpoint convention and
must not be used to infer a sign flip for this record. The pinned PowerIO reader
preserves detailed XIIDM setpoints and curves, and CGMES targetQpcc and
VsCapabilityCurve; Tellegen evaluates P coordinates and Q bounds consistently
in PCC withdrawal convention. See the detailed IIDM converter API.
Asymmetric Q bounds and nonzero P coordinates are covered by regression tests.
At a Q limit the controller holds that limit and reports the missed voltage
target (PQ behavior); it does not falsely report successful voltage regulation.
Competing generator/converter voltage controllers are rejected.
An LCC with fixed power factor absorbs Q = |Pac| tan(acos(pf)) at both ends.
The rectifier/inverter mode constrains its active-power direction. Losses are
still explicit in the DC balance. This is a steady-state load-flow approximation,
not a valve/commutation model: firing/extinction-angle targets are rejected.
See the PowSyBl load-flow model
for the same distinction between converter controls and outer regulation loops.
Dispatch AC generation runs AC-network DC OPF with fixed converter injections; it does not calculate AC voltage magnitudes or Q. Optimize joint AC/DC dispatch uses the separate optional nonlinear backend. Converter active-power targets become bounded dispatch variables, while DC voltage/current schedules remain constraints. The model includes AC nodal P/Q balances, generator cost and limits, branch limits, DC KCL, resistive line losses and converter losses in one nonlinear problem. VSCs retain fixed-Q or hard AC-voltage schedules; an incompatible voltage schedule and Q limit can make the OPF fail. Joint OPF requires explicit converter P/DC-voltage bounds and min/max VSC Q capability. P-dependent Q curves are currently rejected in joint OPF. Taps and shunt sections stay fixed; this is not a mixed-integer OPF. A converged local optimum is not a global-optimality certificate. Independent AC power-balance checks and a separate DC power-flow solve validate the returned operating point. Missing line/current ratings remain visible as unchecked bounds.
All these studies use the original imported case, not diagram edits. They reject overlapping reduced HVDC links and AC islands that would omit a converter. Results appear in this inspector and do not replace the main diagram’s result set. The optional POUNCE backend stays separate from the ordinary shipping WASM package.
Automatic regulator studies
Choose Automatic regulator study for an AC case, or enable Include automatic tap, PST and shunt regulators in a detailed AC/DC power-flow study. The source network is cloned; original settings and equipment metadata are preserved.
Enabled uniform transformer controls adjust tap ratio to regulate voltage or from-terminal Q, or phase angle to regulate from-terminal P. Allowed tap positions are explicitly enumerated from the stated range and count. Pure-susceptance shunts use their declared cumulative sections or a continuous range. Controls solve AC power flow between bounded actions; they stop in the target band, at a setting limit, or when discrete steps cannot reach the band. A radial PST may have no useful influence on active-power sharing: drawing a regulator does not guarantee control authority. Cycling, incompatible targets and nonconvergence return errors. The pass budget is 60 plus the sum of declared discrete moves across controls, so a 1000-section bank can traverse its full range and perform a final target check. Candidate flows warm-start from the last accepted voltage state, with the normal flat-start fallback; numerical Jacobians are rebuilt after control changes. At most 64 simultaneous controls are supported.
Detailed tap tables with impedance corrections, asymmetric winding controls, mixed-sign shunt switching sequences, partial participation and unresolved terminal references require additional models and are rejected. This implementation is steady state; it does not model switching time delays, wear, protection or transients.
Rust APIs: regulation::solve_source, dc_grid::solve,
dc_grid::active_power_sensitivity, ac_dc::solve_source, and
ac_dc::solve_source_with_regulators. Select Problem::Acopf in a build with the
acopf feature for joint optimization. Browser APIs: solveRegulated, solveDcGrid,
solveAcDc(moduleJson, 'acpf', true) and solveJointAcDcModule (optional WASI worker).
Sensitivities remain local derivatives of fixed control equations, not derivatives
through saturation or mode changes. Zero-current absolute-loss kinks are rejected
for sensitivity and smooth joint-OPF optimality qualification.
Independent DC operating-limit checks allow an absolute numerical floor of 1e-7 MW/kV (1e-8 kA) plus 2e-8 times the limit magnitude, consistent with the nonlinear solver’s bound relaxation. This accommodates binding 150 MW limits without accepting physically meaningful excesses. Numerical convergence remains separate from operating-limit diagnostics.
Synthetic Layout
Most public OPF test cases do not include geographic coordinates. tellegen uses
synthetic topology layouts in two places: the explicit pglib dev fallback, and
local files parsed in the browser that the user places on the map. The tellegen
backend API marks fallback coordinates with synthetic_coords: true; local
files are labeled in the panel as synthetic layouts.
Tree Short-Circuit for Radial Networks
Before the force pass, the browser layout counts independent cycles on the
deduplicated graph (open switches are already excluded). When the count is at
most max(2, ceil(0.02 * n)), the graph is a tree or nearly one — the shape of
a distribution feeder — and it is drawn as a tidy tree instead: depth grows
along one axis from the root, and each subtree occupies its own contiguous band
of leaf slots on the other, so the drawing is planar and the longest chain
renders as a straight trunk. The root is a source bus when the case identifies
one (multiconductor cases pass their sources as hints), else a BFS diameter
endpoint. Chords of a near-tree draw as plain segments between their placed
endpoints. Meshed networks fall through to the force pass below.
Deterministic Seed
The layout starts from a golden angle spiral on the unit square. A deterministic
jitter of about 1e-4, computed from bus index sines, breaks exact ties. No
random number generator is used.
Force Refinement
tellegen refines the seed with a Fruchterman–Reingold force pass on the unit square:
- repulsion
k^2 / dbetween each bus pair, withk = sqrt(1 / n); - attraction
d^2 / kalong branches; - capped displacement with a linearly cooled temperature.
The force pass is O(iterations * n^2). In the tellegen backend it runs once
at boot and the resulting network payload is cached. In the browser, local
dropped files use the same deterministic force idea with a lighter seed and
iteration count, then scale into a small footprint around the user’s chosen map
point. The fit into that footprint uses one uniform scale for both axes, so a
long feeder keeps its aspect ratio instead of stretching to a square. Once
placed, the local network solves in browser WebAssembly, and the layout is
stamped into the retained PowerIO module (Bus.location, provenance
synthetic), so saved modules and case exports carry the placement and the
panel can download it as a .geo.json layer.
Determinism
The pipeline uses source order, fixed jitter, and fixed iteration counts. Identical input files produce identical coordinates across boots.
Tests
Rust tests check that:
- every coordinate lies inside the bounding box;
- no two buses remain stacked in the test fixture.
References
- T. M. J. Fruchterman and E. M. Reingold, “Graph drawing by force-directed placement,” Software: Practice and Experience, 1991.
Synthetic Grid Generation
tellegen-synth generates a geo-referenced transmission grid for a region
drawn on a map, validates it with the engine’s DC optimal power flow and AC
power flow, and reports every verdict as the engine returned it. The result
is a PowerIO BalancedNetwork module whose buses carry locations and whose
branches carry routes, plus a GenerationReport. The crate is part of the
one wasm module (feature synth), so the whole pipeline runs in the
browser; the CLI runs the same code natively.
The grids are synthetic. Topology, impedances, ratings, loads and generation are modelled from the region’s geography and population with the cited tables below, so a generated grid resembles a transmission system without describing any real one. OpenStreetMap mode maps real substations, lines and plants, but its electrical parameters and loads stay modelled.
A region is GeoJSON Polygon or MultiPolygon geometry in longitude and
latitude, or a bounding box. A region that crosses ±180 must arrive split at
the seam, as RFC 7946 asks, or as a bounding box whose east edge is above
180; a ring edge that jumps more than 180° of longitude is refused, except
along a pole. Request values are bounded well outside any real system:
voltage levels 1–1500 kV, demand.mw up to 10⁷, demand.per_capita_kw up
to 100 and demand.peak_factor from 1 to 10.
Generated longitudes lie in [-180, 180], and a branch route that crosses the seam is not split; Routes across the antimeridian says how to draw one.
Each generated bus, branch, load, generator, shunt and HVDC row keeps its
annotations (kind, place, population weight, tier, island, source, corridor
and circuit) under extras.tellegen_synth, and the module is named
tellegen_synth_ followed by the first 16 hex digits of the request hash.
Stages
A session runs one bounded stage per call. The calibration stage runs once per iteration.
| Stage | Work |
|---|---|
context | parse and measure the region (spherical area, landmasses, island groups, keeping the most populous group when far islands are cut); resolve peak demand from the national demand table, the voltage ladder, the bus count and the fuel mix |
site_buses | anchor buses on the most populous places, fill the rest with blue noise; allocate demand-weighted loads, holding every bus at or below the top level’s load cap |
topology | per island, a minimum spanning tree, a tree over the highest-voltage buses, a Gabriel mesh up to the branch factor, and high-voltage loops, all from one Delaunay triangulation |
electrify | site generation; design every corridor; run the corridor plan and the reactive plan; build the PowerIO network |
dc_opf | the engine’s DC OPF per island |
calibrate | one recorded calibration step per call |
ac_pf | the engine’s AC power flow per island at the DC OPF dispatch |
finalize | wrap the network in a module with its producer and history |
Every stage up to electrify is O(n log n). The library reads no clock, no
filesystem and no platform randomness. Each stage draws from its own ChaCha8
stream seeded from the request seed, so the same request and places table
give the same module, byte for byte, on the same build and platform. Native
and wasm runs agree in structure in the cases tested, but floating-point
values differ in the last bits because the platform math libraries round
ln, exp, sin and cos differently; compare them with a tolerance, not
by module hash.
Demand and bus count
-
National demand. By default each country’s peak is its annual demand from Ember’s Yearly Electricity Data (via Our World in Data’s energy dataset, CC BY 4.0) as an average load, times a peak factor of 1.3. The table is
crates/tellegen-synth/data/national_demand.json, derived byscripts/derive-national-demand.pyfromowid-energy-data.csv; 196 of 212 countries report 2024. A place whose country has no entry draws the world average per person and raisesdemand_fallback.demand.per_capita_kwsets one average per person for every place instead, and atotal_mwdemand states the total. -
Listed and unlisted demand. The places table lists a country’s cities, not all of its people: from 5% of Ethiopia’s population to 72% of Japan’s. So a country’s peak splits in two:
- The share its listed places explain (their population over the national
population,
listed_share) follows those places, by population. - The unlisted rest is spread over the country’s area. A region takes it
in proportion to the country area it covers (
area_share; each part of the region counts to the country of its nearest place), but never beyond its share of the country’s listed population, since a drawn box may be sea or desert; covering 95% of the area takes all of it.
A region covering a whole country reproduces its national peak. A box holding a country’s few listed places takes only the part of the country it covers. Leaving far islands out removes their places, and with them their share by population, not by area. Country areas come from Natural Earth’s 1:50m admin-0 polygons, measured with the generator’s own spherical area (
data/country_areas.json, derived byscripts/derive-country-areas.py). The report lists the countries behind the demand with these shares (context.demand_by_country), and both tables’ hashes (provenance.demand_table). - The share its listed places explain (their population over the national
population,
-
Peak factor. Annual load factors run from 0.58 to 0.77 in the systems surveyed (OCCTO, ENTSO-E, PJM, ERCOT, NEA, India’s Ministry of Power), a peak factor of 1.3 to 1.72. Ember’s demand counts losses and self-supplied use that operators’ peak series leave out, so the factor applied to it is the low end, 1.3. It is a modelling choice within that range.
-
Places at the coast. Generalised country outlines leave out harbours and estuaries: at 1:50m, New York lies 1.9 km outside the United States and Lisbon 1.6 km outside Portugal. A place up to 15 km outside the region joins it, moved onto its edge, when the region holds at least half of that country’s place population counting such places (
context.places_snapped). A drawn box around one city never snaps the cities beyond its edges. -
Bus count. Without
target_bus_count, a transmission-only grid’s count follows the region’s area anddensityand is then moved into the range that keeps peak load per bus between 30 and 150 MW. Those are the scales of transmission models down to 110–220 kV (PEGASE, RTE) and of substation-level models at 220 kV and above (PyPSA-Eur, SciGRID). It stops at 3,000 buses, the scale national transmission models keep. A hierarchical region (below) sizes its count by peak load instead: one sited bus permw_per_bus(10 MW) at high density, and 1.5 and 2.8 times that load per bus at medium and low density (15 and about 28 MW), the ratios of the transmission design’s counts. Tap junctions come on top. Either count stops atlimits.max_bus_count(12,000 by default), andbus_count_cappedsays by how much a cap bit. -
Siting. Buses stand on the most populous places first, and the rest fill the region by blue noise drawn from a population density surface: each place spreads its people over a 24 km kernel, and a point’s density is its share of the densest cell’s raised to the power 0.75, with a floor of 0.005 of the densest cell’s on land with no place near it. These are the
fill_*constants ofcrates/tellegen-synth/src/tuning.rs, calibrated on California (CATS comparison). -
Load cap. No bus carries more than the load cap of the highest modelled level (7 GW at 500 kV, 2.9 GW at 400 kV). The excess of a metropolitan bus moves to the nearest buses of its island with room, and
buses_load_cappedandload_spilled_mwcount it.
Voltage levels
- National ladders. A request that names no
voltage_levels_kv(the default) is modelled at the AC transmission levels of its region’s dominant country by demand, fromdata/voltage_ladders.json, a table of national ladders with their sources: for example 380/220 kV in Germany, 400/275 kV in Great Britain, 500/345/230 kV in the United States and 500/275 kV in Japan.context.voltage_basissayscountry,context.voltage_countrynames the country, andprovenance.voltage_tablegives the table’s version and hash. - Higher levels. The table also lists any higher AC level a country has
in service: 765 kV in the United States, India, Brazil and South Africa,
750 kV in Russia, 1000 kV in China and 500 kV in eastern Australia
(
context.promotion_levels_kv). Only these may be added above the ladder by the corridor plan. A country with none, such as Germany, France, Great Britain, Spain, Portugal or Japan, keeps its ceiling: a corridor short of capacity at four circuits stays capped and the plan reportsplanning_incomplete. - Fallback. A country without an entry takes the ENTSO-E members’
400/220 kV when it is a member, else IEC 60038’s standard 400/220 kV, with
no higher level, and raises
voltage_fallback(context.voltage_basisfallback). - Stated levels. A request that names its levels is modelled at them
(
voltage_basisrequest), and they follow the region in two ways. The plan may add above them only a higher level in service in the region, from its own ladder: 765 kV in the United States outside California, none in Germany, California or a country on the fallback ladder. And stated levels that reach below 100 kV in a region whose dominant subdivision has its own ladder keep the hierarchical design below. - Hierarchical regions. A region whose dominant subdivision has its own
ladder down to subtransmission (California’s 500/230/115/66 kV, from
data/voltage_ladders.json;context.voltage_basissubdivision) is built in layers: meshed top-level sites, subtransmission pockets fed from step-downs, and tap junctions. - Line parameters. A level between the line classes takes the nearest class’s conductors at its own voltage (below), so 380 and 400 kV use the 345 kV class scaled by 1.10 and 1.16, and 1000 kV the 765 kV class scaled by 1.31.
Parameters
Every constant lives in crates/tellegen-synth/src/electrical/params.rs
with a source: comment, apart from the demand and siting constants, which
sit beside the code that uses them.
Line classes. Representative ACSR bundles from Glover, Overbye and Sarma, Power System Analysis and Design; SIL from Kundur, Power System Stability and Control, Table 6.1:
| Class kV | r Ω/km | x Ω/km | b µS/km | thermal MVA | SIL MW |
|---|---|---|---|---|---|
| 138 | 0.11 | 0.48 | 3.4 | 180 | 50 |
| 230 | 0.06 | 0.45 | 3.8 | 500 | 140 |
| 345 | 0.03 | 0.35 | 4.8 | 1200 | 400 |
| 500 | 0.02 | 0.30 | 5.6 | 2500 | 900 |
| 765 | 0.012 | 0.26 | 6.5 | 4500 | 2200 |
- Voltage levels between classes. A requested level such as 220 kV or
34.5 kV takes the nearest class’s conductors at its own voltage. Its
thermal rating scales with the voltage (same ampacity,
S = √3 V I), and its SIL with the square (same surge impedance,SIL = V² / Zc). - Ratings. A line’s rating is the lesser of its thermal rating and SIL times the St. Clair loadability. The loadability curve follows Dunlop, Gutman and Marchenko (1979): 3.0 SIL up to 80 km, 1.0 at 480 km. A rating is never raised above what the conductor and length allow.
- Transformers. Impedance follows the size class: 8, 10 or 12% on the unit’s own base, after IEEE C57.12.10 and Grainger and Stevenson. Banks are sized for the larger of local load and local generation, with 20% headroom. Buses sit at their own base kV, so the off-nominal tap is 1.0; the winding ratio is recorded in the branch extras.
- Generation. Fuel unit sizes and costs come from EIA-860 and the EIA Electric Power Monthly. Installed capacity is (1 + reserve margin) × peak load, with an 18% default margin. No bus collects more generation than its class can evacuate: 400 MW at 115–161 kV, 1.2 GW at 230 kV, 2.7 GW at 345 kV and 4 GW at 500 kV, following the interconnection voltages of the largest U.S. plants.
- Regional adequacy. An island’s units are grouped into adequacy areas of about 10 GW of the load nearest them, the scale of the Lower 48’s 66 balancing authorities. Each area holds the reserve-margin capacity of its own load, shared among its units by their drawn sizes, so the network carries balancing transfers between neighbours rather than one side of a country’s demand to the other. A share above a bus cap spills onto the area’s other units, then onto the area’s next ranked bus.
Planning before validation
A generated grid is planned so that it is feasible by construction, not repaired after a solver refuses it. No number in a report is adjusted after a solve.
- Planning case. The planning case is peak load under the least-cost dispatch of the generators (equal incremental cost) on a lossless DC power flow: the grounded Laplacian, solved by Jacobi-preconditioned conjugate gradients.
- Voltage class by power and distance. A corridor that would need more
than two circuits at its voltage raises its ends to the next level. Above
the highest modelled level the plan may add only a higher level in service
(
added_level_kv, warningvoltage_level_added). - Circuit cap. A corridor holds at most four circuits: double and
quadruple circuit lines are common in Germany, India, Japan and China, and
in the OpenStreetMap-based European grid no line at 220 kV and above
carries more than four per voltage level. A corridor that would need more
raises its ends instead. One that still needs more at the highest level
available is counted in
capped_corridorsand reported. - Capacity. Circuits are added until no circuit runs above 90% of its rating in the planning case; this is Garver’s flow-driven expansion under the NERC TPL-001 base-case requirement. A transformer corridor first takes a larger bank, up to the rating of its line.
- Stability margin. Each line within its own St. Clair rating can still
add up to too wide an angle along a chain. So the plan aims to hold every
island’s angle spread to asin(0.7) ≈ 44.4°, the St. Clair curve’s 30%
steady-state margin, reinforcing the corridors a first-order spread
sensitivity ranks highest. It raises buses within the requested levels
until 35% of them sit at the highest one, and only then onto 765 kV. It
adds circuits only up to 1.6 branches per bus, about a tenth above the
densest North American systems (1.2–1.5, Birchfield et al. 2017). The
last quarter of the planning rounds only adds capacity. A spread still too
wide is reported as
planning_incomplete, not met by a network denser than real ones. - Branch factor. Circuits the requested branch factor still leaves go
where the planned loading is heaviest. The plan exceeds the factor only
when capacity or the margin needs more, and then raises the
branch_target_exceededwarning. - Reactive plan. The reactive plan holds a flat profile at the generator set point (1.02 pu). It solves the AC active-power equations for the angles at the planning dispatch (fast decoupled P–θ, Stott and Alsaç 1974), then installs a capacitor bank or a shunt reactor wherever a bus needs more reactive power than half its machines’ capability provides. Reactive power does not travel far (Kundur §11.2), so it is supplied where it is used. This plan covers line charging, series absorption and the share resistance moves to the receiving end.
- Voltage support. A loaded bus farther than 100 km of corridor from
any generator gets a synchronous condenser, farthest first: no active
power, and a reactive range of 0.5 MVAr per MW of the load nearest it.
Reactive power is supplied close to where it is used, because carrying it
over long lines costs voltage and losses that grow with the distance
(Kundur §11.2), and voltage control areas span tens to a little over a
hundred kilometres. The 480 km of the St. Clair curve’s 1.0 SIL point is a
stability limit for transfer paths, not a voltage control distance: at
100 km the country sweep’s AC power flow converges inside the band in 53
of 54 runs, against 49 at 480 km. Without a condenser, a remote pocket fed
over long lines has nothing to hold its voltage, and its AC power flow can
stall while the lines are well inside their ratings. Condensers are
flagged in the generator annotations (
condenser) and counted in theelectrifystage (condensers). OpenStreetMap mode also adds explicitly synthetic condensers whenosm.reinforceis enabled (the default).
The plan is recorded in GenerationReport.planning: rounds, promoted
buses, the added level, the most circuits on one corridor
(max_parallel_circuits) against the cap (circuit_cap), capped
corridors, capacity, stiffening and filler circuits, enlarged banks, angle
spread, and banks and MVAr installed. Each circuit is its own branch row;
its annotation in GenerationReport.elements gives the corridor’s circuit
count (circuits) and the branch’s 1-based place among them
(circuit_index).
Validation and calibration
- Islands. The DC OPF and the AC power flow run per electrical island, each with its own reference bus.
- AC initialization. Emitted buses retain the planned 1.02 pu profile
and the converged reactive-plan angles (stored in degrees). An unconverged
reactive plan uses the final DC planning angles and retains its warning.
Mapped grids refresh the angles when reactive planning succeeds at the
constrained dispatch. Validation requests
start: "case"; each island’sinitializationrecords which strategy converged and how many starts ran. Modules with AC validation enabled record that calculation setting so the viewer and a reopened Study use it. Explicit settings can requestflat. - HVDC. Links are replaced by fixed transfers on a validation copy, because the engine’s models do not read HVDC rows.
- Failures. An infeasible DC OPF is reported as infeasible with the engine’s message; nothing is shed. Load shedding is off in the portable DC OPF, so unserved energy is 0 when optimal and absent otherwise. An AC power flow that does not converge is reported as such.
- Calibration. Calibration is a recorded search over declared parameters
against a declared objective:
- parameters: rating scale per class and capacity scale per fuel within [0.8, 1.5], rating notches on binding branches, and load scale only on request;
- objective: DC infeasibility, worst loading above target, under-utilisation, binding fraction, reserve margin, plus the structural terms the parameters cannot move.
- Calibration steps. Every candidate is an exact DC OPF re-solve; a step
that does not improve the objective is rejected and undone. The status
says
Unchangedwhen nothing improved, and the final objective is the measured one.
OpenStreetMap mode
With source: "osm" and an Overpass document (one, or the two halves of an
antimeridian-crossing region), the grid is built as follows:
- Substation sites within 500 m cluster, and each voltage level at or above 110 kV gets a bus, with a transformer between consecutive levels.
- Fragmented ways stitch where exactly two ends meet away from a station.
- Untagged voltages are inferred from the endpoints, and line ends snap to the bus of their voltage within 2 km. Parallel ways aggregate into one corridor.
- DC ways between converters become HVDC rows.
- Plants snap within 10 km; makeup units cover a shortfall against the reserve margin.
- The island policy applies:
connect(default),cutorkeep.
limits.max_bus_count (12,000 by default) caps this mode too. When the
mapped substation levels and converters make more buses than that, the lowest substation level
is left out, one at a time, until they fit, and its lines with it;
osm_bus_count_capped names the levels kept. A region whose highest level
alone exceeds the cap is refused as invalid_request: choose a smaller region
or raise the cap.
Mapped routes and voltages are retained. By default, osm.reinforce: true
allows the corridor plan to add synthetic parallel circuits, enlarge modelled
transformer banks, and add synchronous condensers for the modelled demand.
The existing equipment first receives a constrained DC dispatch; circuits
are added only if that draft is infeasible.
This does not assert that the added equipment exists. Added branches have
source: "synthetic" in the report and synthetic_reinforcement: true in
their exported extras; their OSM way ids identify the route only. The report
warns with osm_synthetic_reinforcement. Set osm.reinforce: false to keep
the original circuit counts and observe their feasibility without additions.
Density never adds filler circuits in OSM mode, and demand is not reduced to
make a failed case pass.
Reactive support is sized after calibration from the feasible, constrained DC
dispatch, rather than the unconstrained economic dispatch. Otherwise cheap
generation behind mapped bottlenecks can produce an impossible angle profile
and excessive shunt banks. Shunts are labelled synthetic, with basis
dc_dispatch_reactive_balance. A failed angle solve installs no banks from
its divergent iterate, and validation still reports any remaining failure.
A way’s circuit count, and a corridor’s mapped count, is
capped at 12: a larger circuits or cables tag is a tagging error, and each
circuit becomes a branch row. A network too thin to use is the typed
osm_insufficient refusal. The caller decides whether to rerun
synthetically; the generator never switches on its own. The Overpass QL
comes from the engine (syntheticOverpassQueries), so its text exists once.
An OpenStreetMap-mode grid contains data derived from OpenStreetMap, © OpenStreetMap contributors, available under the Open Database License (ODbL) 1.0. Check the ODbL’s attribution and share-alike terms before redistributing such a module or its exports.
Using it
In the browser (@tellegen/engine):
import { createSynthSession } from "@tellegen/engine";
const session = await createSynthSession({ region: { geometry, label: "Portugal" } });
const report = await session.run((step, preview) => {
// step.stage, step.progress; preview holds typed arrays for binary map layers
});
const moduleJson = await session.takeModule(); // pio-ir with Bus.location and Branch.route
const ingest = await session.ingest(); // the drop payload of that module
session.free();
- Host. Sessions run on a dedicated worker. Cancelling one terminates only that worker, so interactive studies are untouched.
- Places table. The GeoNames table (
cities5000, CC BY 4.0: 69,999 places of 5,000 people or more) ships in the package and loads once per worker. It is derived byscripts/derive-populated-places.py, names GeoNames and the dump’s SHA-256, and the report repeats both (provenance.places). Grids built from it carry GeoNames’ attribution. A host may load its own bare array of{n, lo, la, p, c}rows instead; its provenance then names no source. The national demand table is compiled into the module. - Types. Request and report types are generated from Rust under
@tellegen/engine/synth. - Strict requests. An unknown key at any level of the request, such as
a misspelt
limitsorislandsoption, is refused asinvalid_requestrather than ignored.limits.max_area_km2must be positive and finite,limits.max_branch_factorfinite and at least 1, and the two OSM limits at least 1. Theosmdistances (voltage_floor_kv,cluster_radius_m,snap_km,hvdc_snap_km,plant_snap_km) must be finite and positive, andclip_buffer_kmfinite and not negative. - Coordinates. The ingest payload has
coords_kind: "synthetic"andcoords_method: "generated": the buses are sites chosen on real geography, not a topology layout, and the case panel says so.
From the command line:
tellegen generate --request request.json --out run/ --export matpower,psse35 --gridfm
tellegen stats --case case.m # or a PowerIO module on stdin
Exports go through the engine’s Study.export: MATPOWER, PSS/E (v33, v34,
v35, RAWX), PowerWorld, PSLF, PowerModels JSON, pandapower JSON and the IIDM
formats. The GridFM graphkit JSON writer belongs to tellegen-synth, because
PowerIO’s gridfm format is the Parquet dataset layout.
Limits
- An Overpass answer over
limits.max_osm_document_bytes(256 MiB by default) is refused before it is parsed, and one with more thanlimits.max_osm_elementselements across its documents (1,000,000) before the network is built. The byte cap is the memory bound; the element count is known only after parsing. In the browser the engine’s 128 MiB input cap applies first. Measured in November 2026 on the default query with a longer server timeout: Germany’s answer is 115 MiB with 264,653 elements and generates natively in about 9 s with a peak of about 1 GB; Spain’s is 69 MiB with 114,401 elements. Neither country’s query finishes within the 60 s timeout every tellegen query states on the public Overpass server, so a country that size needs its own Overpass instance or a smaller region. - Requests are capped at 12,000 buses (
limits.max_bus_count), and a transmission-only automatic count stops at 3,000, which the largest countries reach. OpenStreetMap mode keeps to the request cap by leaving out its lowest voltage levels. China at 3000 buses takes about 1.0–1.2 s natively and 1.5 s in wasm (Node, Apple M5 Pro), end to end with both validations; the United States takes 1.4–1.5 s and 2.0 s, about 0.9 s of it an AC power flow that does not converge over five starts. A 500-bus country takes under 0.1 s.docs/evidence/synthrecords the measurements. - Whether the AC power flow converges inside the band depends on the seed
for several countries.
docs/evidence/synthsweeps three seeds on two outlines (Natural Earth 1:50m and the MapToGrid app’s 1:110m layer): every run passes DC. The warm-start evaluation passes AC inside the band in 53 of 54 and 49 of 51 runs. The United States passes all six runs; Australia’s three remaining failures depend on seed and outline. Seedocs/evidence/synth/warm-start-262for timings and numerical comparisons. - Clustering in generated grids runs higher than in the ACTIVSg200 and
GOC500 references, because the Gabriel mesh is rich in triangles. Their
highest nodal degree is also lower, since the mesh caps it at 8.
docs/evidence/synthmeasures both against the references. - Continental regions span several thousand kilometres as one AC island.
Their planning-case angle spread stays well above 44° within the branch
budget, so the plan reports
planning_incomplete. Real systems of that size split into synchronous areas joined by HVDC, which the generator does not model yet; very long corridors, such as across the Nullarbor or between Indonesian islands, stay AC. - AC validation starts from the stored planning state and falls back to a flat start and deterministic perturbations if necessary. Long, weakly coupled systems can still fail or reach another solution outside the voltage band. The planning dispatch can also differ from the final DC OPF dispatch. Convergence and voltage-band acceptance remain separate checks.
Technology choices
Keep Svelte for controls and MapLibre GL JS for geographic rendering. Rust remains the numerical engine, compiled for native execution and WASM. This recommendation follows the capabilities below, checked on September 7, 2026.
| Project | Use in Tellegen |
|---|---|
| MapLibre Rust | Its published feature list still lacks GeoJSON, text, and a TypeScript API. Replacing the current renderer would remove capabilities used by case import and equipment selection. |
| MapLibre Native | Appropriate for a future native map application. It does not replace browser controls, accessibility, or persistent Study management. |
| Martin | Consider for a large shared geographic catalogue or self-hosted basemaps. Local case files do not require a tile server. |
| MapLibre Tile | Useful for large tiled geographic collections. Keep editable equipment geometry in GeoJSON: tile encoders can reorder features, and equipment identity must remain explicit. |
| wasm-pack | Already builds the engine package. Keep reproducible versions and exercise the installed package in CI. |
| Walrus | Already participates through wasm-bindgen’s tooling. Add a custom module-processing step only for a measured requirement; it is not a replacement for the application. |
| wgpu | Supports WebGPU and optional WebGL on WASM. A GPU drawing experiment could help unusually large networks, but needs measurements against the current map before adoption. |
| Verus | Worth a small PowerIO experiment on byte-range arithmetic or identity-index invariants. Its supported Rust subset makes whole-parser adoption a separate research effort. Existing parser, binding, and cross-tool tests remain necessary. |
A useful next graphics measurement separates parsing, numerical solving, moving result arrays to JavaScript, layer updates, and map rendering. Record first-load bytes and time, memory growth, interaction latency, and frame time on Texas7k and a larger case. Typed arrays and selective layer updates should be evaluated before changing renderers. GPU support alone does not establish faster double-precision sparse power-system solves.
AC OPF in the browser
Pounce’s current browser implementation uses wasm32-wasip1 and a small JavaScript WASI implementation for clocks, output, and randomness. The worker receives an AMPL NL model and returns solution data. Tellegen’s engine uses wasm32-unknown-unknown; the two modules can coexist in separate workers.
A local feasibility check instantiated Pounce’s published WASM module under Node with its browser WASI implementation. The two-variable nonlinear test nonconvex_qcqp.nl returned SolveSucceeded, objective approximately -2, in 59 iterations. This verifies execution of the published module, not an AC OPF implementation or a build from that source revision. The evidence packet records the downloaded module’s hash and the input revision.
The non-default native POUNCE addition now compiles the exact PowerIO-prepared model, tests its analytic Jacobian and Hessian, and validates solved electrical equations and limits independently of solver-reported residuals. An opt-in development WASI adapter now exercises parity with that native path on a small power-system case. A dedicated one-shot worker provides hard cancellation by terminating the calculation; ordinary builds neither enable the selector nor contain the EPL-bearing asset. Distribution still depends on the release gates in the AC OPF solver decision. BMOPF multiconductor AC OPF additionally needs verified winding, neutral, device-control, objective, and per-terminal limit equations. The fixed-point AC power flow does not claim that support.
PowerIO and geographic data
PowerIO already represents a geographic document as PioModule<PioValue::GeoLayer>, and its module-aware apply_geo_layer supports both electrical network types. Keep GeoJSON as the exchange document and PioModule as the owner of source descriptions, diagnostics, and history. A second combined network/geography container would duplicate those responsibilities.
Tellegen retains the imported multiconductor module and its GeoLayer together, applies geographic files to the selected case, and reports matched buses, routes, and unmatched features. A geographic edit retains the calculation input and can be saved as PowerIO IR. Geographic coordinates and diagram positions keep their declared coordinate type. Tests use BMOPFTools’ bus_from and bus_to route identities and check unchanged electrical results after attachment and reload.
The remaining useful upstream simplification is consistent module-aware extraction and application for calculation inputs and solutions as well as bare networks. Any such addition must preserve explicit device settings and numerical results. It should build on the existing functions without changing published ABI 7 or replacing BMOPF’s geographic work.
AC OPF solver decision
Status: accepted for feasibility work. Recorded 24 September 2026. On 29 October 2026 the release owner approved EPL-2.0 distribution of the WASI asset, and the website serves it as an experimental, base-case-only calculation. Release gates 2 to 5 below remain open.
Backend update — 4 November 2026
The native and dedicated WASI paths now pin the published, checksummed
pounce-nl = pounce-rs = 0.15.0 release, with FERAL 0.22.0. The release and
source-manifest guard checks all 16 POUNCE crates. The two new transitive
crates, pounce-convex and pounce-sens-core, have explicit EPL-2.0 exceptions
alongside the existing POUNCE crates in deny.toml.
POUNCE 0.15.0 adds complementarity support, which Tellegen does not use. Four upstream changes can move Tellegen’s solves:
perturb_slack_max_rows(new in 0.15.0, default 1000) caps the inertia correction’s slack-block perturbation. A model with at most 1000 inequality rows solves exactly as before; above that, solves that hit inertia correction can take a different path.- Restoration’s release test now uses the outer filter’s own quantities (0.14.0). A failed base solve can end with a different status, which changes which second-opinion rungs follow.
- The second-opinion ladder gained a saddle-escape rung after an infeasibility verdict (0.14.0).
- A stop requested from the intermediate callback is now honoured during
POUNCE’s automatic re-solves (0.15.0). The ladder itself still runs its
remaining rungs after
UserRequestedStop, so Tellegen keeps refusing their initialization once cancelled.
The SQP handover added in 0.14.0 is off by default and stays off. Tellegen
continues to construct its existing polar AC OPF model through
NlProblemParts and apply its independent physical validator, with unchanged
POUNCE_OPTIONS. The dependency update does not add a complementarity
formulation or change the public API. The validation results below for 0.13.0
remain historical evidence for that release.
Local validation used Rust 1.96.0 on macOS arm64: all 428 enabled engine tests
and the WASI adapter test passed, along with strict all-target AC OPF Clippy,
the HS071 probe, release/source-manifest checks, and the EPL isolation guard.
The release wasm32-wasip1 build also solved the existing three-bus planning
fixture using the production WASI host under Node: objective
631.5334170921521, 12 iterations, and active/reactive balance residuals below
5e-12 MW/MVAr. This was a reactor smoke test; the browser UI was not rerun.
The engine tests solve only three- and four-bus cases, below the 1000-row
threshold, so the native acopf_benchmark example compared 0.13.0 and 0.15.0
on 14 PGLib v23.07 cases (case14_ieee to case4661_sdet). Both versions
solve the same 13 cases, and every objective agrees within 1e-12 relative.
Nine solve identically: same status, iterations and objective. The rest:
| Case | 0.13.0 | 0.15.0 | Cause |
|---|---|---|---|
case793_goc | succeeded, 210 it, 1.8 s | acceptable, 137 it, 1.3 s | slack cap |
case1354_pegase | 192 it, 3 restorations | 190 it, 2 restorations | restoration test |
case1888_rte | 605 it, 10.2 s | 788 it, 14.1 s | slack cap |
case3012wp_k | base step error, rescued by mu_strategy=adaptive | base restoration failure, same rescue | restoration test |
case4661_sdet | fails after 1 rung, 615 it, 123 s | fails after 3 rungs, 1824 it, 244 s | restoration test |
Times are single serial runs. A third build, 0.15.0 with
perturb_slack_max_rows 0, reproduced 0.13.0 exactly on case793_goc and
case1888_rte, and matched 0.15.0’s restoration behaviour on the other three.
On case4661_sdet it was slower still: 2076 iterations in 360 s. Tellegen
therefore keeps the upstream default. case4661_sdet fails in both versions
with a small constraint violation and a KKT error of 1.35e4. Under 0.15.0
its base solve ends in Restoration_Failed rather than
Error_In_Step_Computation, so the ladder tries three rungs instead of one
and failure takes about twice as long. Every attempt keeps the per-attempt
max_iter 1000.
Two generator-free variants (case14_ieee and case300_ieee with every
generator’s real-power limits set to zero) fail identically under both
versions: InfeasibleProblemDetected after the same three rungs and 114 and
194 total iterations, in 0.1 s and 0.9 s. The saddle-escape rung did not fire.
Released backend integration — 22 October 2026
The native and dedicated WASI paths were updated to the published, checksummed
pounce-nl = pounce-rs = 0.13.0 release (FERAL 0.21.0). Both exact dependency
pins and every transitive POUNCE lockfile entry are checked by
scripts/acopf-release.py, also invoked by the build and EPL isolation gate.
The former Git-source exception has been removed.
Tellegen installs POUNCE’s multi-pass restoration factory and invokes the
released second-opinion ladder on the same cancellable TNLP. Failed retries
cannot overwrite the selected point. Every emitted result still passes the
independent physical validator; a retry does not weaken acceptance or turn a
local infeasibility report into a proof. Cancellation is checked before rescue
attempts, by callbacks during them, and after the ladder regardless of the
selected status. POUNCE 0.13.0 may still visit later retry rungs after
UserRequestedStop; the TNLP refuses their initialization once cancelled,
before they can rebuild or evaluate the model. Browser cancellation terminates
the entire worker.
Responses retain the selected solve’s iteration count and residuals, and add
base_solver_status, total_nlp_iterations, base_restoration_calls, restoration_calls,
recovery_attempts, and recovered_by. The restoration count belongs to the
selected solve; the total iteration count includes rejected attempts. The solve
card uses that total and marks recovered solves. Older responses remain
readable. The engine’s TypeScript contract now includes the NLP diagnostic
variant, which previously existed only in the Rust and Study schemas. Each
attempt uses the configured POUNCE iteration limit; the total across retries
can exceed that per-attempt limit.
A canonical full-pi regression forces entry into restoration, requires
restoration_calls > 0, and checks electrical feasibility and objective
agreement. A genuinely unserviceable instance exercises the retry ladder and
must still return an error. Small exact-expression regressions additionally
prove that a failed base solve can be rescued, rejected retries retain the
base point and verdict, total work includes every attempt, and cancellation
during the ladder returns a cancellation error. Existing finite-difference,
corrupt-result, portable-emission, cancellation and worker-lifecycle checks
remain in place.
The opt-in build now places POUNCE-EPL-2.0.txt, POUNCE-NOTICE.txt and
POUNCE-SOURCE.json beside the WASM asset. The manifest records its SHA-256,
size, lockfile hash, Tellegen revision/dirty state, and all 14 POUNCE source
archive URLs and checksums. Website builds copy these files with the solver. These
materials prepare review; they do not approve public distribution. Python
3.11+ is required for the release guard (PYTHON can select an interpreter).
Local validation at commit c721344 used Rust 1.96.0 on macOS arm64 and Chromium
with the release WASI artifact SHA-256
e6bf0775a90dec4fc8658c0559fadfed97545870adaae41152afb8ba8c12f5de
(10,463,176 bytes). The four browser UI/import/disposal checks and the four
external PGLib corpus checks all passed. Each corpus test hashes the served
artifact and input, requires independently checked primal violation below
1e-6, compares the objective to the checksum-keyed oracle, and verifies that
the worker terminates. These are single-run correctness checks, not a
performance or peak-memory characterization.
The external corpus was PGLib-OPF revision
dc6be4b2f85ca0e776952ec22cbd4c22396ea5a3. Its published TYP baseline uses
PowerModels.jl 0.19.9 and Ipopt.jl 1.4.1 / Ipopt 3.14.4. The rounded baseline
values below are compared with relative tolerance 1e-4; they are not
full-precision solution or expression-graph oracles. The same cases passed
the native benchmark:
| PGLib case | Published objective | Native objective | Native iterations | Native restoration entries | Browser oracle check |
|---|---|---|---|---|---|
| 14_ieee | 2,178.1 | 2,178.0804107 | 14 | 0 | passed |
| 30_ieee | 8,208.5 | 8,208.5154410 | 21 | 0 | passed |
| 300_ieee | 565,220 | 565,219.9746588 | 113 | 0 | passed |
| 6468_rte | 2,069,700 | 2,069,730.1566176 | 678 | 14 | passed |
Case6468 returned Solved_To_Acceptable_Level; its independently checked
maximum physical violation was below 1e-8. No case needed a second-opinion
promotion. The small forced-restoration and impossible-generation regressions
separately exercise the restoration and retry-driver paths.
The dated sections below retain the earlier feasibility evidence; their Git pin and old release observations describe those historical runs.
Main integration check — 5 October 2026
The feasibility branch includes main at 0d08c55, including compact
multiconductor PF session responses, the generated feeder regression and the
additional center-tap reference cases. The just ci aggregate retains both
acopf-probe and mc-pf-regression, matching the Rust workflow. The existing
multiconductor PF sessions remain independent of this opt-in NLP boundary.
The POUNCE revision and release/restoration/distribution gates are unchanged. The latest tagged release checked for this refresh is v0.12.0; the pinned revision is 35 commits ahead of that tag. Native AC OPF compilation/solve and the unpublished multiconductor IVR work remain separate layers of the stack.
Local validation for this refresh passed the HS071 probe (17.014017274,
maximum source-equation violation 2.484e-8), PowerIO source check, EPL feature
isolation and formatting. Workspace tests excluding the Python extension passed
374 tests (2 existing ignores), the independent mc-pf suite passed 160
(1 ignore), the conic engine suite passed 312 (2 ignores), and the conic WASM
adapter passed 40. Strict Clippy passed for the shipping Rust adapters plus the
opt-in probe and separately for Python with extension-module. The generated
feeder-10k --check regression passed all deterministic checks; timings are not
acceptance thresholds. Cross-platform, JavaScript and distribution checks remain
in the GitHub workflows.
Decision
Tellegen will use POUNCE as its first nonlinear solver for canonical balanced transmission AC OPF. The choice favors an end-to-end Rust implementation and a responsive upstream over building two solver adapters in the first cycle. The public problem and solution boundary must remain backend-neutral.
The decision follows POUNCE’s WASM-frontend restoration fix and the AC OPF follow-up experiments. Those results are feasibility and implementation evidence, not general solver performance guarantees.
This decision does not relabel the existing SOCWR relaxation as AC OPF. The
native opt-in feature now makes Problem::Acopf available after adding the
exact PowerIO-prepared polar model, independent primal validation, truthful
status mapping, and portable AcOpfSolution emission. Product distribution
still requires the browser worker boundary and release approval below.
POUNCE 0.13.0 replaces the original PR #961 Git pin. The upstream WASM fix
does not retrofit callers of a bare IpoptApplication; Tellegen now explicitly
installs the restoration factory and calls the released recovery driver.
Feasibility boundary
The non-default tellegen/acopf feature enables pounce-nl and pounce-rs.
No shipping adapter forwards it; the unpublished development WASI adapter does.
The native acopf_hs071_probe example constructs
HS071 with NlProblem::from_expressions, builds NlTnlp, verifies the sparse
Jacobian and Lagrangian-Hessian structures, solves with exact derivatives, and
checks the result independently.
Run it with:
cargo run -p tellegen --example acopf_hs071_probe --features acopf --locked
The probe pins the FERAL backend, exact Hessians, identity NLP/linear-system
scaling, and 1e-9 solver/constraint tolerances. The acceptance check requires
the known HS071 objective within 1e-5, source-equation violation below
1e-7, eight Jacobian nonzeros, and ten lower-triangle Hessian nonzeros.
PowerIO 0.11.3 provides the released preparation boundary used here. The model
compiler consumes its AcOpfInstance, build_ac_opf_preparation, and
AcOpfSolution APIs rather than reinterpreting MATPOWER data or reusing
Tellegen’s modified CATS power-flow physics.
Canonical model boundary
The opt-in feature now also contains a private, POUNCE-specific polar model
compiler. It consumes AcOpfInstance only through
build_ac_opf_preparation, preserves PowerIO’s generator and branch columns
and source maps, and emits an in-memory POUNCE expression DAG with exact sparse
derivatives. Native module dispatch and capabilities are feature-gated; no
shipping adapter or browser package enables them.
The recorded assembly policy is per-unit values, no zero-impedance skipping, no synthesized thermal ratings, and PowerIO’s angle-interval correction enabled. The preparation, including those choices, and the formulation version are hashed into the model fingerprint. Changing any policy is therefore a model change rather than a solver tuning option.
The variable map carries bus Va/Vm, generator-level Pg/Qg, and one
epigraph column for each active convex piecewise generator cost. Constraint
maps retain P/Q balance rows, zero reference angles, selected angle bounds,
both terminal thermal margins, and exact piecewise segments. Balance rows use
generation minus branch withdrawals, shunt consumption, and demand equal to
zero. Thermal and epigraph rows use nonnegative remaining margin. No dual is
published until these signs and unit conversions are independently validated.
The tests evaluate the full pi model at a non-flat point with taps, phase shifts, charging and bus shunts, compare both-end flows and nodal balances to a separate numerical calculation, and compare the sparse Jacobian and Lagrangian Hessian to finite differences. Unsupported active storage, voltage-dependent loads, and remote voltage regulation fail with the source element’s identity.
An ignored, path-driven external_model_build_ladder test makes the standard
MATPOWER 14/30/300-bus construction check reproducible without vendoring a
second copy of those fixtures. On 24 September 2026, a local arm64 debug build
after compilation produced:
| case | variables / rows | nnz Jacobian / Hessian | expression compile | derivative tape | max absolute directional J / H error |
|---|---|---|---|---|---|
| 14 | 38 / 49 | 267 / 127 | 1.849 ms | 3.841 ms | 4.545e-9 / 1.557e-7 |
| 30 | 72 / 184 | 871 / 260 | 1.016 ms | 12.803 ms | 7.186e-9 / 3.412e-8 |
| 300 | 738 / 1,012 | 5,433 / 2,605 | 8.380 ms | 70.444 ms | 2.723e-7 / 3.601e-7 |
These are correctness/prototype measurements, not solver performance claims.
Run the ladder with TELLEGEN_ACOPF_FIXTURES pointing to a directory containing
case14.m, case30.m, and case300.m. Peak RSS was not available inside the
sandbox used for this run, and frozen-NL parity remains a separate acceptance
measurement. The regression test now reports both absolute error and error
scaled by the analytic and finite-difference magnitudes with a floor of one.
The latest scaled J/H errors were 3.478e-9 / 2.418e-9, 1.791e-9 /
2.239e-10, and 9.095e-7 / 2.966e-9 for cases 14, 30, and 300
respectively.
Typed native solve boundary
The opt-in native API now exposes solve_ac_opf_instance and
solve_ac_opf_instance_to_solution plus cancellable counterparts. The
cancellable paths poll an atomic flag before model construction and at every
iteration of the base solve and recovery attempts. They run POUNCE with FERAL,
exact Hessians, identity NLP and linear-system scaling, a 1e-8
solver/constraint tolerance, 1e-7 acceptable tolerance, and a 1,000-iteration
ceiling. The returned AcOpfSolution is scattered through PowerIO’s source
row/winding maps in MW/MVAr and degrees, retains inactive source rows as
unavailable values, and round-trips through PioModule.
Only SolveSucceeded and SolvedToAcceptableLevel are candidates for
emission, and both must pass a separate calculation from the prepared arrays:
P/Q balance, voltage/generator boxes, references, angle and both-end thermal
limits, exact piecewise epigraphs, finite outputs, and source-cost objective.
The portable residuals report the independently calculated MW/MVAr balance
mismatch. A local NLP infeasibility report remains a diagnostic error rather
than PowerIO’s proof-strength Infeasible. No LMP or limit multiplier is
emitted yet; the POUNCE dual arrays stay private pending sign and source-unit
perturbation tests.
Native solve_module_json promotes a balanced network or consumes a stored
AcOpfInstance when the request selects acopf, and the capability advertises
only vm, va, injections, flows, and dispatch. Request edits currently
fail with an instruction to amend the canonical instance, rather than being
silently dropped, and every sensitivity request fails until the NLP KKT
contract exists. A successful nonlinear solve is reported as feasible, not
globally optimal, and its response includes the POUNCE status, iteration
count, solver constraint/KKT residuals, independently checked primal residual,
and model fingerprint. Failure and cancellation errors include the available
iteration and residual diagnostics.
Native API example
With tellegen built with features = ["acopf"], a stored canonical instance
can be solved for either the compact API response or the portable solution:
#![allow(unused)]
fn main() {
use std::sync::Arc;
use tellegen::{Problem, SolveRequest};
fn example(module_json: &str) -> Result<(), String> {
let module = tellegen::ir::deserialize_module(module_json)?;
let powerio::PioValue::AcOpfInstance(instance) = module.into_value() else {
return Err("expected an ac_opf_instance".into());
};
let request = SolveRequest { formulation: Problem::Acopf, ..Default::default() };
let response = tellegen::solve_ac_opf_instance(&instance, &request)?;
// Compact response: powers in MW/MVAr, voltage angles in radians.
assert!(response.lmp.is_none());
let solution = tellegen::solve_ac_opf_instance_to_solution(Arc::new(instance), "my-app")?;
// Portable solution: source table order, powers in MW/MVAr, angles in degrees.
let stored = powerio::PioModule::new(powerio::PioValue::AcOpfSolution(solution));
let json = tellegen::ir::serialize_module(&stored)?;
Ok(())
}
}
These are alternative entry points; calling both performs two solves. Inactive
source rows, including three-winding transformer terminals, remain unavailable
(NaN in Rust, the PowerIO unavailable representation in serialized modules).
Reproducible external comparisons
The committed acopf_benchmark example accepts MATPOWER files and emits one
JSONL record per case, including input and executable SHA-256, elapsed time,
objective, model fingerprint, residuals, solver status, and failures. It exits
nonzero if any case fails, while continuing through the remaining cases.
cargo run -p tellegen --release --example acopf_benchmark --features acopf --locked -- \
- /path/to/case14.m /path/to/case30.m /path/to/case300.m > results.jsonl
For an independent objective comparison, replace - with a JSON file containing
provenance (corpus revision, reference solver version/options, and result source)
and objectives (a map from exact input SHA-256 to its reference objective).
Missing checksums fail rather than comparing different case revisions. The
comparison tolerance is 1e-4 * max(1, abs(reference objective)). Keep that
reference file and the corpus provenance alongside the resulting JSONL. This
runner does not supply or regenerate an independent oracle. The published
PGLib baseline comparison above does not replace frozen expression parity or
validation on the final release artifact.
Experimental browser ABI
POUNCE’s proven browser target is a separate wasm32-wasip1 module with its
WASI clock/random/output shim. A direct wasm32-unknown-unknown/wasm-bindgen
probe compiles and loads but traps when the solver first calls
std::time::Instant::now(). Therefore tellegen-wasm does not forward
acopf, and a browser AC OPF solve must use a dedicated, terminable worker with
a small typed message boundary and one POUNCE memory. There must be no
synchronous main-thread fallback.
The development integration now implements that boundary as the unpublished
tellegen-acopf-wasi crate. Its raw ABI accepts one PowerIO module and one
solve request, then returns a length-prefixed SolveResponse. The JavaScript
host instantiates it with a minimal WASI Preview 1 clock/random/output shim in a
fresh worker for every solve. Cancelling or superseding a solve terminates that
worker; there is deliberately no synchronous or main-thread fallback.
The hosted UI defaults PUBLIC_TELLEGEN_ACOPF_WASM_URL to the bundled
/experimental-acopf/tellegen_acopf_wasi.wasm asset. It probes that URL through
the worker before enabling the AC OPF selector. Website builds now include the
EPL-bearing asset and its notices; the Docker build compiles the reactor, while
local builds and CI prepare it with npm run wasm:acopf. CI runs the three-bus
browser solve against the ordinary website build. This integration prepares
website enablement; it does not waive the release gates below.
The current UI path is intentionally base-case only because the
canonical AC OPF API rejects request edits and sensitivities rather than
silently dropping them.
For a local development preview from the repository root:
npm ci
rustup target add wasm32-unknown-unknown wasm32-wasip1
npm run wasm
npm run wasm:acopf
npm run build:engine
npm run build:web
npm --workspace tellegen-frontend run preview
The app copies the asset and notices during every website build. The Vite
development server also serves them after npm run wasm:acopf.
These commands are for local development and do not authorize distribution.
| Browser operation | Experimental AC OPF support |
|---|---|
| Balanced network / MATPOWER input | Promoted to a canonical instance for the base solve |
Stored AcOpfInstance | Imported without replacing its objective or constraints; requires the worker to solve |
| Geographic sidecars / layout | Supported while retaining the instance |
| Demand or rating edits | Rejected; reset edits before selecting AC OPF |
| LMPs / sensitivities | Unavailable |
| Save case / Export as | Disabled; the one-shot path has no retained Study |
| Save exact AC OPF solution in the UI | Unavailable; portable solution emission is currently a native API |
| Server fallback / WebMCP calculations | Unavailable for AC OPF |
tellegen-acopf-wasi requires its own explicit acopf feature. Default
workspace builds leave it inert, so selecting the workspace cannot silently
enable POUNCE in the CLI or other adapters. The build script enables this
feature only for the experimental reactor. Do not combine an explicitly
enabled AC OPF build with a shipping-adapter build in one Cargo invocation:
Cargo unifies their engine features. The EPL guard checks the default
workspace graph as well as individual adapters.
A single wasm-bindgen module can be reconsidered after POUNCE has a portable clock. That reconsideration must measure artifact size, memory growth, and hard worker cancellation in real browsers.
Experimental native multiconductor IVR OPF
The separate mc-opf feature adds native unbalanced current–voltage rectangular
OPF with explicit terminals and neutrals. The entry points are
solve_mc_ac_opf_instance, solve_mc_ac_opf_instance_cancellable, and
solve_mc_ac_opf_module_json; the JSON entry point requires an explicitly
declared McAcOpfInstance. This feature is not enabled by shipping adapters or
forwarded by the balanced browser worker described above.
PowerIO owns the canonical electrical semantics and solver-independent IVR
preparation. Tellegen constructs the expressions and independently checks the
accepted solution’s physical equations, limits and objective. Polynomial rows
use POUNCE’s existing exact sparse quadratic evaluator; general load laws and
smooth inverter controls use its existing sparse AD. No new differentiation
package is introduced. McOpfResult includes terminal voltages and physical
branch/device/winding/shunt ledgers with explicit terminal and coil identities.
Canonical JSON exports retain the full report in a versioned PowerIO module
extension; the MC APIs expose typed McOpfError diagnostics.
Explicit canonical initial points and the mc_opf_initial_point_from_pf helper
seed numerical variables without changing the declared physical problem; see
initial points for supported fields
and projection rules.
McOpfOptions.collect_profile enables optional
stage and KKT diagnostics. Native McOpfSession retains a compiled model and
accepted primal for repeated solves and atomic edits.
McOpfOptions.collect_duals separately enables original-scale multipliers, KKT
residuals, and conditional local marginal values
for supported load and limit parameters. Raw IVR KCL multipliers are not nodal
prices. McOpfResult::sensitivities() and McOpfSession::sensitivities() provide
conditional local forward and adjoint derivatives
from a verified current dual point, reusing one sparse active-KKT factorization.
Nominal load P/Q mappings include constant-current, constant-impedance, ZIP and
exponential laws, including coefficients hidden by zero nominal powers. Their
voltage-law coefficients and nominal voltages remain fixed. Inverter mappings
cover per-coil availability, P/Q bounds, apparent-power and conductor-current
ratings, including neutral returns and their effects on existing volt-var and
volt-watt references. Transformer mappings cover effective port ratings and
physical continuous tap bounds; outputs include winding/port flows and optimized
tap ratios, including inverse regulator conventions. Shared control-profile
mappings cover volt-var/volt-watt breakpoints and fractions and interior signed
power factors, including all assigned coils and smoothing-width derivatives.
Control modes, references and electrical coefficients remain fixed. Sparse rank
qualification uses explicit fill/work budgets, with reusable KKT structure and
per-query residual diagnostics exposed by sensitivity views. Version 7 reports
retain these claims; version 2–6 reports are verified with their original maps
and dense rank audit before upgrade.
The feature builds against published POUNCE 0.13.0 and PowerIO 0.11.8. Build and test the native feature from the repository root:
cargo build -p tellegen --no-default-features --features mc-opf --locked
cargo test -p tellegen --no-default-features --features mc-opf --locked
bash scripts/check-mc-opf.sh tests a temporary archive of committed source with
all features, MC OPF alone, and strict all-target Clippy using the locked
dependencies. Its optional PowerIO checkout argument is for companion development:
it patches all eight PowerIO crates only in the temporary archive and does not
rewrite either checkout’s lockfile. A companion checkout is not required.
See Formulations for the electrical profile and derivative strategy, Validation for acceptance and regression coverage, and Methodology for optional external studies. Ordinary frozen-reference tests need neither Julia nor the large ENWL dataset. The existing solver release and distribution gates below also apply to MC OPF.
License and release gate
POUNCE is EPL-2.0 while Tellegen is MIT. deny.toml admits EPL-2.0 only for the
named POUNCE crates, and scripts/epl-guard.sh proves POUNCE is absent from the
default engine and all shipping adapters while present in the opt-in probe.
That mechanical boundary is not legal approval. Before distributing a native
binary or WASI asset containing POUNCE, the release owner must approve the
EPL-2.0 obligations, include its license/notices, and provide a reasonable
corresponding-source location. Problem::Acopf remains unavailable in the
default native engine and shipping adapters; the website uses the separate
worker reactor.
On 29 October 2026 Samuel Talkington, the release owner, approved EPL-2.0 distribution of POUNCE in the website’s WASI asset. The website build meets the obligations as follows:
- POUNCE is used without modification.
POUNCE-EPL-2.0.txt(the license) andPOUNCE-NOTICE.txt(the notice) are served beside the asset under/experimental-acopf/. POUNCE-SOURCE.json, beside the asset, gives the corresponding source: the crates.io archive URL and SHA-256 of each of the 14 POUNCE crates, the upstream tag, the Tellegen commit the deployed image was built from, and the asset’s own SHA-256 and size. The deployed asset’s manifest records"development_only": false; local builds still recordtrue.- The
/creditspage links all three files.
Remaining release gates
The released dependency and restoration-driver gates are implemented. Gate 1 is complete. The release owner enabled the experimental calculation on the public website with gates 2 to 5 still open; they are not complete:
- Release-owner approval of EPL-2.0 distribution obligations. Approved on 29 October 2026; see the section above.
- Resolve the inherited PowerIO → ZIP advisory failures using a reviewed, patched PowerIO release; no advisory exception is added here.
- Repeat the independent corpus check on the final Tellegen release artifact and intended browser/platform matrix. The draft’s local validation is not a certificate for a different artifact.
- Complete repeated performance and peak-memory measurements, including stressed starts, beyond the correctness and lifecycle checks recorded here.
- Compare the 14/30/300 expressions against independently frozen benchmark values in addition to the physical validator and finite-difference checks.
The optional browser corpus regression uses the production importer and worker, checks the served WASM hash against its manifest, and requires checksum-keyed independent objectives. For example, after an opt-in build:
TELLEGEN_ACOPF_CORPUS=/path/to/pglib-opf \
TELLEGEN_ACOPF_REFERENCE=/path/to/reference.json \
TELLEGEN_ACOPF_CASES=pglib_opf_case14_ieee,pglib_opf_case30_ieee,pglib_opf_case300_ieee,pglib_opf_case6468_rte \
PLAYWRIGHT_JSON_OUTPUT_NAME=/path/to/browser-results.json \
npm --workspace tellegen-frontend exec -- playwright test ac-opf-experimental.spec.ts --workers=1 --reporter=list,json
The reference JSON has the same provenance and SHA-256-keyed objectives
format as acopf_benchmark. Each test attaches the full response, input hash,
artifact manifest and elapsed time. External corpus tests skip explicitly when
these paths are absent; the four ordinary UI/lifecycle tests still run in CI.
A failure of expression-DAG scaling changes the private solver adapter, not the PowerIO problem or solution contract.
Input preparation safeguards
PowerIO 0.11.5 filters inactive loads and shunts during preparation; Tellegen uses that preparation directly and retains a regression covering source rows, selected constraints, objective and explicit warm-start voltages. Networks claiming to be normalized while retaining inactive injections are rejected. Selected voltage, generator, thermal and angle bounds are checked before model construction. Zero thermal ratings remain unlimited. Small full-pi directional derivative checks run in ordinary CI, with a complex-current branch-flow oracle independent of the polar coefficient transcription.
Review diagnostics and benchmark timing
Compact AC OPF primal_residual is the maximum independent P/Q balance mismatch
in MW/MVAr. The optional residuals object separates voltage and generation
bounds, reference/branch angles, thermal limits, epigraph gaps and objective
agreement, with explicit units. Acceptance still checks every residual family;
objective agreement is not presented as a power mismatch. Compact flow output
includes three-winding transformer legs using the same synthetic IDs as SOCWR.
Portable solutions retain the caller’s producer and append POUNCE’s exact final
status, including Solved_To_Acceptable_Level.
The benchmark emits compact objective/status/iteration records, input and
artifact hashes, parse_ms, solve_ms, and total_elapsed_ms. Solve timing
includes model construction and independent validation but excludes parsing,
file hashing and JSON serialization. Earlier elapsed_ms records measured the
full input/JSON/solve path and must not be compared directly with solve_ms.
The base restoration count survives retry promotion; restoration_calls remains
the selected attempt’s count. Neither field claims to total all retries.
Portable producer metadata appends the base verdict, promotion label and both
counts when recovery succeeds. Tests separately cover cancellation before retry
initialization and cancellation from an in-flight retry’s iteration callback.
The EPL dependency-leak guard does not need Python. The separate release-pin
verification remains mandatory in Rust CI and the WASI build, requires Python
3.11+, and reports that requirement explicitly on older interpreters. Set
PYTHON for the WASI build when the system python3 is older.
Architecture
tellegen is a differentiable power flow and optimal power flow engine written
in Rust for native targets and WebAssembly. The public browser packages are
@tellegen/engine, @tellegen/svelte, and @tellegen/webmcp; the SvelteKit
hosted demo is one private consumer.
Repository layout
A Cargo workspace and a web app, side by side.
crates/tellegen: the engine. It parses a case through powerio and solves the requested supported formulation. One result envelope carries the fields and sensitivities that formulation defines.crates/tellegen-wasm: thewasm-bindgenadapter that exposes the engine to the browser, built withwasm-pack.crates/tellegen-server: a native HTTP server that serves the bundled cases and the static app.crates/tellegen-cli: a command line front end over the engine’s JSON API.crates/benchmarks: a private harness that runs the PGLib-OPF corpus for validation and timing.packages/engine: the public browser engine package, TypeScript types generated from Rust, and browser wasm transport.packages/svelte: the public Svelte component package for maps, panels, local case files, and browser solves.packages/webmcp: WebMCP tool definitions, validation, and registration lifecycle.apps/web: the private SvelteKit hosted demo that consumes@tellegen/svelte.examples/browser-minimal: a minimal downstream app that imports@tellegen/enginedirectly.examples/svelte-minimal: a minimal downstream app that imports@tellegen/svelte.
powerio owns parsing and the network and display formats; the engine and the app depend on it.
The engine
Default builds of crates/tellegen solve four formulations through one
interface:
- DC power flow and DC OPF: a B–θ linear/quadratic program;
- AC power flow: a polar Newton solve; and
- SOCWR: the Jabr second-order cone relaxation of AC OPF, in W-space.
The non-default native acopf feature adds a fifth, development-only path: an
exact polar AC OPF model solved through POUNCE. It has independent primal
validation and portable PowerIO solution emission, but no shipping adapter,
dual/sensitivity contract, or distribution approval. A separate unpublished
WASI adapter and one-shot worker expose the canonical base-case solve for
development and CI; ordinary browser builds do not contain its POUNCE asset.
The formulations share one result envelope, but they do not claim the same
quantities. DC power flow returns angles and branch flows without prices,
optimized dispatch, or sensitivities. DC OPF adds dispatch, objective value,
LMPs, and KKT sensitivities. AC power flow returns voltages and nodal
injections with Newton sensitivities. SOCWR exposes the quantities and conic
KKT sensitivities defined by the relaxation. Formulations that implement the
Differentiable trait accept an output Operand and input Parameter;
the common driver solves the retained KKT or Newton system for the requested
forward or adjoint columns.
The default engine is Rust and compiles to WebAssembly, so the same code runs
natively and in the browser. The convex solves use Clarabel; the sensitivities
use faer. The exact AC OPF backend runs in opt-in native builds and in the
separately built experimental WASI worker.
Turning it into a shipping native product remains on the
desktop and mobile roadmap; browser support uses a
separate WASI worker because the ordinary browser solver build is single
threaded and uses wasm32-unknown-unknown.
The two API faces
One numerical core, two faces that share a driver and a result type:
- Stateless:
solve_module(module, request)andcapabilities_json(). Each call reads a PowerIO module, solves its declared problem instance, and returns. - Stateful: the
Study. It starts from a PowerIO module and builds the private solver workspace once.commitapplies a set ofNetworkEdits and re-solves exactly, optionally returning the requested sensitivity columns in the same solve;previewreturns a first order update at the committed point with no re-solve.
Browser packages
packages/engine is the reusable package surface. It exports the generated
types, case and display parsing helpers, module based solves, capabilities,
the browser Study, and the browser wasm transport. It has no SvelteKit
dependency.
packages/svelte consumes @tellegen/engine and exports the map, panels, local
file flow, solve card, state provider, and full viewer as Svelte components.
packages/webmcp exports tool definitions, runtime validation, and registration
through an adapter that does not depend on Svelte or the engine package.
apps/web consumes the Svelte package and keeps demo concerns: routes, SEO,
credits, privacy, deployment, and bundled case pages.
In the browser
@tellegen/engine ships one wasm package built from crates/tellegen-wasm
(the conic feature): DC power flow, DC OPF, AC power flow, SOCWR, the
Study, and the sensitivity columns. A browser that cannot load it does not
solve; the hosted demo shows a notice, and the server’s compute endpoints
exist as an opt-in fallback (TELLEGEN_SERVER_COMPUTE).
The Svelte package and the hosted app use Study for DC OPF, AC power flow,
and SOCWR. preview returns a first order update for the quantities the chosen
formulation defines; commit performs an exact re-solve and can return the
displayed sensitivity column. DC power flow uses the stateless solve path, and
full nonlinear AC OPF is unavailable in the shipping browser package.
Supported solvable case files run in the browser and are not uploaded.
Sources
- Rust to WebAssembly: wasm-bindgen, wasm-pack
- Solvers and linear algebra: Clarabel.rs, faer
- Convex relaxation: R. A. Jabr, “Radial distribution load flow using conic programming,” IEEE Transactions on Power Systems, 21(3), 2006.
- Svelte:
$state
Release Architecture
The public browser surfaces are @tellegen/engine, @tellegen/svelte,
@tellegen/webmcp and @tellegen/analytics.
Stable release surfaces:
crates/tellegenRust API layer, including the serde request and response shapes insrc/api.rs;crates/tellegen-wasmwasm adapter;packages/engineTypeScript package, generated TypeScript types, and browser wasm entry points;packages/svelteSvelte component package;packages/webmcpWebMCP tool definitions and runtime validation without a UI framework dependency;packages/analyticsallowlisted usage analytics with a first-party Umami Cloud sender, no dependencies;- examples under
examples/.
The hosted demo under apps/web is one consumer of the packages. It keeps
routes, SEO, credits, privacy, and deployment specific behavior.
JavaScript Workspace
The repository uses npm workspaces with one root package-lock.json for:
packages/engine;packages/webmcp;packages/analytics;packages/svelte;apps/web;examples/browser-minimal; andexamples/svelte-minimal.
Install JavaScript dependencies from the repository root:
npm ci
Root scripts define the package order:
npm run wasmbuilds the one wasm module (featuresconicandsynth) intopackages/engine;npm run build:enginebuilds@tellegen/engine;npm run build:webmcpbuilds@tellegen/webmcp;npm run build:analyticsbuilds@tellegen/analytics;npm run build:sveltebuilds@tellegen/svelte;npm run build:examplebuilds both downstream examples;npm run check:web,npm run build:web, andnpm run smoke:webgate the hosted demo;npm run pack:enginepreviews the engine npm package contents;npm run pack:webmcppreviews the WebMCP npm package contents;npm run pack:analyticspreviews the analytics npm package contents;npm run pack:sveltepreviews the Svelte npm package contents.
Versioning
@tellegen/engine, @tellegen/svelte, @tellegen/webmcp and
@tellegen/analytics use independent package versions.
Before 1.0, releases can refine public APIs while preserving the examples and
hosted demo behavior. After 1.0, breaking public TypeScript, Svelte prop, or
Rust API changes require a semver major version.
Examples of breaking changes after 1.0:
- removing or renaming public exports;
- removing or renaming request or response fields;
- changing enum tags, formulation ids, solve status tags, operand tags, or parameter tags;
- changing field units or meanings;
- tightening optional fields to required fields; and
- changing serialized request or response shapes.
Nonbreaking changes can ship in a minor version:
- adding optional fields;
- adding formulations, operands, parameters, statuses, or helper exports while preserving existing meanings; and
- adding component props with defaults.
Patch versions are for bug fixes and docs that do not change public APIs.
Saved cases
Tellegen saves the materialized network as a stored PowerIO module. The module
keeps applicable records, severs source linkage invalidated by edits, and adds
descriptive edit history. Loading it starts a fresh runtime Study at the
saved point. Its history records transformations applied to the stored value.
Exact OPF results are stored as PowerIO solution modules containing the instance that was solved.
Releasing
Package versions and the crate version move independently, so two release bots drive the pipeline. A release that touches one surface publishes that surface only.
Nobody cuts a tag by hand. This repository stores no registry token. Both
registries authenticate with OIDC, and each exchange runs in a deployment
environment (crates-io, npm). Reviewing and merging the generated version
pull request is the final human publication gate. Publication after that merge
is unattended.
Each environment allows deployments from main only and has no required
reviewer. Set the same environment on the registry’s trusted publisher, along
with the repository and workflow filename. The workflow also rejects non-main
refs; the publisher binding makes the registry enforce that identity.
Enabling the pipeline
The release workflows do nothing until the TELLEGEN_RELEASE_ENABLED repository
variable is true. What they need lives outside the repository. Set the
variable after you make all of these:
- a
crates-ioenvironment and annpmenvironment, each with a deployment branch rule limited tomainand no required reviewers; - a crates.io trusted publisher for
tellegen, set to this repository,release-crate.yml, and thecrates-ioenvironment; - an npm trusted publisher for
@tellegen/engine,@tellegen/svelte,@tellegen/webmcpand@tellegen/analytics, each set to this repository,release-npm.yml, and thenpmenvironment. The publisher binds to the workflow filename. If you rename the workflow, publishing stops until you change the publisher; - a GitHub App on this repository with
contents: writeandpull-requests: write. Put its id in theRELEASE_PLZ_APP_IDvariable and its private key in therelease-botenvironment’sRELEASE_PLZ_APP_PRIVATE_KEYsecret. Restrict that environment tomain. Both release bots use it so their version pull requests start CI. Pull requests opened byGITHUB_TOKENdo not start workflows.
Keep deployment credentials in the main-only demo environment. No deployment
or Release App credentials belong at repository scope; only the jobs bound to
their environments receive them. The temporary migration workflow is removed
after its environment-only aliases prove that all copied credentials match.
The current main ruleset requires pull requests, merge commits and CI checks;
it blocks force pushes and deletion. It does not require the branch to be
up to date before merging. It requires zero
approvals and does not require approval of the last push, so a sole maintainer
can release after reviewing the final changes and checks. The version
pull-request merge is the publication gate. If independent approval becomes
required, set at least one approval and dismiss stale approvals or require
approval of the last reviewable push. Do not give the Release App a ruleset bypass.
For npm and crates.io, bootstrap a missing package before configuring its trusted publisher. PyPI supports a pending publisher that creates the project on the first OIDC upload; its setup is described below.
Check all four npm publishers with npm trust list @tellegen/<name>. A package
previously published by hand still needs its own publisher; configuring the
engine does not configure WebMCP. After npm login, the command is
npm trust github @tellegen/<name> --file release-npm.yml --repo eigenergy/tellegen --env npm --allow-publish.
It requires npm’s interactive two-factor confirmation. A partial publish can
be retried: already published versions are retained, and remaining packages
publish through the same workflow.
Separate AC OPF download
Each stable crate release also builds the isolated POUNCE WASI reactor from
that exact tag and attaches it to the existing GitHub release. The download
contains tellegen_acopf_wasi.wasm, POUNCE-EPL-2.0.txt, POUNCE-NOTICE.txt,
POUNCE-SOURCE.json and ACOPF-SHA256SUMS.txt. It remains separate from the MIT
engine packages. The manifest records the reactor ABI, engine version, full
source revision, source archive and POUNCE crate checksums. This preserves the
license and corresponding-source information distributed with the website.
Consumers pin a release URL and reactor hash, rather than the changing demo
URL. The publisher never replaces existing release assets: a retry verifies
identical bytes and uploads only missing files. A source or toolchain change
needs a new release. To backfill an existing stable tag, dispatch
release-acopf.yml on main with tag=vX.Y.Z; it accepts only an existing
release whose tagged commit is part of main.
Delete any NPM_TOKEN or CARGO_REGISTRY_TOKEN repository secrets. The
workflows do not read long-lived registry credentials.
Packages
@tellegen/engine, @tellegen/svelte, @tellegen/webmcp and
@tellegen/analytics release through changesets.
A change to any of these packages needs a changeset. Run npm run changeset
and commit the file it writes. See .changeset/README.md.
On a push to main, .github/workflows/release-npm.yml keeps a “Release
packages” pull request open. That pull request applies every pending changeset:
version bumps, changelog entries, the engine ENGINE_VERSION, and the
lockfile. Merge it to run the gates and publish. Tags take the form
@tellegen/<name>@X.Y.Z.
The workflow selects version or publish mode before it requests privileged
permissions. Only publish mode runs the Rust and JavaScript gates; version mode
refreshes the pull request, whose CI runs them. Versioning runs without the GitHub App, validates an exact output
allowlist, and passes a SHA-256-verified patch to a fresh runner. That runner
revalidates and commits the patch before minting the App token; only git and
gh run afterward. Publishing builds immutable tarballs in an unprivileged
job, then gives only the final npm job the npm environment and OIDC
permission. Merging the version pull request is therefore the only manual
release action.
@tellegen/svelte resolves @tellegen/engine from the registry, so a release
that moves both publishes the engine first.
Crate
tellegen is the only crate that publishes to crates.io. tellegen-wasm,
tellegen-server, tellegen-cli, tellegen-py, and benchmarks carry
publish = false, and the release-plz workspace defaults to release = false.
A new crate needs an explicit package opt-in.
On a push to main, .github/workflows/release-crate.yml keeps a pull request
open that bumps the version. Merge it to run the gates, continue the existing
vX.Y.Z tag series, make the GitHub release, and publish. The configuration
sets release_always = false, limiting publication to a merged release-plz pull
request. The unprivileged gate runs cargo package --locked --features sensitivity,mc-pf,conic,acopf,mc-opf,schema, so every
shipping numerical feature builds against crates.io; the OIDC-enabled
release skips build verification because those unprivileged gates have already
verified the package against that exact commit. release-plz obtains its
short-lived crates.io credential directly from OIDC.
While the workspace resolves PowerIO from a temporary git pin (a
[patch.crates-io] section, used only until a PowerIO release reaches
crates.io), this packaging check fails, because packaging ignores [patch];
that keeps the crate from publishing ahead of its PowerIO dependency. The
powerio-012 feature is a no-op and is not in the list.
The release API comparison also uses --only-explicit-features with that list:
cargo-semver-checks otherwise enables non-default features heuristically.
release-plz itself has semver_check = false because this read-only gate owns
API comparison. Ordinary Cargo publication and docs builds use default features.
The workflow’s first job decides whether the push can publish: its engine
version has no v<version> tag yet, and the push writes
crates/tellegen/CHANGELOG.md, which only the release pull request does. Only
then do the Rust gates and the publish job run. Any other push, including every
push between a version raised by hand and its release, only refreshes the
version pull request, which runs CI itself. A manual run, or a tag list or diff
that cannot be read, plans a publish and leaves the decision to release-plz.
While a release publishes, the version update waits for the gates, as it always
has.
The crate update uses the same sealed-patch privilege boundary as package
versioning. After release-plz update, an unprivileged step
(.github/scripts/sync_python_version.py) sets the Python wheel’s package
version and its Cargo.lock entry to the engine’s, without resolving or
updating any dependency, and cargo metadata --locked checks the result. The
patch then holds one of three path sets: the engine changelog alone (a version
already raised by hand on main); the engine manifest, its changelog, and the
lockfile; or those three and crates/tellegen-py/Cargo.toml, in which only the
package version may differ from the checkout. In every case the validator
requires both manifests and both lock entries to carry the engine’s version,
before the patch is sealed and again after it is applied, before the App token
is minted. A wheel already on the new version needs no edit, and an update with
no release stays a no-op.
After a crate release succeeds, release-crate.yml dispatches
release-python.yml on main with the published tag. It resolves the tag to an
immutable commit, confirms it belongs to main and has a published GitHub
release, and runs the Python gates against that source. The gates check the
installed extension’s type stubs, test Python 3.11 and 3.13, build five platform
wheels, and build and solve a case from the source archive. Test fixtures are
excluded from the source archive; the package includes its MIT licence and
all solver build inputs.
Only the final, checkout-free job has id-token: write. Its pypi environment
is restricted to main, and its trusted publisher is eigenergy/tellegen,
workflow release-python.yml, environment pypi. PyPI does not support a
reusable publishing workflow, so the crate workflow dispatches this standalone
workflow instead of calling it. A pending publisher configured at
https://pypi.org/manage/account/publishing/ creates the project on its first
OIDC upload; no bootstrap API token or manual first upload is necessary.
To retry an interrupted publication, dispatch release-python.yml on main
with the same stable tag. Existing distributions are skipped; published
versions and their source commits are never replaced. Add the public install
command to the README and Python guide only after the first upload is verified.
Its fixed release-plz-main branch is intentional: with
release_always = false, release-plz recognizes a release commit by the
release-plz- head prefix. Merge this generated pull request with a normal
merge commit, not squash, so its release commit remains unambiguous if another
change reaches main nearby.
An emergency repair to a generated crate release must retain its
release-plz-* branch name; that is how release_always = false recognizes the
merged release commit.
Inspecting an artifact
.github/workflows/package-inspect.yml is a manual run. It builds the artifacts
a release would upload, cargo package and all four npm pack tarballs, and
attaches them to the run. It publishes nothing.
Changelogs
Each surface keeps its own generated changelog:
crates/tellegen/CHANGELOG.md, packages/engine/CHANGELOG.md,
packages/svelte/CHANGELOG.md, packages/webmcp/CHANGELOG.md and
packages/analytics/CHANGELOG.md. The root CHANGELOG.md is the archive of
the releases before the split. Nobody edits a changelog by hand, including on a
release pull request.
The crate changelog lists the pull requests merged since the previous release,
one entry each, under its title. release-plz writes a section for the new
version from commit subjects, but on this repository most of those read “Merge
pull request #N”, and it walks the history along one parent at a time, which
can miss a pull request. So the crate release workflow then runs
.github/scripts/write-crate-changelog.py, which replaces that section’s body.
It reads the first-parent merge commits since the last v* tag, keeps those
that changed crates/tellegen/ or a root Cargo.toml entry the crate builds
with, and skips Dependabot, release-plz and changesets merges and version-only
bumps. A title starting feat: files the entry under Added, fix: under Fixed,
and !: under Breaking; anything else goes under Changed. Write pull request
titles for a reader of the changelog. The section itself must stay, because
release-plz release takes the GitHub release body from it, so the
commit_parsers in release-plz.toml keep merge commits.
CI Gates
.github/workflows/gates-rust.yml and .github/workflows/gates-js.yml define
what green means. CI calls both on every pull request and every push to main.
The crate release calls the Rust gates, and the npm release calls both before
it publishes. Add a gate to those files, not to a caller.
CI runs only the gates a change can affect. Its scope job runs
.github/scripts/ci-scope.py on the changed paths: a pull request’s against
the branch it merges into, a push’s against the last main commit whose CI
passed. The Rust and JavaScript gates and the image build run unless every
changed path is one the script names as unable to affect them; a path it does
not name runs them. A version bump that only moves tellegen and tellegen-py
in their manifests and Cargo.lock runs only the Rust gates. A missing base, a
failed or empty diff, or a change to the scoping itself runs every gate. A gate
that does not apply still reports its required check, as skipped. The release
workflows call the gates without this scope, so a release always runs them in
full. .github/scripts/test-ci-scope.py pins the rules, and checks them
against the files the gates and the Dockerfile read. Change both when a gate
starts reading a new path.
The Rust gates are cargo fmt --check, clippy with warnings denied on the
shipping crates, cargo-deny, the EPL guard, the workspace tests, the engine’s
conic path, tellegen-wasm built with conic and synth, and
cargo package --locked --features sensitivity,mc-pf,conic,acopf,mc-opf,schema for the published crate. The wasm test matters
because tellegen-wasm declares default = [], so the workspace run skips the
tests that assert an untrusted package or case rejects rather than panicking.
The JavaScript gates install once from the root lockfile, check and pack
packages/webmcp and packages/analytics, build and check packages/engine
before packages/svelte,
run the engine import smoke test, check the Svelte package through a packed
temporary consumer, build the hosted demo, and run its browser tests. just ci
runs everything locally.
Formulations
Tellegen solves DC power flow, DC OPF, AC power flow, and the Jabr SOCWR relaxation through the PowerIO module boundary. The shared response has optional fields for the quantities each formulation produces. Economic fields are present only when the declared objective gives them that interpretation. Supported implicit derivatives use the interface described in the sensitivity interface.
DC power flow and DC OPF (B–θ)
The default is unchanged. Select an explicit branch convention to match PowerModels DCP/PGLib DC or MATPOWER/PowerModels DCMP; see the optimality compatibility matrix. Phase-shifting variants include an affine branch flow and nodal injection term in addition to the angle-dependent matrix below.
The linearized power flow couples bus angles $\theta$ to injections through the susceptance-weighted graph Laplacian
$$ B = A^\top\operatorname{diag}(b)A, \qquad B\theta = p, $$
where $A$ is the branch by bus incidence and $b$ contains positive solver
weights derived from the public branch susceptances. The OPF
minimizes generation cost subject to the network balance and the thermal and
generation limits; it is a convex quadratic program solved with Clarabel.
solve_module_json is the portable entry. Rust callers that already own a
DcOpfInstance can use solve_instance.
MATPOWER model 2 quadratic generator costs are read directly. Convex model 1 piecewise linear costs use one epigraph variable and one inequality per segment, so dispatch, objective values, prices, and supported implicit derivatives refer to the declared curve. Malformed and nonconvex model 1 rows are rejected before the program is assembled. At a breakpoint or an active set change, the marginal value or its derivative need not be unique; the sensitivity API reports the local KKT linearization and numerical checks identify stencils that cross a different active set.
Linear constraints
A DC OPF request may add linear constraints over branch flows, bus net injections, and generator outputs. This is the usual way to state an interface or transfer limit: a bound on a weighted sum of flows across a cut of the network.
{
"formulation": "dcopf",
"constraints": [
{
"id": "north-south",
"terms": [
{ "kind": "branch_flow", "element": 3, "coefficient": 1.0 },
{ "kind": "branch_flow", "element": "branches:7", "coefficient": 1.0 }
],
"upper": 400.0
}
]
}
Each constraint states $l \le \sum_t c_t,q_t \le u$ in MW. Either limit may be
omitted, but not both; equal limits state an equality. A term’s kind selects
its quantity $q_t$:
kind | quantity | element |
|---|---|---|
branch_flow | from-end active flow, positive from from to to | 1-based branch position or uid |
bus_injection | net injection: generation minus demand and shunt withdrawal | bus id or uid |
generator | active output | 1-based generator position or uid |
Terms naming the same quantity add. An element that is unknown, out of service, on a de-energized island, or synthesized while lowering a three-winding transformer is refused by name. A bus injection enters the program as the flow leaving the bus on its branches, which equals the net injection by power balance. The constraint rows therefore never depend on demand, and the reported LMP stays the marginal cost of demand at each bus.
The response adds a constraints block in request order with each row’s
value, lower, upper, binding, and shadow_price. The shadow price is
$\mu = -\partial(\text{objective})/\partial(\text{limit})$ in the LMP’s units:
positive when the upper limit binds, negative when the lower limit binds, and
zero when neither does. Prices then decompose against any reference bus $r$
in the bus’s island:
$$ \lambda_i = \lambda_r - \sum_\ell \mu_\ell , s_{\ell i}, $$
where $s_{\ell i}$ is the change in constraint $\ell$’s value per MW injected at bus $i$ and withdrawn at $r$, and the sum also runs over binding line limits. The shadow price is omitted, like the LMP, when the declared objective is a feasibility objective.
Linear constraints are a DC OPF feature; DC power flow, AC power flow, and
SOCWR refuse a request that carries them. The DC KKT system carries a
multiplier for each stated limit, so sensitivity cells differentiate the
constrained program. The ConstraintLimit parameter differentiates with
respect to a constraint’s limits, shifting both by the same MW. Its columns are
keyed by the constraint’s position in the request. A Rust Study carries
constraints through every commit with Study::set_constraints. Previews,
planning, and objective gradients see them. While it has any, it refuses to save
the problem instance or its solution, since the PowerIO problem instance has no
place for them.
On the command line, the default command takes the request as its argument,
tellegen capabilities lists the accepted term kinds under each formulation’s
constraints, and tellegen describe includes the solve_request and
solve_result schemas:
tellegen '{"constraints":[{"id":"north-south","upper":400,"terms":[{"kind":"branch_flow","element":3,"coefficient":1}]}]}' < case.pio.json
Limits at scale
The program has no row for a limit it does not enforce, and no shedding variable for a bus that cannot shed. A portable solve never sheds, so that removes a column and a row pair per bus. These pinned pairs have no interior, and on PGLib’s 78,484-bus case they kept the interior point solve from converging at all.
A DC OPF request may also choose which limits the program carries:
{ "formulation": "dcopf",
"limits": { "angle_difference": false, "thermal": "rated", "lazy": {} } }
angle_difference: falsedrops the angle-difference rows, two per branch.thermalkeepsalldeclared thermal limits (the default), only theratedones (an unrated branch’s synthesized limit is dropped), or the limits of a list ofbranches.lazysolves with no thermal limit enforced, adds every enforceable limit the flows violate or meet together with those loaded at or abovenear_binding(default 0.98), and solves again until every limit left out is strictly slack, for at mostmax_rounds(default 20) solves. A solution that violates none of the limits it was not held to is optimal for the program with all of them, so prices and dispatch match the full solve.
With limits, the response’s limit_rounds reports each solve: the limits it
enforced, the violations it found, the limits it added, its program size, and
its interior point iterations. Keep the angle-difference rows with lazy when
every generator cost is linear. Without them, the first round bounds no angle
or flow, which can stall the interior point method on a degenerate linear
program. The dcopf-scale-bench binary in crates/benchmarks measures each
option on PGLib’s case78484 and on a synthetic 100k-bus mesh.
Limit options combine with linear constraints and with several islands: every
round carries the request’s constraint rows and one reference row per island.
Sensitivity cells differentiate the program the last round solved, in which a
limit left out holds a zero multiplier. With lazy that is the full program’s
derivative: the last round leaves out only limits with slack, which the full
program would also hold at a zero multiplier, and a limit the flows meet exactly
joins another round rather than being left out at its bound. With thermal
set to rated or a list of branches, or with angle_difference: false, it
is the derivative of the reduced program the request asked for: a dropped limit
stays dropped when the parameters move, even if the flows would then cross it.
Branch angle-difference bounds are enforced in radians, as PowerIO prepares
them. MATPOWER’s unconstrained -360/360 spelling and an unset 0/0 pair
take PowerIO’s PowerModels pad, ±1.0472 rad (PowerModels’ own constant for 60
degrees, 2.4e-6 rad wider than π/3). When a branch has no thermal rating,
PowerIO synthesizes its fallback rating over that padded window and the
terminal voltage bands. Explicit tighter source bounds are preserved.
Islands
A network may hold several islands: sets of buses joined by in-service branches and three-winding transformers but not by each other. Every formulation solves each supplied island on its own terms. The DC programs fix the angle at every reference bus. The AC power flow keeps one slack per island, and each island’s slack absorbs that island’s balance. With nothing to trade across islands, each island clears at its own price.
Two kinds of island need a decision first, and the response’s diagnostics
block reports each one:
island_deenergized: an island with no in-service generator cannot serve its load, so it is left out of the solve. Its buses carry no results, and the message states the unserved load in MW.island_reference_designated: a supplied island that states no reference bus gets one at the bus of its largest generator bypmax, the rule PowerIO applies to a network with no reference at all.
The AC power flow also reports island_extra_reference when one island states
several reference buses. The first one is the slack, and the others hold their
voltage magnitude as PV buses, or as PQ buses when they host no generator.
AC power flow (polar)
The nodal power balance in polar coordinates,
$$ S_i = V_i \sum_j \overline{Y_{ij}} \overline{V_j}, $$
is solved by Newton–Raphson on the reduced system
$\partial(P, Q)/\partial(\theta, V_m)$. Buses are typed slack / PV / PQ (PV and
slack buses hold the generator voltage setpoint; PQ buses solve for both angle and
magnitude), and the solve takes damped steps with a backtracking line search from
the setpoint start plus a few perturbations, keeping the lowest-residual result.
Each island’s slack holds its stated reference angle (zero at a designated
reference), and every other angle in the island is measured on it. Select acpf
in solve_module_json.
"start": "case" starts Newton from the case’s stored bus voltages instead:
each bus’s stored magnitude, and its stored angle relative to its island’s
reference bus. Star buses of three-winding transformers start from the transformer’s
stored star voltage, and a typed AC power flow instance’s initial point
overrides the stored values. A bus whose stored magnitude is not positive
starts at its setpoint, and a stored state that does not converge falls back to
the flat start. A case saved from a converged solve needs no Newton steps. The
default is "start": "flat"; other formulations refuse "case", since none of
them iterates from a start.
The response reports the successful start in initialization. For example,
{"requested":"case","used":"flat","attempts":2} means the stored-case
attempt failed and the flat fallback converged. A perturbed success includes
restart (1 through 4); attempts counts every attempted start. Unsuccessful
solves still return an error with the best mismatch and the number of starts.
The Newton iteration count describes the successful attempt’s final Q-limit
round, so it does not measure all work spent on failed attempts.
Voltage-dependent loads
A load may state a ZIP or exponential voltage model (PowerIO’s
LoadVoltageModel). The AC power flow solves it exactly: the load draws its
power at the bus voltage at every Newton iterate, and the Jacobian carries the
load’s voltage derivative. With $x = V_m / V_n$, the bus voltage magnitude
against the load’s nominal voltage,
$$ P_L(V_m) = P_0 + P_1 x + P_2 x^2 + \sum_k P_k x^{\gamma_k}, $$
and $Q_L$ likewise. $P_0$, $P_1$, $P_2$ are the ZIP constant-power,
constant-current and constant-impedance parts, each stated as the part’s power
at the nominal voltage (MW, in the load’s own unit; the parts sum to the load’s
stated p). The stated p and q stay authoritative: whatever they hold
beyond the current, impedance and exponential parts is constant power, so a
p edited without its parts keeps the edit. An exponential load contributes $p,x^{\gamma}$; $\gamma = 0$, 1
and 2 are constant power, current and impedance. The Newton Jacobian is
$\partial(P_{calc} + P_L)/\partial(\theta, V_m)$, so each load adds
$\mathrm{d}P_L/\mathrm{d}V_m = P_1 / V_n + 2 P_2 x / V_n + \sum_k \gamma_k P_k x^{\gamma_k - 1} / V_n$
to its bus’s active row and magnitude column (and the same for $Q$). A load at
a PV or slack bus is evaluated at the held voltage; a PV bus that reaches a
reactive limit becomes PQ, and its load’s derivative then enters the system.
The slack’s injection balances the losses and every load at the solved
voltage.
The nominal voltage $V_n$ is optional, and every PowerIO reader leaves it out:
the load is then stated at the bus base voltage ($V_n = 1$ pu). A stated
v_nom carries no unit, so it is read against the bus base, as kV
(v_nom / base_kv) or as per unit (v_nom). A reading is plausible in
$[0.5, 2]$ and usual in $[0.8, 1.25]$. The reading taken is the only plausible
one, or the only usual one when both are plausible: a 0.4 kV bus with
v_nom = 0.4 and a 0.69 kV bus with v_nom = 0.69 are both 1 pu. A value that
reads usually both ways but differently (a 0.9 kV bus with v_nom = 1), or
plausibly but unusually both ways, or neither way, is refused. For an exponent
below one, $x^\gamma$ has an unbounded slope at zero voltage, so below
$x = 10^{-3}$ the term follows its tangent. A load with no constant-power part
and exponents of one or more draws nothing at zero voltage, so $V_m = 0$
solves its bus at any loading, and past the maximum loadability it is the only
solution. A solution with any voltage-dependent load below $x = 10^{-3}$ is
therefore refused as a collapsed voltage (after the other starts have been
tried).
The solve reports load_voltage_dependent with the buses of such loads. The AC
sensitivities differentiate the same Newton system, load derivatives included.
Their demand parameter, like a demand edit, is constant-power demand added at
the bus: at a bus with a ZIP or exponential load it does not scale that load’s
nominal power. A saved or exported case writes the edit onto a constant-power
load at the bus, adding one when the bus has none, so it re-solves to the
committed point. A network with constant-power loads only solves exactly as it
did before. SOCWR and AC OPF hold every load at constant power and refuse a
network with voltage-dependent loads.
Conic SOCWR (Jabr)
The Jabr second-order cone relaxation lifts the voltage product to W-space variables $w_i = |V_i|^2$, $w^r_{ij} = \Re(V_i \overline{V_j})$, $w^i_{ij} = \Im(V_i \overline{V_j})$, with the rotated cone coupling
$$ (w^r_{ij})^2 + (w^i_{ij})^2 \le w_i w_j. $$
The relaxation is a convex lower bound on AC OPF, solved with Clarabel’s
second-order cone support. It uses the same exact quadratic and convex piecewise
linear generator cost representation as DC OPF. Select socwr in
solve_module_json.
These formulations compile to native Rust and WebAssembly.
Experimental native multiconductor IVR OPF
The opt-in mc-opf feature solves unbalanced AC OPF in current–voltage
rectangular (IVR) coordinates, with explicit terminals and neutrals. It has
separate native entry points over McAcOpfInstance; see the
solver decision
for build commands and API availability.
PowerIO owns canonical electrical semantics, source mappings, units, selected bounds and solver-independent IVR preparation. Tellegen compiles that prepared data into expressions, invokes POUNCE, and independently validates the physical result. BMOPFTools is an external reference for tests, not a runtime dependency.
DELTA equipment and THREE_LEG inverters require phase-only terminal maps.
PowerIO preparation rejects neutral and earth endpoints, honoring explicit
terminal conventions. Tellegen reports InvalidInput at Preparation with
BUILD.MULTI.OPF_INVALID, before optimization, for both one-shot solves and
retained-session construction. Two-terminal DELTA remains one phase-to-phase
coil; WYE and SINGLE_PHASE return connections remain supported. Session edits
change numerical values, not terminal roles or connection topology.
Fixed power-factor control uses bounded coefficients:
sqrt((1 - abs(pf)) * (1 + abs(pf))) * P - pf * Q = 0, with signed
0 < abs(pf) <= 1. The sign follows OpenDSS and the BMOPF schema: pf > 0
puts Q on the same side as P, pf < 0 on the opposite side (PowerIO 0.11
prepared the opposite sign). Capability bounds still intersect this physical law.
Acceptance also recomputes the relation from original input profiles and
physical P/Q ledgers, independently of prepared coefficients. Passing an
absolute power-equation tolerance is not a relative PF accuracy certificate.
MC_OPF.POWER_FACTOR_ACCURACY_UNQUALIFIED reports requested and achieved PF
when the requested magnitude is at or below the acceptance tolerance, observed
relative accuracy exceeds that tolerance, the sign relation is wrong, or
zero dispatch makes operating PF undefined. This diagnostic does not declare
an otherwise accepted physical point infeasible.
Public native workflow
The runnable crates/tellegen/examples/mc_opf_workflow.rs example uses only public
PowerIO and Tellegen APIs. From the repository root:
cargo run -p tellegen --no-default-features --features mc-opf --locked \
--example mc_opf_workflow
cargo run -p tellegen --no-default-features --features mc-opf --locked \
--example mc_opf_workflow -- instance.module.json edits.json result.module.json
The first command explicitly promotes the bundled four-bus network to an OPF
instance and increases one load coil’s nominal active power by 1 W. The second
requires a PowerIO IR module containing a declared McAcOpfInstance
and a JSON array of McOpfEdit values. It checks input diagnostics before
extracting the instance, preserving the declared objective, constraints and
initial point. Bare networks require an explicit McAcOpfInstance::from_network
decision in the caller. The walkthrough requires at least one load coil; it
selects that coil’s nominal active power for its derivative query.
An edit file for the bundled feeder could contain:
[{"edit":"load_power","load":"w","p_w":[101,140,80],"q_var":[20,30,10]}]
Names and coil order come from the canonical instance; powers are W and var.
The workflow performs a physical solve, applies the edit batch, enables dual
collection and warm-starts a second solve. It exports and imports the complete
McOpfResult PowerIO report, then reuses one sensitivity view for objective
forward and adjoint queries. The JSON summary on stdout shows physical
residuals, terminal voltages in V, result fingerprints, session counters,
warm-start choice, dual qualification and query diagnostics. The optional third
argument writes the complete report, replacing an existing file at that path;
without it, no file is written. The printed summary is illustrative, not a
versioned persistence format. The report remains the persistence boundary.
The initial physical result has no duals, so its sensitivity query reports
MissingDuals. Edits/options make current sensitivity access report
StaleResult until another solve succeeds. Unavailable sensitivities remain
separate from physical rejection. Solve/import failures exit unsuccessfully;
typed McOpfError failures are printed as JSON on stderr. A physically accepted
result with unavailable sensitivities still exits successfully: inspect the
summary’s sensitivities.status before using derivatives.
The mc_opf module’s report and selector types are also re-exported at the crate
root. McOpfParameter::new constructs a selector and unit() gives its physical
unit; construction does not establish that the parameter exists or is
differentiable at a particular result. McOpfTerminalId::new takes a bus name
and that bus’s local terminal label. These native APIs remain experimental and
opt-in; the generic SolveRequest, Study, CLI, Python and browser adapters do
not gain MC OPF support through this example.
Equations and derivatives
Variables include rectangular terminal voltages, branch and winding currents, continuous taps, and explicit active/reactive power auxiliaries. KCL, fixed shunts, ideal switches and the coupled branch law
$$ V_{\mathrm{from}} - V_{\mathrm{to}} = Z I $$
are affine. Retaining currents avoids inverting zero or singular impedance matrices. Complex power uses
$$ P = V_r I_r + V_i I_i, \qquad Q = V_i I_r - V_r I_i. $$
These links, squared voltage/current limits, and continuous tap products are quadratic. Apparent-power limits use explicit $P,Q$ auxiliaries so that $P^2 + Q^2 \le S_{\max}^2$ remains quadratic; substituting the voltage–current products into this circle would make it quartic. Sequence voltages similarly use affine auxiliaries before imposing norm bounds. Dispatch cost is linear in the active-power auxiliaries.
POUNCE’s exact sparse quadratic evaluator handles these polynomial rows. Each row Hessian is constant; the weighted Lagrangian Hessian still changes with the constraint multipliers. General load laws and smooth inverter controls use POUNCE’s existing sparse automatic differentiation. Finite differences are validation tools, not production derivatives.
ZIP, constant-current and exponential laws use a positive voltage domain via $\ell = \log(|U|/U_{\mathrm{nom}})$ and $|U/U_{\mathrm{nom}}|^2 = \exp(2\ell)$, with power terms expressed as exponentials of $\ell$. This avoids an artificial epsilon floor. Pure impedance laws instead use the affine relation $I = \overline{S_{\mathrm{nom}}}U/U_{\mathrm{nom}}^2$, including at zero voltage; constant-power equivalents use fixed $P,Q$. Smooth volt-var/volt-watt controls use a nonnegative magnitude auxiliary and stable softplus transitions with width 0.002 times the mean physical knot voltage.
Supported electrical profile
- Coupled lines with shunts at both ends, standalone shunts, ideal open/closed switches, and earth-referenced ideal sources with grounded neutrals.
- WYE, delta and two-wire constant-power, constant-current, constant-impedance, ZIP and exponential loads; generators; and connection-aware capacitors. Unequal capacitor coil ratings are lowered to the exact terminal-shunt matrix.
- Single-phase, center-tapped, WYE/delta and fixed n-winding transformers;
Type A/B autotransformer regulators, whose BMOPF ratio is the regulated over
source voltage for both types (
regulator_typerecords the hardware only; PowerIO 0.11 read a type-A ratio inverted); and ABBC/BCAC/CABA open-delta regulators. Preparation preserves polarity, delta roll, leakage coupling, core shunts, neutral impedance/return bonds, and distinct coil and terminal ratings. Supported two-sided subtypes have continuous taps; n-winding transformers have fixed taps and may use mixed connections or two-phase delta windings. - Single-, three- and four-leg inverters, with active/reactive power, current, neutral-return and apparent-power limits; signed power factor; supported phase-ground, phase-neutral and phase-phase volt-var/volt-watt controls with per-phase or averaged sensing; and isolated DC-link active-power coupling.
- Phase-ground, phase-neutral, phase-phase and neutral-voltage limits; positive-, negative- and zero-sequence voltage limits; and bus/line angle windows strictly inside $(-\pi/2,\pi/2)$.
Instance constraint selection uses transformer:<name> in conductor_limits
for transformer limits and ibr:<name> in generator_capability for inverter
capabilities. Droop, power-factor and DC-link equations remain physical laws
when capability limits are deselected.
Preparation rejects unsupported profiles explicitly: DC networks, terminal-referenced source voltages, floating source neutrals, unknown semantic extras, unreferenced conductor islands, ideal cycles or ideal paths joining multiple fixed references, bounded load laws, and unsupported inverter policies. The latter include conflicting power-factor/droop settings, three-leg droop, non-VA-fraction curves and extra minimum-active-power policies. Legacy negative neutral resistance must be normalized upstream to an explicit open connection. A profile rejection is not a proof of electrical infeasibility.
Explicit initial points
Attach a canonical OperatingPoint<MulticonductorNetwork> using
McAcOpfInstance::with_initial_point. Build the point with PowerIO’s
MulticonductorOperatingPointBuilder::for_point(network.clone()). Supported
quantity families are terminal voltage magnitude (V), terminal angle (rad),
load/generator terminal active and reactive power (W/var), and physical
transformer tap coefficients. Families may be omitted independently; a supplied
family must cover all of its canonical identities. Builder vectors use the
point network’s table/terminal order. Projection matches stable identities, so
the target instance may use a different order or numerical bases.
For a converged canonical McAcPfSolution,
mc_opf_initial_point_from_pf(&solution) creates a voltage-only point. When
starting from Tellegen’s McPfResult, first call
result.to_powerio_solution(&pf_instance). This is an explicit caller choice;
the OPF entry point does not run PF automatically.
Only the numerical starting vector changes. Network data, objective, selected constraints, bounds, and the physical fingerprint remain unchanged. Tellegen prepares an equivalent physical instance without its seed, then projects the original point into the compiled IVR coordinates. The returned solution and canonical JSON retain the original physical instance and seed values. Returned seed columns are normalized to the instance’s order for portable JSON. When serializing an input instance directly through PowerIO, construct its point in that instance’s order too; PowerIO’s stored assignment decoder requires matching column order.
Fixed source/ground voltages and fixed transformer taps take precedence, with
MC_OPF.INITIAL_POINT_PROJECTED remarks. Active taps use the canonical physical
coefficient, including the inverse scaling of Type A and Type B regulators. Missing voltages use
the ordinary compiled defaults. Branch/winding currents are inferred from
seeded voltages where consistent; otherwise their unspecified guesses remain
zero, including for inconsistent ideal-branch voltage guesses. Device currents
default to the load law or prescribed power at the seeded voltage. Explicit
load/generator powers are terminal powers, including neutral returns, not delta
coil powers or changes to demand/dispatch limits. They determine current guesses
through the device’s connection incidence. Power, sequence-voltage, droop
magnitude and logarithmic-voltage auxiliaries are then recomputed; compiler
zero reductions still apply.
Nonfinite values, negative magnitudes, nonpositive taps, mismatched identities,
terminal power guesses incompatible with the seeded voltages/connection, and
zero voltages in logarithmic load coordinates return
MC_OPF.INITIAL_POINT_INVALID with a target. Capacitor steps and switch states
return MC_OPF.INITIAL_POINT_UNSUPPORTED: equipment state belongs on the
network. A seed need not satisfy operating limits or KCL and does not guarantee
convergence; the usual physical acceptance gate still applies. Omitting the
initial point preserves the existing cold start.
Retained sessions and edits
McOpfSession::new(instance, options) prepares and compiles a native MC OPF
instance without solving it. solve() uses the last accepted primal when
available. solve_cancellable(McOpfStart::Declared, cancel) instead selects the
instance’s explicit initial point, or its ordinary cold start if absent.
#![allow(unused)]
fn main() {
use tellegen::{McOpfEdit, McOpfSession};
// `instance` is the caller's declared McAcOpfInstance.
let mut session = McOpfSession::new(instance, Default::default())?;
session.solve()?;
session.apply_edits(&[McOpfEdit::LoadPower {
load: "load_1".into(),
p_w: vec![120.0],
q_var: vec![25.0],
}])?;
let accepted = session.solve()?;
let json = accepted.result.to_module_json()?;
}
Edits use canonical identities and equipment ordering. Supported fields are load nominal coil P/Q (preserving its voltage law), inverter availability, generator/source dispatch costs, generator P/Q bounds, line current/apparent power overrides, scalar bus phase-ground voltage bounds, and constraint-family selection. Load edits specify coil powers; initial-point power columns specify terminal powers. Cost units are the canonical currency/kWh, with either a scalar or one value per coil. Removing a line override restores linecode inheritance; removing a scalar bus voltage bound restores any canonical vector fallback.
InverterAvailability takes an explicit per-coil p_max_w vector. It replaces
canonical p_max and sets p_avail to the vector’s sum for controls; None
clears both fields. Other capability fields stay unchanged, and selection still
determines which bounds are enforced. Released PowerIO preparation uses
p_avail as a control reference, so changing that scalar alone would not impose
new dispatch bounds. The session API does not infer a phase allocation or a
separate shared DC-link constraint.
InverterControlProfile patches a named shared profile’s power factor,
volt-var breakpoints/q limits, or volt-watt breakpoints/p limits. None leaves
that field unchanged. Breakpoints are positive, strictly ordered volts; output
limits are finite dimensionless fractions in canonical array order. The edit
affects every inverter using the profile. Existing control families, voltage and
power references, aggregation and assignments stay fixed. Power factor must
satisfy 0 < |pf| <= 1. Invalid edits reject the entire batch.
A nonempty edit batch is applied to a candidate instance, prepared and compiled
before committing one new revision. Rejected batches leave the session intact.
The compiled model is reused for repeated solves and solver/acceptance option
changes. Physical edits always recompile because coefficients are embedded in
expressions and zero ratings can change the reduced equations. Numerical base
changes also recompile. Topology, connection maps and other unsupported edits
require a new session. compilation_count() makes this cache policy observable.
Compatible warm starts carry primal coordinates by compiler identity, reset
proven zero columns and recompute dependent auxiliaries. After a base change
or ambiguous compiler names, the previous physical voltage/tap report is
projected in SI units instead. An unusable warm seed falls back to the declared
start with MC_OPF.SESSION_WARM_START_DISCARDED. McOpfSessionResult::start
records the path used. Each attempt creates a fresh optimizer and evaluator;
the session does not reuse multipliers or matrix factorizations as optimizer state.
Optional dual reports remain attached to their accepted result revision. Warm starts
need not be feasible and do not guarantee convergence or fewer iterations.
Results carry the input revision, solve attempt, and compilation counters.
current_result() returns None after an edit, changed options or a failed or
cancelled attempt. last_accepted() explicitly exposes the historical result
with its original revision and instance. Failed attempts never replace that
result or its warm-start primal. Empty edit batches, identical options and
rejected changes leave the current result intact. Accepted results use the same
independent physical validation and portable result format as one-shot solves;
session counters and cache state are native, in-memory metadata.
Results
McOpfResult reports SI terminal voltages and physical branch, device and winding
ledgers, keeping terminal and coil axes distinct, including neutral returns.
Each terminal is identified by bus and terminal label. Each coil has a local
zero-based index and explicit positive/negative terminals; an absent negative
terminal means physical ground. Complex arrays are [real, imaginary], with
field suffixes identifying volts, amperes and VA. Device currents and powers
are positive for load withdrawal and source/generator/inverter injection.
Branch currents leave the bus toward the branch. Transformer coil and shunt
currents enter the equipment.
Transformer rating ports retain their prepared winding/port names and selected
limits. These ports may include magnetizing current or represent through-power;
they are measurements, not additional additive terminal injections. Bare winding
currents and separate core/grounding shunt ledgers reconstruct physical KCL.
The optional transformer tap is the optimized physical coefficient in the
canonical winding convention; fixed taps remain in the retained instance.
McOpfResult::to_module_json and solve_mc_ac_opf_module_json emit a canonical
PowerIO McAcOpfSolution plus version 9 of the namespaced module extension
org.eigenergy.tellegen.mc_opf. The canonical value retains voltages,
source/generator dispatch and the original instance. The extension carries the
complete ledgers, axes, optimized taps, numerical options/bases, residuals,
input diagnostic summaries, fingerprint, iterations, optional profile and optional
dual report. Reports from versions 1–7 with assigned fixed-PF controls are
rejected and must be solved again: their PF rows and multipliers use the old
scaling. Version 1 reports remain readable when they contain neither PF controls
nor dual data. Version 2–6 dual reports without PF controls are checked using
their original parameter mappings and dense rank
audit before current sparse rank qualification and newly
supported load/inverter/transformer/control-profile derivatives are recomputed from the retained canonical
instance. Versions 7–8 use their original largest-residual sparse pivot order
and work accounting for verification before sparsity-aware rank qualification
is recomputed. Re-export writes version 9; older unsupported entries are not silently
accepted as current claims. Upgrading does not rerun optimization.
This uses PowerIO’s existing extension mechanism without changing its schema.
McOpfResult::from_module_json reads this complete report and preserves module
records and unrelated extensions on re-export. It rejects missing/unknown report
versions, inconsistent identities or vector lengths, changed instance/base
fingerprints, and disagreement with canonical voltage columns. Reading a report
with dual data recompiles its declared problem, recomputes the derivative/KKT
diagnostics, and checks the stored primal against the physical ledgers and
canonical voltages. It rejects inconsistent multipliers, scaling metadata and
derived marginal claims.
Reading does not rerun the solver or certify an external result. A canonical solution
without the extension remains readable through PowerIO, but cannot be imported
as a complete McOpfResult.
Accepted solves pass the physical validation gate. They establish local numerical success, without a global-optimality certificate. Local forward and adjoint sensitivities are available for a verified regular dual point and supported physical parameters.
Dual diagnostics and local marginal values
Set McOpfOptions.collect_duals = true to populate McOpfResult.duals.
Collection is off by default. The report includes original-objective-scale
constraint and variable-bound multipliers, stationarity, complementarity,
dual-feasibility and primal residuals, and an active-constraint rank audit.
Physical acceptance remains independent: a failed diagnostic or unavailable
marginal value does not invalidate an otherwise accepted physical solution.
Missing multipliers or failed derivative evaluation produce
MC_OPF.DUALS_UNAVAILABLE; finite but unreliable duals remain inspectable with
an explicit report status.
Each row has a unique compiler ordinal, a descriptive label and any squared-norm
normalization radius in working units. Ordinals identify rows within that compiled
problem, not across revisions. Labels need not be unique and are never parsed
to recover parameter identities. Omitted fixed equations and zero-reduced rows
retain provenance; synthetic zero definitions are identified explicitly. Raw
row multipliers use L = f + lambda*g: lower-side multipliers are negative,
upper-side multipliers positive, and equality multipliers unrestricted.
They use compiled row units. IVR KCL multipliers are not nodal energy prices.
Typed marginal entries instead report the envelope derivative of operating cost (currency/hour) with respect to an identified physical parameter in W, var, A, VA, V or dimensionless ratio. A positive value means increasing that parameter raises local cost. For example, a lossless load served at 0.2 currency/kWh has an active-power marginal of 0.0002 (currency/hour)/W. Supported parameters are nominal load coil P/Q, selected generator coil P/Q bounds, inverter availability and capabilities, effective branch conductor and transformer port current/apparent-power ratings, physical continuous tap bounds, prepared voltage-magnitude limits, and inverter control-profile settings. Branch ratings sum contributions from both ends. Squared-norm rows include the derivative of their normalization radius, so their raw multiplier is not itself the physical limit marginal. Values are invariant to numerical bases and solver objective scaling within numerical tolerances.
Parameter identities describe effective prepared limits. A shared linecode edit can affect several branch parameters; a scalar bus bound may affect several voltage measurements. These entries are not derivatives of arbitrary canonical input fields. Load mappings cover constant power, constant current, constant impedance, ZIP and exponential laws. They hold nominal voltage, exponents and ZIP coefficients fixed. Canonical scalar/per-coil coefficients and their defaults are retained even when nominal P/Q is zero and preparation removes its terms. The derivative is with respect to nominal W/var, not the load’s realized power at the solved voltage. Fixed-tap setpoints and transformer impedances do not have parameter mappings. Coincident generator/inverter lower and upper bounds do not yield separate one-sided bound marginals.
Inverter entries use owner Inverter and the canonical inverter name. The
Availability direction (W) follows McOpfEdit::InverterAvailability: increment
one explicitly allocated p_max coil and recompute p_avail as the sum. It
includes the selected upper P bound, a PMax-referenced volt-watt target on that
coil, and every PAvailable-referenced target through the summed availability.
The vector must be finite and nonnegative, the selected allocation positive,
and an observed p_avail must already agree with its sum. Otherwise availability
is UnsupportedParameter; the solver does not invent an allocation or reset a
control reference as part of differentiation.
Inverter ActivePowerLower/Upper and ReactivePowerLower/Upper vary canonical
per-coil bounds in W/var while holding other fields, including p_avail, fixed.
ApparentPowerRating varies per-coil s_max in VA. These mappings include
PMax/SMax-referenced volt-watt and SMax-referenced volt-var effects, even when
capability constraints are deselected. Curve knots, fractions, voltage references,
aggregation and power-factor coefficients stay fixed. A reference change can
therefore have nonzero value even if its own capability bound is inactive.
CurrentRating varies i_max in A: its axis follows canonical terminal_map
for single-phase/four-leg equipment, including the neutral, and coil order for
three-leg delta equipment. For a two-wire inverter preparation takes the minimum
of phase and return ratings; the looser finite rating has zero local derivative,
and an exact tie refuses independent current-rating partials. Ratings must exist
and be finite. Zero-rating reductions retain the existing conservative refusal;
a zero nameplate used only as a control reference is also unsupported. All these
entries remain conditional on the same regular local branch and active set.
Shared profile entries use owner ControlProfile and the canonical profile
name. VoltVarBreakpoint and VoltWattBreakpoint use volts and an axis indexing
the canonical breakpoint array. VoltVarFraction and VoltWattFraction use
dimensionless ratio units and index q_limits and p_limits, respectively:
index 0 is the high-voltage endpoint, index 1 the low-voltage endpoint.
PowerFactor has no axis and varies the signed canonical pf in ratio units.
Each derivative sums all affected coils of every inverter assigned that profile,
holding nameplates, availability, references and aggregation fixed. Breakpoint
derivatives include the preparation rule for smoothing width as well as interval
slopes. Averaged voltage monitors retain their full chain rule. Unity power
factor is a valid setting but has no finite two-sided derivative; its marginal
and sensitivity are unsupported, as are unused profiles. Switching control
families, references or profile assignments is outside this local interface.
Transformer entries use owner Transformer and the prepared transformer identity.
For CurrentRating (A) and ApparentPowerRating (VA), axis indexes that
transformer’s result ports array, whose name and endpoints identify the physical
measurement. These are effective selected port limits, with all electrical
coefficients held fixed. A canonical nameplate or winding rating can feed several
ports and can also set impedance bases; its full derivative is not generally one
port derivative. Combine port directions only when the canonical edit leaves
electrical coefficients fixed. Current ports can include exciting current, while
through-power ports may use bare winding currents. Zero-rating reductions retain
the existing conservative refusal; absent or deselected ratings are unsupported.
TapLower and TapUpper have no axis and vary the physical continuous tap bounds
in ratio units, holding the nominal tap and transformer coefficients fixed. The
mapper applies the chain rule for both tap_nominal * alpha and the
regulator convention tap_nominal / alpha (Type A and Type B alike). The inverse convention swaps the
compiled bound sides and has a negative bound derivative. An inactive tap bound
has zero derivative on the same active set. Fixed/discrete tap choices and edits
that change the transformer equations are outside this interface.
The load mapper follows the chosen compiled current or power law without changing the physical equations. It includes both real and imaginary current rows for an impedance-form load and uses the logarithmic-voltage coordinate when present. At positive voltage this also handles a zero coefficient that hides a nonconstant law. At zero voltage, pure impedance current-law parameter derivatives remain defined; hidden non-impedance laws are reported unsupported because their neighboring compiler profile requires positive voltage. Nonfinite derivative evaluations are likewise withheld without invalidating an accepted physical solution. Voltage-law coefficient and nominal-voltage derivatives are not exposed.
Conditional means a first-order envelope value assuming the same regular local
stationary branch and active set. It is not a second-order sufficiency test,
global price, or proof that the optimal-value function is differentiable.
Values are withheld after failed KKT checks, any zero-limit reduction,
numerically dependent active rows, weakly active inequalities, or an unaudited
rank. The rank audit uses normalized, pivoted, twice-reorthogonalized sparse row
QR with a 1e-9 numerical rank threshold. Column incidence restricts updates to
overlapping rows; no dense active-Jacobian copy, normal equations or numerical
fill dropping is used. The audit permits up to 2,000,000 live coefficients and
100,000,000 sparse coefficient visits. These bounds limit fill and work rather
than the number of active rows. active_rank.qualification reports completion,
fill/work exhaustion or nonfinite arithmetic, along with input/peak nonzeros,
work, limits, accepted pivots and the smallest accepted pivot. Peak nonzeros are
coefficient counts, not allocated bytes. An incomplete audit reports
RankNotChecked and no rank; a completed deficient audit reports RankDeficient.
Both preserve physical results, raw multipliers and KKT residuals. This is a
numerical independence test, not a condition-number estimate or uniqueness proof.
Active-side tolerance is 1e-7*(1+abs(bound))
in compiled coordinates. KKT acceptance uses 1e-6 for relative stationarity,
relative complementarity, normalized primal violation and absolute dual-sign
violation. Relative stationarity divides each coordinate residual by one plus
the sum of absolute gradient, Jacobian-multiplier and bound-dual contributions;
relative complementarity divides by 1+abs(objective). Active inequality rows
are weak when abs(lambda)*norm(row_gradient) <= 1e-8 (variable bounds use
z <= 1e-8). This conservative policy exposes diagnostic limits explicitly.
DC OPF variants and optimality compatibility
Tellegen keeps Legacy Tellegen as its default. To reproduce a PowerModels DCP or PGLib DC baseline, select PowerModels DCP / PGLib DC. To use the MATPOWER DC equations, select MATPOWER / PowerModels DCMP. Loading a PGLib case does not automatically change the selected variant.
These options select different optimization problems. An optimal solution of one problem need not have the same cost, dispatch, congestion or prices as another. None is a guarantee of AC feasibility, AC optimality, or a lower bound on AC cost. The PGLib AC baseline is a different comparison.
Compatibility matrix
Let Δθ = θfrom − θto, k = x/(r²+x²), τ be the effective tap magnitude,
and φ the phase shift in radians. Source tap zero means unity. Branch power
is positive from the from-bus to the to-bus. The table describes equation
compatibility; optimal-objective agreement also requires the checklist below.
| UI selection / API token | Active branch flow | PowerModels DCP / PGLib DC | MATPOWER DC / PowerModels DCMP | AC OPF objective |
|---|---|---|---|---|
Legacy Tellegen (default) — series_susceptance | k(Δθ−φ) | When all shifts are zero | When r=0 and τ=1 | No equality guarantee |
PowerModels DCP / PGLib DC — series_susceptance_no_phase_shift | kΔθ | Exact equations | When r=0, τ=1, φ=0 | No equality guarantee |
MATPOWER / PowerModels DCMP — tap_adjusted_reactance | (Δθ−φ)/(xτ) | When r=0, τ=1, φ=0 | Exact equations | No equality guarantee |
Tap-adjusted series susceptance — tap_adjusted_series_susceptance | k(Δθ−φ)/τ | When τ=1, φ=0 | When r=0 | No equality guarantee |
Reactance only (1/x) — reactance_only | Δθ/x | When r=0 | When τ=1, φ=0 | No equality guarantee |
Conditional entries are sufficient conditions on every active branch, not an
exhaustive list of cases that happen to yield equal costs. All five options
agree when r=0, τ=1, φ=0. Taps can change radial-network angles without
changing its fixed-injection flows; meshed networks redistribute flows.
Equation parity assumes the same branch orientation and impedance reference
side. PowerModels parse_file may reverse antiparallel transformers, scaling
r,x by τ², inverting τ, negating φ, and reversing angle bounds.
The two tap-adjusted conventions are invariant under this complete reversal
(with reversed flow sign); the three tap-ignoring coefficients change by
1/τ². PowerIO preserves source orientation, so independently parsing the
same file does not by itself guarantee DCP parity for off-nominal transformers.
In per unit, nodal balance is pg,i − pd,i − gs,i = Σout f − Σin f,
where f includes the selected shift term. Fixed HVDC terminal injections
enter the same balance separately.
The built-in DCP and DCMP equations are checked against PowerModels 0.19.9. MATPOWER compatibility here means its documented DC equations, tested numerically through PowerModels DCMP; it is not a claim that a separate MATPOWER executable ran. The other three modes use explicitly labelled, validation-only PowerModels extensions.
What must match before comparing optimal objectives
- Use the same case revision and per-unit base, active equipment and island references. Resolve bus identities and generator aggregation consistently.
- Match the full generator cost curves, including constant terms, quadratic scaling and piecewise-linear segments, and match generation limits.
- Match thermal active-power limits, angle-difference limits, shunt active withdrawals, fixed HVDC injections and any caller-supplied constraints.
- Match preprocessing: zero-impedance handling, three-winding lowering, reference angles, missing ratings and unconstrained angle windows. Tellegen’s network path applies PowerIO’s PowerModels ±60° (1.0472 rad) pad and may synthesize an unrated thermal limit over it; that is not equivalent to an unlimited MATPOWER branch.
- First check primal residuals and solver status, then compare objective using an explicit numerical tolerance. Equal objective does not imply unique dispatch or prices. Compare dispatch only when uniqueness is established, and duals only for a nondegenerate active set, in matching units and signs.
The selector changes neither thermal ratings nor voltage/reactive constraints. DC models omit the latter. A user wanting an AC-operable dispatch should replay it with AC power flow and inspect voltages, reactive generation and apparent power at both branch ends. A locally solved AC OPF is a feasible local reference, not a certified global optimum.
Selecting and retaining a variant
The browser’s Calculation → DC variant control validates the common calculation settings and builds a replacement study. A successful solve replaces the displayed result and sensitivities; a failed solve retains the accepted result. An imported typed instance owns its convention; its selector is read-only. A nondefault variant cannot fall back silently to the legacy-only HTTP calculation service.
The same stable token works in CLI/Python JSON requests and solveModule:
{
"formulation": "dcopf",
"branch_susceptance_formula": "series_susceptance_no_phase_shift"
}
It also applies to dcpf. Other formulations reject this option. Omission on a
network preserves the legacy default; omission on a typed instance inherits
its convention. A matching explicit request is accepted; a conflict is an error.
The common settings API accepts the same token in
overrides.branch_susceptance_formula for dcopf and dcpf. Its default is
null, meaning inherit the input convention. The shared @tellegen/svelte/webmcp
adapter uses accepted settings for previews, sensitivities and exact updates.
Saved studies retain the convention together with their other calculation settings.
Every new DC result reports the resolved branch_susceptance_formula.
const study = await createStudy(moduleJson, 'dcopf', {
branch_susceptance_formula: 'tap_adjusted_reactance'
});
Rust offers Study::new_with_options and Study::from_module_with_options
with StudyOptions. Durable CreateStudy requests accept the same optional
field. Saved instances, solutions and study sessions retain the choice;
network-only exports intentionally contain network data without solver options.
The original constructors retain their behavior.
SeriesAdmittance(Susceptance) sensitivities remain derivatives with respect
to raw series b, holding raw g and transformer settings fixed. Tellegen
applies the selected coefficient’s chain rule to both the matrix and its phase
injection. This does not introduce transformer-tap sensitivities.
Engineering basis and evidence
Ignoring resistance (1/x) and ignoring conductance (x/(r²+x²)) are distinct
conventional approximations. Transformer ratios and phase shifts are further
choices. At unit bus voltage magnitudes and effective angle difference zero,
the full complex transformer model has active-flow angle derivative
x/((r²+x²)τ). That local derivative justifies the tap-adjusted series option;
it does not establish that it predicts every network’s AC flows best.
At general operating voltages, let ρ = vf vt, δ = Δθ − φ, and
g = r/(r²+x²). The from-end derivative is
ρ(k cos δ + g sin δ)/τ; the symmetric-transfer derivative is
ρ k cos δ/τ. The simplified ρk/τ slope assumes δ=0.
- PowerModels formulation details and v0.19.9 DC implementations.
- MATPOWER DC modeling and PGLib v23.07 baselines.
- Stott, Jardim and Alsaç, DC Power Flow Revisited (2009).
- Taheri and Molzahn, Optimizing Parameters of the DC Power Flow (2024).
The reproducible harness in
evals/dc-variants
pins the Julia environment, identifies built-in versus custom models, checks
residuals before objectives, records input hashes, and reports AC failures and
constraint violations. Its small strictly convex congested case is also an
offline Rust regression fixture. See validation for the wider
solver qualification and its limits.
The recorded small and 300-bus comparisons agree with PowerModels across all
five options. The 13,659-bus stress case still shows numerical discrepancies:
matching DCP equations does not currently guarantee PGLib objective parity
on that case. Tellegen’s existing optimal status also includes Clarabel’s
reduced-accuracy termination, so inspect primal residuals when benchmarking.
The harness README records the objective gaps, residuals and AC convergence
failures; this change does not retune the solver or change its status mapping.
The sensitivity interface
Every sensitivity comes from a converged solution by the implicit function theorem on a residual $K(z, p) = 0$:
$$ \frac{dz}{dp} = -\left(\frac{\partial K}{\partial z}\right)^{-1} \frac{\partial K}{\partial p}. $$
Operand / Parameter vocabulary
This vocabulary and the shared driver below serve the balanced DC/AC/conic formulations. The experimental native MC OPF API is described separately below.
A sensitivity is named for the physical quantities it relates, not a formulation’s internal variables. The operand (what the derivative is of) and parameter (what it is taken with respect to) are the orthogonal sub-axes (active/reactive, from/to, voltage representation):
Operand:Price,Dispatch,Flow { power, end },Voltage(kind).Parameter:Demand,Cost,LineLimit,SeriesAdmittance,ShuntAdmittance,VoltageBound,GenBound,Transformer,Switching,ConstraintLimit.
ConstraintLimit (DC OPF) shifts both limits of a request’s linear constraint
by the same amount, or the fixed value of an equality, in MW. Its columns are
keyed ElementId::Constraint(i) by the constraint’s position in the request.
The DC KKT carries a multiplier for each stated limit of each linear constraint,
so every other DC cell differentiates the constrained program as well.
Each formulation maps a request to its own KKT rows or reports the combination as unsupported.
The object-safe Differentiable trait
One trait exposes the pieces the shared driver needs: the system Jacobian $K$, the
parameter column $\partial K/\partial p$, the operand selector $S$, and the
per-formulation regularization. It is object safe by construction
(&dyn Differentiable), so the DC KKT, the AC Newton system (AcNewton), and the
conic KKT (ConicKkt) all plug into one driver.
Forward and adjoint
The single driver runs whichever direction is cheaper:
- forward solves $K X = \partial K/\partial p$ once per parameter, reads the operand rows;
- adjoint solves $K^\top Y = S^\top$ once per operand, contracts with $\partial K/\partial p$.
The two are algebraically identical; Mode::Auto picks the smaller dimension.
Per-cell parity classes
Finite differences validate the analytic columns per cell:
- clean: cells routed through active power, relative error $< 10^{-3}$.
- Jabr-coupled / soft: squared-voltage or reactive cells, looser (the cone’s degenerate directions).
- norm-floor skip: columns below the regularization floor carry no resolvable derivative and are not compared.
See Validation for how these classes are checked, and Methodology for how the figures are produced.
Native multiconductor OPF
The opt-in native mc-opf feature exposes McOpfResult::sensitivities() and
McOpfSession::sensitivities(). Solve with McOpfOptions.collect_duals = true
first. Construction checks the complete saved-report invariants, recompiles the
declared problem, and builds one sparse factorization from its verified primal
and original-scale multipliers. It does not rerun optimization. The returned
McOpfSensitivities borrows the accepted result and reuses its factorization for
subsequent queries. The feature enables the existing optional faer dependency;
no additional dependency versions or shipping adapters are enabled.
For a complete runnable example covering edits, warm starts, report persistence,
unavailable derivatives and both query directions, see the
public native workflow.
It uses McOpfParameter::new(owner, component, axis, kind) with canonical
equipment identity and a zero-based coil/port axis. parameter.unit() describes
the parameter kind’s unit; query qualification still checks existence, active
constraints and differentiability. For its objective-only query, a forward
direction of 1 W and an adjoint objective weight of 1 yield the same numeric
local marginal cost in (currency/hour)/W. Forward values generally retain
output units per unit path change, while adjoints divide the weighted output
unit by each parameter’s physical unit.
use tellegen::{McOpfParameterDirection, McOpfSensitivityOutput};
// `result` is an accepted MC OPF result with dual collection enabled.
let local = result.sensitivities()?;
// Select an explicit identity from local.parameters(), for example load coil P.
let direction = McOpfParameterDirection {
parameter: selected_load_p,
delta: 1.0, // one watt per unit change in the path parameter alpha
};
let derivatives = local.forward(
&[direction],
&[McOpfSensitivityOutput::Objective],
)?;
forward accepts a combined direction in physical parameter units and returns
d(output)/d(alpha) for each selected output. Repeated parameter entries add.
adjoint accepts McOpfOutputWeight entries defining one weighted scalar output
and returns its gradient with respect to selected McOpfParameter identities.
Each query uses one backsolve, apart from any numerical refinement; many
parameter or output contractions reuse that solve. Callers own the units of a
weighted scalar that combines different physical quantities. Returned entries
carry output or parameter units explicitly and retain request order.
Parameters use the same mappings as local marginal values: nominal load coil P/Q for constant-power/current/impedance, ZIP and exponential laws, selected generator P/Q bounds, inverter availability and capabilities, effective branch current/apparent-power ratings, transformer port ratings and physical continuous tap bounds, prepared voltage limits, and inverter control-profile settings. Inactive supported limits have zero derivatives on the fixed active set. Unknown, unsupported or coincident-bound parameters produce an error even if their requested weight is zero; they are never silently treated as inactive limits. Shared linecodes and scalar bus bounds can affect several effective parameters.
For voltage-dependent loads, P/Q directions vary the canonical nominal coil
powers while holding the voltage-law coefficients, exponents and nominal voltage
fixed. The parameter column includes the exact mixed state–parameter derivative
in stationarity. Canonical metadata preserves terms removed at zero nominal
powers and follows scalar/per-coil defaults and coil incidence. Current-law
rows differentiate conj(S)*U/abs(U)^2; power-law rows differentiate the voltage
factor directly, using the log-voltage variable when the compiler introduced it.
This supports zero-P/Q transitions without changing the physical formulation.
At zero voltage, unsupported neighboring positive-voltage profiles are refused;
pure impedance current laws retain their finite derivative. Derivatives with
respect to ZIP fractions, exponents or nominal voltage are not exposed.
Inverter directions use canonical per-coil P/Q bounds and apparent-power ratings,
and terminal current ratings (coil current for three-leg delta). Availability
follows the retained-session edit: one allocated p_max entry changes and the
sum becomes p_avail. It requires a positive selected allocation and a coherent
observed total. The mappings include all affected volt-var/volt-watt references,
including cross-coil PAvailable targets and averaged voltage monitors. Exact
control-reference partials enter both feasibility and stationarity through the
compiler’s existing magnitude lifts. This does not perturb curve coefficients or
introduce numerical finite differences. Two-wire current-rating ties, absent or
nonfinite ratings and zero nameplates do not provide independent partials. See
the linked marginal-value documentation for complete field and axis semantics.
ControlProfile directions vary a shared profile’s volt-var/volt-watt voltage
breakpoints, output fractions, or signed power factor. They accumulate across
all assigned inverters and coils, including averaged voltage monitors. Exact
mixed derivatives include both the interval slopes and the breakpoint-dependent
softplus smoothing width. No runtime finite differences are used. Breakpoints
use volts; fractions and power factor use ratio units. Unity power factor has
no finite two-sided derivative, and unused profiles are unsupported. For the
bounded PF row a*P + pf*Q, the parameter partial is (-pf/a)*P + Q,
including both mixed state derivatives; no division by pf is needed. Control
families, references, assignments and aggregation stay fixed.
Transformer rating parameters address effective selected result ports in A/VA, holding electrical coefficients fixed. A shared winding nameplate may require several port directions and can also change impedance bases; arbitrary canonical nameplate edits are not represented by a single port parameter. Tap-bound inputs use physical ratio units, including the bound-side reversal and negative chain rule of Type A and Type B regulators. The physical formulation and nominal tap stay fixed.
Outputs include operating cost, earth-referenced terminal voltage real/imaginary parts, magnitude and local angle, device coil or terminal P/Q and rectangular current, and branch-end P/Q and rectangular current. Units are currency/hour, V, radians, W, var and A. Device selectors include kind and identity, preventing load/generator name collisions. Coil indices and terminal labels are distinct; neutral returns and delta terminal powers use the complete physical incidence. Branch currents leave the bus toward the branch and include the selected end’s shunt. Device signs follow the physical result ledgers. Gradients differentiate physical measurements rather than assuming auxiliary power columns are exact. Voltage magnitude and angle at zero are unavailable; angle derivatives describe a local continuous angle, not the discontinuity of a wrapped display value.
Transformer outputs use McOpfTransformerAxis: a coil index, a bus/terminal
identity, or a named rating port. Coil and terminal currents enter the transformer;
terminal outputs sum bare winding incidence, including delta and neutral returns.
Separate core/grounding shunt ledgers are excluded from these winding-terminal
outputs. Named ports reproduce the result’s rating measurements, including
exciting-current and through-power conventions; they are not extra KCL injections.
P/Q and rectangular-current outputs use W/var/A and differentiate the physical
voltage-current products. TransformerTap returns the optimized physical ratio,
with the appropriate direct or inverse derivative. Fixed taps have no such output.
Unknown components, terminals, coils or port names are rejected.
Raw multiplier outputs, network-admittance parameters, fixed/discrete tap setpoints and control-mode switching are not part of this interface.
For active constraints c(x,theta)=0, the stationary system is
$$F(x,\lambda,\theta)= \begin{bmatrix}\nabla_x f + J_c^T\lambda\c\end{bmatrix}=0, \qquad K=\begin{bmatrix}\nabla_{xx}^2 L & J_c^T\J_c&0\end{bmatrix}.$$
Forward differentiation solves K z' = -F_theta theta'. Adjoint differentiation
solves K^T a = h_z and contracts -a^T F_theta. POUNCE supplies exact sparse
Jacobians and the Lagrangian Hessian, using only active-row multipliers and the
original objective scale. A normalized rating row g=G(x)/theta^2 contributes
both -2g/theta in the constraint derivative and
-2 lambda grad(g)/theta in the stationarity derivative. Both branch ends are
included. No supported output has an additional explicit parameter term.
The symmetric KKT matrix is equilibrated and factored with sparse LU, without
diagonal regularization or a pseudoinverse. Before exposing a view, construction
solves every coordinate right-hand side, streaming the computed inverse X
through linear workspace. For the equilibrated matrix B, it requires
||I-BX||_1 < 0.5 and the bound
||B||_1 ||X||_1 / (1-||I-BX||_1) <= 1e12, with a floating-point accumulation
allowance. This checks all directions, including null directions orthogonal to
dense probe vectors. Construction costs one sparse backsolve per KKT column;
no dense inverse is retained, and queries reuse the qualified factorization.
Each query also checks its componentwise residual against the original
unregularized matrix and can perform two refinement steps.
view.diagnostics() returns the active rank qualification, variable/active-row
counts, KKT dimension and assembled nonzeros. forward_with_diagnostics and
adjoint_with_diagnostics return the same derivatives as the ordinary methods,
plus the query’s residual infinity norm, componentwise backward error,
refinement count and maximum residual/tolerance ratio. That ratio must be at
most one, with tolerance 1e-10 + 1e-8*(|rhs| + |K|*|x|) per row. These statistics
describe the assembled matrix and backsolve, not factor memory or forward error.
The inverse check is a numerical safeguard, not an interval-arithmetic or second-order sufficiency certificate. Every returned derivative is conditional on the same regular stationary branch and active set; it does not certify global optimality or predict behavior across active-set transitions.
McOpfSensitivityError distinguishes missing duals, stale results, inconsistent
reports, unreliable duals, unsupported parameters/outputs, malformed requests,
derivative-evaluation failure, singular/unstable KKT systems and failed linear
solves. The existing conservative dual eligibility checks still apply, including
zero-limit reductions, weak activity and incomplete or deficient sparse rank
qualification. The rank audit budgets sparse fill and work instead of imposing
the legacy 256-row cutoff; its outcome and usage are retained in the dual report.
It normalizes rows and applies twice-reorthogonalized sparse QR, preferring the
sparsest residual row whose norm is at least half the largest remaining norm
and exceeds the 1e-9 pivot tolerance. The global largest norm controls
termination. This reduces fill on feeders without dropping small coefficients,
forming normal equations or relaxing the tolerance. The limits remain two
million live coefficients and 100 million work units; candidate visits also
count as work. A completed audit is a numerical rank test, not a singular-value
or conditioning certificate. Near the tolerance boundary, pivot order can affect
the reported numerical rank. Larger or denser feeders can still exhaust a budget
and return no rank; physical feasibility does not override that refusal.
Eligibility and factorization errors carry the available active_rank; a
failed backsolve carries its last finite linear_solve diagnostics when available.
Sensitivities additionally refuse
ambiguous narrow inequalities and loss of stationarity when inactive multipliers
are removed. Physical acceptance alone does not establish this eligibility.
The session entry point requires current_result(): edits, changed options and
failed or cancelled attempts invalidate access. Rust borrowing prevents edits
while a sensitivity view is in use. An explicitly selected or cloned historical
result remains an independent snapshot of its original instance. Portable
version 9 results can rebuild a view after import. Version 2–8 dual reports
are verified with their original mappings and rank audit (dense for versions
2–6, largest-residual sparse pivots for 7–8) before upgrading to current mappings
and sparsity-aware qualification. Versions 1–7 with assigned PF
controls are rejected because their constraint scaling differs; they require
a new solve. Factorizations and views are
native in-memory objects and are not serialized. Neither queries nor failures
change the session’s accepted result, warm start or revision.
Methodology
The benchmarks crate is a private workspace member that drives tellegen’s
public API over the PGLib-OPF corpus for validation and timing. It never vendors
the corpus and reads it from $PGLIB_OPF_PATH, skipping when the path is absent.
Corpus
PGLib-OPF v23.07 at $PGLIB_OPF_PATH: 66 base, 66 congested (api/), and 66
small angle (sad/) MATPOWER files, spanning a range of bus counts at
baseMVA 100. PGLib data is CC BY 4.0 (see References).
What is driven
Per (case, variant), the harness parses a PowerIO module and declares the
calculation as DcOpfInstance, AcOpfInstance, or AcPfInstance. It then
drives the same typed facade available to downstream consumers:
- DC OPF:
solve_instance(objective, dispatch, LMPs); - conic SOCWR:
solve_ac_instance(objective, gap, W-space primals); - AC power flow:
solve_ac_pf_instance(convergence, residual); - sensitivities: the same typed solve entries in forward and adjoint modes.
Timing
The engine exposes iteration traces and residuals rather than wall time, so the harness times the public calls itself, per stage (parse / build / solve / sensitivity). Solves run on one thread for clean timing.
Metrics
- OPF correctness vs the published reference: the DC objective, the SOCWR relaxation lower bound, and the SOC gap, rolled up into a per-case reproduction verdict (see Validation).
- Sensitivity parity: adjoint equals forward, and central finite differences against the analytic columns, classified per parity class (see the sensitivity interface).
- Feasibility / convergence: per-case status, interior-point iterations, residuals.
- Performance: wall time per stage, and a scaling curve against bus count.
- Coverage: a per-case status table, including the size caps applied by the harness flags.
Baselines
Correctness is checked against two independent baselines:
- the published PGLib reference solves (PowerModels.jl with IPOPT), tabulated per
case and variant in
$PGLIB_OPF_PATH/BASELINE.md; and - finite differences, which validate the analytic sensitivity columns by perturbing the public network fields.
Reproducibility
The harness records the source revision, toolchain, dependency versions, host,
and invocation used for each run. It writes results.json (one record per
(case, variant)) and results.csv. With its book flag it also writes the
markdown snapshot to docs/src/benchmark-results.md. The repository keeps that
generated snapshot, and a rerun can be compared with its recorded provenance:
cargo run -p benchmarks --release -- [flags]
External multiconductor IVR studies
The opt-in ENWL tools complement the small frozen
MC regression fixtures. They read external
BMOPFDraftData ENWL LVNS snapshots: 30, 99 and 538 buses, LG/LN control variants,
and slots 01, 12 and 25 (18 cases). Reproduce the input selection with dataset
revision 52b8da905bffa41bcae8c1c5c2ce25fc54b2a424; the inputs identify reduction
via PMD and generation through VVWO and declare CC BY 4.0. Keep the dataset and
generated study outputs outside the source tree.
Build with the published dependencies in the lockfile, then run fresh native and external reference solves from the repository root:
cargo build -p tellegen --example mc_opf_case_probe --features mc-opf \
--profile release-py --locked
python3 scripts/enwl_ivr_study.py \
--case-root /path/to/BMOPFDraftData/benchmarks/ENWLsnapshots \
--binary target/release-py/examples/mc_opf_case_probe \
--output /path/to/study-output
julia --project=/path/to/BMOPFTools.jl/test scripts/mc_opf_external_oracle.jl \
/path/to/study-output/cases.json /path/to/study-output
python3 scripts/enwl_ivr_study.py --output /path/to/study-output --compare
If CARGO_TARGET_DIR is set, substitute its probe path for target/....
The oracle requires clean BMOPFTools revision
a8b52e069bfd4a7a57434c91bc0470ac03cfdd55, a 1,000 VA base, 1e-9 Ipopt
tolerances, no bound relaxation or acceptable-iteration shortcut, and a
500-iteration cap. Native runs use 230 V / 1,000 VA bases, objective scale 1,
1e-6 independent acceptance tolerance and the same iteration cap.
The comparator checks input hashes, objective, complex terminal voltages, both-end line currents, inverter coil powers and original active-power bounds. Checking the original bounds matters: a dropped scalar availability bound can leave a physically different optimization problem with excellent solver residuals. Historical dataset objective summaries use different conventions and are not current golden files; compare explicit SI quantities and currency/hour against fresh solves instead.
Controlled timing and profiling
For repeated sequential comparisons on the six 538-bus cases:
OMP_NUM_THREADS=1 OPENBLAS_NUM_THREADS=1 VECLIB_MAXIMUM_THREADS=1 \
RAYON_NUM_THREADS=1 JULIA_NUM_THREADS=1 \
julia --startup-file=no --project=/path/to/BMOPFTools.jl/test \
scripts/enwl_ivr_profile.jl /path/to/study-output/cases.json \
/path/to/target/release-py/examples/mc_opf_case_probe /path/to/profile-output 5
python3 scripts/enwl_ivr_study.py --output /path/to/profile-output --compare
The harness warms each pair, randomizes case order with a fixed seed, alternates native/Julia order, and defaults to five repetitions. Julia stays in one process; each native invocation starts a new process, with process launch excluded from its internal timer. File reading and final JSON output are excluded. Avoid concurrent builds or benchmarks, and retain source revisions, input hashes, dependency versions, host, thread settings and timing distributions with results. These implementation-level measurements do not isolate linear-solver backends on identical matrix sequences or establish general solver speed rankings.
McOpfOptions.collect_profile enables stage/KKT diagnostics and evaluation
counters; it is off by default. The probe’s fifth argument enables profiling and
iteration capture. The harness collects detailed profiles separately from
unprofiled timing repetitions. Inspect factorization counts, fill, regularization
and iteration trajectories alongside derivative costs before choosing a
performance target. Timer scopes overlap: POUNCE’s
linear_system_factorization includes the first back solve, while the backend
numeric-factorization counter measures factorization alone. Do not sum nested
timers or compare differently scoped native and Ipopt counters as backend speed
ratios. Current performance claims require a fresh run on the stated revisions.
Validation
tellegen is checked against the published PGLib reference solves. For each case and
variant, $PGLIB_OPF_PATH/BASELINE.md tabulates the PowerModels.jl with IPOPT
reference: DC ($/h), AC ($/h), QC Gap (%), and SOC Gap (%). The
Methodology chapter describes how the harness produces the
comparison; this chapter records what each comparison asserts. The measured figures are in
benchmark results, a committed snapshot of a full
harness run with its provenance.
DC objective
tellegen’s declared DC objective, including its constant cost term, is compared against the published DC baseline. Both values come from the same PGLib cost data. Per-unit power scaling cancels; tellegen does not assign a currency to objectives from other sources.
Relaxation lower bound
The SOCWR objective (socwr_opf objective) must be a lower bound on the published
AC optimum (AC ($/h)):
$$ \text{socwr} \le \text{AC} + \text{tol}. $$
A bound violation is a correctness failure.
SOC gap
The gap is
$$ \text{gap} = \frac{\text{AC} - \text{socwr}}{\text{AC}} \cdot 100, $$
compared against the baseline SOC Gap (%). tellegen’s SOCWR is the Jabr SOC
relaxation, the same family as the baseline SOC column, so a near-zero
difference in gap is the expected result. The published SOC bound is recovered as
$\text{AC} \cdot (1 - \text{SOC gap}/100)$.
All three variants are exercised: typical, congested (API), and small-angle (SAD).
tellegen’s AcNetwork carries the angle difference limits and the SOCWR enforces
them in W-space, so the SAD relaxation tracks the published SAD SOC. Where a case
shows a large SOC gap, that measures relaxation quality, not a failure.
Multiconductor IVR OPF
The experimental native IVR formulation
requires both a successful solver status and an independent physical acceptance
check. Tellegen recomputes KCL, KVL, device power links, load/control laws,
selected limits and the objective from the solution and prepared electrical data.
The default maximum normalized residual tolerance is 1e-6 in the model’s
working units. Nonfinite values fail acceptance. Local numerical success does
not establish global optimality.
This check is independent of the solver expression graph but shares PowerIO’s
preparation. It cannot detect a physical constraint discarded before preparation.
The module-JSON entry point and external-case probe therefore use the same
validate_mc_opf_input_diagnostics guard: error diagnostics and codes containing
UNSUPPORTED, MALFORMED, FIELD_DROPPED or RECORD_DROPPED reject the input.
Lossless representation-change remarks, such as capacitor-to-shunt lowering,
are permitted. External comparisons also inspect original input bounds, including
scalar inverter availability and zero available active power.
The experimental MC solve APIs return McOpfError, which implements
std::error::Error and serializes to JSON. Callers match kind and stage
rather than parsing its display message. Kinds distinguish invalid input,
unsupported input, cancellation, numerical failure, physical-validation failure
and serialization failure. Upstream findings retain their codes, severities,
messages and targets. Numerical failures include the solver status when one is
available; they are not infeasibility certificates.
Physical-validation errors include the finite residual summary and the worst
failing witness in each residual family, with component and axis identities.
A witness whose residual cannot be represented as a finite number uses null.
No failure contains an accepted solution. The external-case probe uses the same
structured error object in its error field.
Regression coverage combines:
-
Hand-computed off-solution KCL/KVL/device-law witnesses, mutual coupling, unequal end shunts, and zero/singular branch impedances.
-
Quadratic-row classification and forced sparse-AD comparisons, directional Jacobian/Hessian checks at multiple points with nonzero multipliers and objective factors, and control derivatives at knots and softplus extremes.
-
Base/order invariance, cost-driven dispatch, constraint selection, cancellation, and deliberately corrupted results including NaN and infinity.
-
Feasible and infeasible zero current/apparent-power ratings, partial conductor limits, rotated source phasors and both-end shunts. A grounded terminal may carry nonzero current under a zero apparent-power limit; fixed nonzero voltage makes that same rating require zero current.
-
Frozen BMOPFTools component and unbalanced-network solves, comparing objectives and complex physical voltages, currents, powers and taps with explicit per-fixture tolerances.
-
Complete result export/import across delta devices, neutral returns, transformer rating ports, mixed windings, shunts and optimized taps. Tests reconstruct KCL and complex power from public result identities, preserve diagnostic/provenance records, and reject incomplete or mismatched reports.
-
Explicit initial-point identity/order and base conversion, partial and poor voltage starts, PF-to-OPF seeding, delta terminal power mapping, physical tap conventions, auxiliary consistency, and zero/singular equipment. Regressions check that seeds preserve objective/constraint evaluations, bounds and the physical fingerprint, survive canonical JSON round trips, and reject invalid or unsupported fields with structured diagnostics.
-
Retained sessions versus fresh solves after load, availability, cost and limit edits, including zero-rating transitions, reordered tables and changed bases. Tests verify atomic batch rejection, current/historical result revisions, explicit declared-start selection, compiled-cache reuse, and preservation of the accepted primal across cancellation, numerical/physical-validation failure and infeasible edits.
-
Opt-in dual reports, analytic load and generator-bound marginal signs/units, numerical-base and objective-scale invariance, and centered cost perturbations for lossy P/Q loads, delta coils, both-end branch ratings and voltage floors. Analytic KKT examples and electrical cases cover weak activity, dependent active rows, zero reductions and bounded rank audits without invalidating accepted physical solutions. Saved dual reports reject altered identities, multipliers, scaling, derived values and physical ledgers; version 1 reports without dual data remain readable. Session edits refresh duals with the accepted revision.
-
Local forward/adjoint consistency and centered perturb-and-resolve checks for objective, voltage, dispatch and current/power ledgers under load and limit directions, including delta coils, neutral returns and unequal end shunts. Tests check physical-unit/base/order/objective-scale invariance, objective gradients against reported marginals, normalized-rating multiplier tangents, saved-result reconstruction, inactive/unsupported parameters, and refusal of unresolved active sets or nonunique dispatch. Analytic sparse-KKT tests reject singular/unstable systems, including a full-row-rank constraint Jacobian with a KKT null direction missed by fixed dense probes. Small matrix-only tests check shifted regular systems, reordered/scaled coordinates and inverse residual failures without optimization. Session tests and a compile-fail borrowing example guard current versus historical sensitivity access across edits and failures.
-
Voltage-dependent nominal P/Q marginals and sensitivities for constant-current, constant-impedance, ZIP and exponential loads. Analytic rotated-voltage cases, centered perturbations of wye/delta networks and interior generator dispatch, and direct compiled residual/Jacobian parameter differences check units, signs and mixed derivatives. Coverage includes zero nominal P/Q across equation-form changes, per-coil coefficient/default handling, zero-voltage domain refusals, base/order/objective-scale invariance, session edits and verified legacy report upgrades. Metadata construction preserves the physical graph and bounds.
-
Inverter availability and capability marginals and sensitivities: centered perturb-and-resolve comparisons cover active/inactive P/Q bounds, apparent and current ratings, single-phase return minima, four-leg neutral limits and delta coils. Control cases cover PMax/PAvailable/SMax references, per-phase/averaged monitors, cross-coil availability and deselected capability rows. Interior dispatch and direct residual/Jacobian parameter differences check mixed terms. Other regressions check physical units across bases/objective scales and bus order, inconsistent availability totals, ties and zero-rating refusals, session edits, version 4 round trips and verified version 2/3 upgrades with tamper rejection.
-
Transformer port rating and physical tap-bound marginals and sensitivities. Centered perturbations check winding, winding-terminal and rating-port P/Q and currents, including exciting current, neutral returns, mixed connections and n-winding equipment. Direct/inverse regulator cases exercise both physical bound sides, interior taps and distinct open-delta leg identities. Coverage includes forward/adjoint agreement, cost envelopes, unit/base/scale invariance, session freshness, unsupported axes/fixed taps, zero-rating diagnostic refusal, unchanged physical graphs and version 5 reports with verified legacy upgrades.
-
Shared inverter control-profile marginals and sensitivities. Centered solves check every volt-var/volt-watt breakpoint and endpoint fraction across all power references, leading/lagging power factors, multiple assigned inverters, delta/four-leg coils and averaged phase-ground/neutral/phase monitors. Direct residual/Jacobian differences at knots and saturated voltages check exact mixed derivatives, including smoothing-width changes and flat curves. Further cases check interior dispatch, forward/adjoint agreement, cost envelopes, units and numerical scaling, atomic profile edits, unity-PF/unused-profile refusals, and version 6 round trips with verified legacy upgrades.
-
Sparse rank qualification agrees with the dense pivoted reference on small matrices and covers large diagonal and connected sparse cases, numerical dependence, rescaling/permutations, and explicit fill/work/nonfinite refusals. A known-rank triangular matrix completes within a budget that the former pivot order exhausts; a near-threshold case prevents a sparse sub-tolerance candidate from terminating the audit early. A generated 30-bus, two-wire radial feeder checks qualification, forward/adjoint agreement, cost marginals and linear residuals with bounded CI work. An opt-in connected 48-section feeder exceeds both old dense-audit limits and checks centered perturbations, forward/adjoint agreement, physical cost marginals, base/objective-scale invariance and backsolve diagnostics. Report tests verify legacy dense and sparse rank reports before upgrading and reject tampered audit claims; session tests preserve accepted results and enforce stale-view rules.
-
PF correctness tests use bounded-coefficient algebra at both signs, unity, near-unity and tiny nonzero PF; original-profile validation checks wrong Q and explicit relative-accuracy diagnostics. A one-bus case requires P = 400 W and Q = -300 var at PF 0.8, with an analytic marginal checked by forward/adjoint queries and two perturbed solves (three solves total, 50-iteration ceilings). Retained edits invalidate sensitivities, and legacy PF reports cannot reuse multipliers from the old scaling.
Feeder validation and runtime budgets
mc_opf_feeder uses one authored four-bus feeder with a delta-wye transformer,
two coupled four-wire lines, ZIP wye/delta loads and a controlled four-leg
inverter. Its pinned BMOPFTools reference checks rectangular voltages, line
currents and P/Q, losses, dispatch and original inverter bounds. The test then
checks a nominal-load sensitivity direction against centered solves, reuses one
factorization for forward/adjoint queries, and compares a warm demand/availability/
control edit with a fresh solve. It checks stale access and rejected-edit rollback.
The reference records the exact input hash, oracle revision, Julia/JuMP/Ipopt
versions, solver options, units and explicit tolerances. Objective comparison is
specific to this fixture and matching formulation, not a global-optimality claim.
The CI budget is one fixture, five solves and one sensitivity factorization, with at most 100 iterations per solve. Structural guards keep it at four buses and a KKT dimension below 600. Perturbed and fresh comparison solves skip dual collection. A local unoptimized run took about 3.1 seconds; elapsed time is printed for observation, not asserted against a machine-dependent deadline. A separate generated 30-bus rank regression adds one solve and one sensitivity factorization, capped at 100 iterations, fewer than 1,000 variables, five million rank work units and 50,000 peak coefficients. It took about 1.7 seconds locally in an unoptimized build (352 active rows, 3,120,827 work units, 13,986 peak coefficients). These structural/work guards are asserted; elapsed time is only reported. Compact rank and version 6–9 verification/tamper tests remain in CI. The two larger 48-section studies are ignored by default and require an explicit command:
cargo test -p tellegen --no-default-features --features mc-opf --locked \
--test mc_opf_feeder -- --nocapture
cargo test -p tellegen --no-default-features --features mc-opf --locked \
--lib mc_opf::rank -- --nocapture
cargo test -p tellegen --no-default-features --features mc-opf --locked \
--lib mc_opf::rank_tests -- --ignored --nocapture
python3 scripts/test_enwl_ivr_study.py
The public mc_opf_workflow example is also registered as a test target, so its
external-consumer API imports compile and its three contract tests run in the
ordinary mc-opf suite. It reuses the same four-bus fixture for two solves and
one sensitivity factorization, capped at 100 iterations per solve. A local
debug run took about 3.3 seconds. It checks physical results, edit invalidation,
warm starts, complete report persistence, forward/adjoint agreement with a local
marginal, and typed unavailable/stale diagnostics. Rejected edit rollback,
pre-cancelled attempts, unsupported report versions, declared input preservation,
lossy input diagnostics and selector/edit JSON contracts add no optimization.
There are no new fixtures, oracle runs or finite-difference sweeps. Run it alone:
cargo test -p tellegen --no-default-features --features mc-opf --locked \
--example mc_opf_workflow -- --nocapture
Large external studies stay opt-in. Build the existing probe in release mode;
--qualify adds dual/rank details, KKT structure, view/query timings and one
objective forward/adjoint query using a single factorization, without extra
optimization. An unavailable derivative remains distinct from physical rejection.
In an opt-in check of ENWL LN snapshot t12_1330, the 30-bus case completed all
756 rank pivots using 62,133,130 work units and 87,612 peak coefficients; forward
and adjoint queries were available. The 99- and 538-bus cases still exhausted the
unchanged 100-million-work budget and explicitly refused qualification. This
is evidence for the selected snapshots, not a guarantee for every feeder size
or operating point. The runner records those refusals even when the physical
solve is accepted; its successful exit alone does not establish rank eligibility.
The runner records the executable hash and supports explicit case selection,
case limits and per-process timeouts. Relative paths in a case list resolve
against the list’s directory. Duplicate output filenames are rejected; failed
reruns replace previous accepted records so comparisons cannot use stale data.
cargo build -p tellegen --release --example mc_opf_case_probe \
--no-default-features --features mc-opf --locked
python3 scripts/enwl_ivr_study.py --cases /path/to/selected-cases.json \
--binary target/release/examples/mc_opf_case_probe --output /tmp/feeder-study \
--limit 2 --timeout 120 --qualify
The case list is a JSON array of BMOPF file paths. Existing --case-root ENWL
selection and independent oracle comparison remain available. No dataset or
Julia process is invoked by ordinary CI tests. Regenerate only the new feeder
reference with scripts/mc_opf_oracle.jl feeder in the pinned oracle environment.
The inputs, reference JSON, attribution and license files in
crates/tellegen/tests/data/mc_opf/ are regression assets. Their provenance
records input SHA-256 hashes, oracle revision, units and numerical tolerances;
the component bundles also record Julia/JuMP/Ipopt versions and solver options.
Ordinary Rust tests consume the frozen results without Julia, network access
or an external feeder dataset. Intentional regeneration uses:
julia --project=/path/to/BMOPFTools.jl/test scripts/mc_opf_oracle.jl
The script requires a clean BMOPFTools checkout at
a8b52e069bfd4a7a57434c91bc0470ac03cfdd55. Review changed inputs, hashes and
reference values together; do not relax tolerances to hide a changed electrical
problem. The external study protocol
adds larger-feeder comparisons without vendoring the dataset.
Benchmark results
Generated by the benchmarks harness over PGLib-OPF v23.07. Regenerate with cargo run -p benchmarks --release -- --out <dir> and copy the snapshot here. The provenance table records the toolchain used for this run.
Provenance
| tellegen | rustc | clarabel | faer | powerio | os/arch |
|---|---|---|---|---|---|
178da99 | 1.96.0 (ac68faa20 2026-05-25) | 0.11.1 | 0.24.4 | 0.7.1 | macos/aarch64 |
PGLib v23.07 (arXiv:1908.02788, CC BY 4.0). Command: ./target/release/pglib-bench --out target/pglib-bench-20260720 --book.
Coverage summary
198 (case, variant) rows.
| status | count |
|---|---|
| caveat | 50 |
| failed | 2 |
| skipped | 3 |
| solved | 143 |
Reproduction of PGLib
Corpus roll-up of the per-case marks in the table below. “Reproduced” is an objective match (DC within 1%) or, for the SOCWR relaxation, a valid lower bound whose gap matches the published SOC gap. “Consistent” is an acceptable non-exact agreement: a DC the baseline also reports infeasible, or a SOCWR lower bound with a looser gap. “Mismatch” is a differing objective or a lower-bound violation.
| formulation | reproduced | consistent | mismatch | with baseline |
|---|---|---|---|---|
| DC OPF | 148 | 45 | 0 | 193 |
| SOCWR (lower bound) | 183 | 6 | 0 | 189 |
OPF correctness vs PGLib BASELINE
Tellegen’s objective against the published value, per formulation: the DC OPF (constant cost included) vs the published DC, and the SOCWR relaxation (a lower bound on AC) vs the published AC. Δgap is Tellegen’s SOC gap minus the published SOC gap. The reproduces column is DC·SOC: ✓ matches the published objective (DC within 1%), inf✓ infeasible consistent with the published inf., ✓lb a valid lower bound whose gap matches the published SOC, lb a valid bound with a looser gap, ✗ a mismatch (a converged but differing objective), — no baseline.
| case | var | buses | DC objective | PGLib DC | SOCWR objective | PGLib AC | Δgap | reproduces |
|---|---|---|---|---|---|---|---|---|
| case3_lmbd | api | 3 | 10444.4 | 10444.0 | 10194.9 | 11242.0 | -0.01 | ✓·✓lb |
| case3_lmbd | sad | 3 | 5856.0 | 5856.0 | 5736.2 | 5959.3 | -0.01 | ✓·✓lb |
| case3_lmbd | typ | 3 | 5695.9 | 5695.9 | 5736.2 | 5812.6 | -0.01 | ✓·✓lb |
| case5_pjm | api | 5 | 78025.2 | 78025.0 | 77571.4 | 78950.0 | -0.00 | ✓·✓lb |
| case5_pjm | sad | 5 | — | — | 25164.9 | 26109.0 | -0.00 | inf✓·✓lb |
| case5_pjm | typ | 5 | 17479.9 | 17480.0 | 14999.7 | 17552.0 | -0.01 | ✓·✓lb |
| case14_ieee | api | 14 | 4797.6 | 4797.6 | 5691.8 | 5999.4 | -0.00 | ✓·✓lb |
| case14_ieee | sad | 14 | — | — | 2179.2 | 2776.8 | -0.01 | inf✓·✓lb |
| case14_ieee | typ | 14 | 2051.5 | 2051.5 | 2175.7 | 2178.1 | -0.00 | ✓·✓lb |
| case24_ieee_rts | api | 24 | 148845.5 | 148850.0 | 149168.3 | 161220.0 | -0.00 | ✓·✓lb |
| case24_ieee_rts | sad | 24 | 78122.5 | 78122.0 | 69578.9 | 76918.0 | -0.01 | ✓·✓lb |
| case24_ieee_rts | typ | 24 | 61001.2 | 61001.0 | 63344.6 | 63352.0 | -0.01 | ✓·✓lb |
| case30_as | api | 30 | 3092.1 | 3092.1 | 2767.8 | 4996.2 | -0.01 | ✓·✓lb |
| case30_as | sad | 30 | — | — | 825.9 | 897.4 | 0.08 | inf✓·✓lb |
| case30_as | typ | 30 | 767.6 | 767.6 | 802.7 | 803.1 | -0.00 | ✓·✓lb |
| case30_ieee | api | 30 | 16145.1 | 16145.0 | 17057.8 | 18037.0 | -0.00 | ✓·✓lb |
| case30_ieee | sad | 30 | — | — | 7412.6 | 8208.5 | -0.00 | inf✓·✓lb |
| case30_ieee | typ | 30 | 7472.8 | 7472.8 | 6662.2 | 8208.5 | -0.00 | ✓·✓lb |
| case39_epri | api | 39 | 252754.6 | 252750.0 | 253130.4 | 256770.0 | -0.00 | ✓·✓lb |
| case39_epri | sad | 39 | 150669.9 | 150670.0 | 147360.5 | 148340.0 | -0.01 | ✓·✓lb |
| case39_epri | typ | 39 | 136889.7 | 136890.0 | 137654.1 | 138420.0 | -0.01 | ✓·✓lb |
| case57_ieee | api | 57 | 34081.1 | 34081.0 | 33271.6 | 36242.0 | -0.00 | ✓·✓lb |
| case57_ieee | sad | 57 | — | — | 38391.4 | 38663.0 | -0.01 | inf✓·✓lb |
| case57_ieee | typ | 57 | 34773.0 | 34773.0 | 37529.7 | 37589.0 | -0.00 | ✓·✓lb |
| case60_c | api | 60 | 176378.6 | 176380.0 | 181189.2 | 185000.0 | -0.01 | ✓·✓lb |
| case60_c | sad | 60 | — | — | 108485.3 | 113500.0 | 0.05 | inf✓·✓lb |
| case60_c | typ | 60 | 90700.1 | 90700.0 | 92637.0 | 92694.0 | -0.01 | ✓·✓lb |
| case73_ieee_rts | api | 73 | 472183.2 | 472180.0 | 488422.7 | 509850.0 | -0.01 | ✓·✓lb |
| case73_ieee_rts | sad | 73 | 232679.1 | 232680.0 | 212280.3 | 227600.0 | 0.00 | ✓·✓lb |
| case73_ieee_rts | typ | 73 | 183003.7 | 183000.0 | 189706.1 | 189760.0 | -0.01 | ✓·✓lb |
| case89_pegase | api | 89 | 118452.5 | 118630.0 | 113367.9 | 129570.0 | -0.01 | ✓·✓lb |
| case89_pegase | sad | 89 | — | — | 106491.2 | 107290.0 | 0.01 | inf✓·✓lb |
| case89_pegase | typ | 89 | 104919.0 | 105040.0 | 106480.8 | 107290.0 | 0.00 | ✓·✓lb |
| case118_ieee | api | 118 | 231291.9 | 231290.0 | 184303.2 | 249610.0 | -0.01 | ✓·✓lb |
| case118_ieee | sad | 118 | — | — | 96535.5 | 105160.0 | 0.03 | inf✓·✓lb |
| case118_ieee | typ | 118 | 93100.7 | 93101.0 | 96334.7 | 97214.0 | -0.01 | ✓·✓lb |
| case162_ieee_dtc | api | 162 | 111570.9 | 111570.0 | 115655.9 | 120880.0 | -0.01 | ✓·✓lb |
| case162_ieee_dtc | sad | 162 | 106287.8 | 106290.0 | 101655.6 | 108690.0 | -0.01 | ✓·✓lb |
| case162_ieee_dtc | typ | 162 | 101462.3 | 101460.0 | 101654.9 | 108080.0 | -0.01 | ✓·✓lb |
| case179_goc | api | 179 | 1813209.8 | 1813200.0 | 1727618.5 | 1883400.0 | 0.01 | ✓·✓lb |
| case179_goc | sad | 179 | — | — | 754005.8 | 762530.0 | -0.00 | inf✓·✓lb |
| case179_goc | typ | 179 | 751881.6 | 751880.0 | 753089.1 | 754270.0 | -0.00 | ✓·✓lb |
| case197_snem | api | 197 | 15689.7 | 15690.0 | 16203.0 | 16363.0 | -0.00 | ✓·✓lb |
| case197_snem | sad | 197 | — | — | 1.5 | 1.5 | 0.03 | inf✓·✓lb |
| case197_snem | typ | 197 | 1.5 | 1.5 | 1.5 | 1.5 | 0.02 | ✓·✓lb |
| case200_activ | api | 200 | 40129.8 | 40130.0 | 40692.9 | 40700.0 | -0.00 | ✓·✓lb |
| case200_activ | sad | 200 | — | — | 27556.6 | 27558.0 | -0.01 | inf✓·✓lb |
| case200_activ | typ | 200 | 27479.6 | 27480.0 | 27556.6 | 27558.0 | -0.01 | ✓·✓lb |
| case240_pserc | api | 240 | 4624856.0 | 4624800.0 | 4636792.9 | 4692200.0 | 0.00 | ✓·✓lb |
| case240_pserc | sad | 240 | — | — | 3237213.7 | 3405400.0 | 0.01 | inf✓·✓lb |
| case240_pserc | typ | 240 | 3271442.2 | 3271400.0 | 3237193.6 | 3329700.0 | -0.00 | ✓·✓lb |
| case300_ieee | api | 300 | 659786.2 | 659840.0 | 679566.9 | 686040.0 | -0.01 | ✓·✓lb |
| case300_ieee | sad | 300 | 527243.9 | 527290.0 | 550597.4 | 565700.0 | 0.06 | ✓·✓lb |
| case300_ieee | typ | 300 | 517802.2 | 517850.0 | 550393.8 | 565220.0 | -0.01 | ✓·✓lb |
| case500_goc | api | 500 | 646871.6 | 646870.0 | 663185.9 | 688290.0 | -0.00 | ✓·✓lb |
| case500_goc | sad | 500 | — | — | 454907.9 | 487400.0 | -0.00 | inf✓·✓lb |
| case500_goc | typ | 500 | 440548.6 | 440550.0 | 453838.5 | 454950.0 | -0.01 | ✓·✓lb |
| case588_sdet | api | 588 | 392953.8 | 392950.0 | 387619.1 | 398760.0 | -0.01 | ✓·✓lb |
| case588_sdet | sad | 588 | — | — | 307081.1 | 329360.0 | 0.09 | inf✓·✓lb |
| case588_sdet | typ | 588 | 310125.6 | 310130.0 | 306447.9 | 313140.0 | -0.00 | ✓·✓lb |
| case793_goc | api | 793 | 372180.2 | 372180.0 | 321148.8 | 379800.0 | -0.01 | ✓·✓lb |
| case793_goc | sad | 793 | — | — | 263030.4 | 285800.0 | -0.00 | inf✓·✓lb |
| case793_goc | typ | 793 | 258308.0 | 258310.0 | 256757.9 | 260200.0 | -0.01 | ✓·✓lb |
| case1354_pegase | api | 1354 | 1558525.9 | 1558500.0 | 1578360.1 | 1608200.0 | 0.01 | ✓·✓lb |
| case1354_pegase | sad | 1354 | — | — | 1236022.1 | 1258800.0 | 0.24 | inf✓·✓lb |
| case1354_pegase | typ | 1354 | 1218182.9 | 1218200.0 | 1235968.2 | 1258800.0 | 0.24 | ✓·✓lb |
| case1803_snem | api | 1803 | 62064.2 | 61723.0 | 46102.3 | 80240.0 | 1.70 | ✓·lb |
| case1803_snem | sad | 1803 | — | — | 91290.5 | 106340.0 | 0.16 | inf✓·✓lb |
| case1803_snem | typ | 1803 | 87706.8 | 87696.0 | 90240.4 | 98335.0 | 0.20 | ✓·✓lb |
| case1888_rte | api | 1888 | 1961569.9 | 1961600.0 | 2013300.1 | 2019700.0 | -0.00 | ✓·✓lb |
| case1888_rte | sad | 1888 | 1353179.3 | 1353200.0 | 1373847.5 | 1413900.0 | 0.01 | ✓·✓lb |
| case1888_rte | typ | 1888 | 1352872.6 | 1352900.0 | 1373847.4 | 1402500.0 | -0.01 | ✓·✓lb |
| case1951_rte | api | 1951 | 2411505.2 | 2411500.0 | 2478404.2 | 2490300.0 | -0.00 | ✓·✓lb |
| case1951_rte | sad | 1951 | — | — | 2082719.5 | 2092400.0 | 0.00 | inf✓·✓lb |
| case1951_rte | typ | 1951 | 2031629.3 | 2031600.0 | 2082711.6 | 2085600.0 | -0.00 | ✓·✓lb |
| case2000_goc | api | 2000 | 1409993.7 | 1410000.0 | 1441231.6 | 1483900.0 | 0.01 | ✓·✓lb |
| case2000_goc | sad | 2000 | — | — | 977751.3 | 992880.0 | 0.00 | inf✓·✓lb |
| case2000_goc | typ | 2000 | 943042.6 | 943040.0 | 970446.9 | 973430.0 | -0.00 | ✓·✓lb |
| case2312_goc | api | 2312 | 615216.3 | 615220.0 | 546946.8 | 663440.0 | 0.03 | ✓·✓lb |
| case2312_goc | sad | 2312 | — | — | 444178.0 | 462350.0 | 0.00 | inf✓·✓lb |
| case2312_goc | typ | 2312 | 440328.5 | 440330.0 | 432953.7 | 441330.0 | -0.00 | ✓·✓lb |
| case2383wp_k | api | 2383 | 279125.8 | 279130.0 | 279125.8 | 279130.0 | -0.01 | ✓·✓lb |
| case2383wp_k | sad | 2383 | — | — | 1856608.1 | 1911200.0 | -0.00 | inf✓·✓lb |
| case2383wp_k | typ | 2383 | 1804090.4 | 1804100.0 | 1848908.7 | 1868200.0 | -0.01 | ✓·✓lb |
| case2736sp_k | api | 2736 | 977821.5 | 977820.0 | 939178.2 | 1017800.0 | -0.01 | ✓·✓lb |
| case2736sp_k | sad | 2736 | — | — | 1305707.8 | 1326600.0 | -0.01 | inf✓·✓lb |
| case2736sp_k | typ | 2736 | 1276033.7 | 1276000.0 | 1303994.5 | 1308000.0 | -0.00 | ✓·✓lb |
| case2737sop_k | api | 2737 | 755318.3 | 755320.0 | 733986.1 | 788310.0 | -0.01 | ✓·✓lb |
| case2737sop_k | sad | 2737 | — | — | 776126.6 | 790950.0 | -0.01 | inf✓·✓lb |
| case2737sop_k | typ | 2737 | 764009.8 | 764010.0 | 775689.9 | 777730.0 | -0.01 | ✓·✓lb |
| case2742_goc | api | 2742 | 505399.5 | 505400.0 | 471741.7 | 609960.0 | -0.01 | ✓·✓lb |
| case2742_goc | sad | 2742 | 259696.6 | 259700.0 | 271971.8 | 275710.0 | -0.00 | ✓·✓lb |
| case2742_goc | typ | 2742 | 259696.6 | 259700.0 | 271999.6 | 275710.0 | -0.00 | ✓·✓lb |
| case2746wop_k | api | 2746 | 531726.6 | 531550.0 | 511658.6 | 550480.0 | -0.01 | ✓·✓lb |
| case2746wop_k | sad | 2746 | — | — | 1205170.1 | 1233700.0 | -0.01 | inf✓·✓lb |
| case2746wop_k | typ | 2746 | 1178363.8 | 1178200.0 | 1203861.3 | 1208300.0 | -0.00 | ✓·✓lb |
| case2746wp_k | api | 2746 | 581827.9 | 581830.0 | 581825.1 | 581830.0 | -0.01 | ✓·✓lb |
| case2746wp_k | sad | 2746 | — | — | 1630588.4 | 1666900.0 | -0.01 | inf✓·✓lb |
| case2746wp_k | typ | 2746 | 1581425.1 | 1581400.0 | 1626493.5 | 1631700.0 | -0.01 | ✓·✓lb |
| case2848_rte | api | 2848 | 1488985.3 | 1489000.0 | 1527378.9 | 1531100.0 | -0.01 | ✓·✓lb |
| case2848_rte | sad | 2848 | — | — | 1285682.1 | 1289000.0 | 0.01 | inf✓·✓lb |
| case2848_rte | typ | 2848 | 1267732.3 | 1267700.0 | 1285034.3 | 1286600.0 | -0.01 | ✓·✓lb |
| case2853_sdet | api | 2853 | 2456065.6 | 2456100.0 | 2420923.4 | 2484300.0 | 0.01 | ✓·✓lb |
| case2853_sdet | sad | 2853 | — | — | 2033761.7 | 2069200.0 | 0.01 | inf✓·✓lb |
| case2853_sdet | typ | 2853 | 2036958.3 | 2037000.0 | 2033582.3 | 2052400.0 | 0.01 | ✓·✓lb |
| case2868_rte | api | 2868 | 2277460.8 | 2277500.0 | 2334871.0 | 2343900.0 | 0.01 | ✓·✓lb |
| case2868_rte | sad | 2868 | — | — | 2009425.4 | 2021300.0 | -0.00 | inf✓·✓lb |
| case2868_rte | typ | 2868 | 1966685.0 | 1966700.0 | 2007570.8 | 2009600.0 | 0.00 | ✓·✓lb |
| case2869_pegase | api | 2869 | 2966298.3 | 2966600.0 | 3026118.5 | 3063000.0 | 0.02 | ✓·✓lb |
| case2869_pegase | sad | 2869 | — | — | 2438499.1 | 2468700.0 | 0.10 | inf✓·✓lb |
| case2869_pegase | typ | 2869 | 2386115.8 | 2386400.0 | 2435400.7 | 2462800.0 | 0.10 | ✓·✓lb |
| case3012wp_k | api | 3012 | 851750.5 | 851750.0 | 728874.0 | 914590.0 | -0.00 | ✓·✓lb |
| case3012wp_k | sad | 3012 | — | — | 2578747.0 | 2619500.0 | -0.00 | inf✓·✓lb |
| case3012wp_k | typ | 3012 | 2509001.5 | 2509000.0 | 2574297.7 | 2600800.0 | -0.01 | ✓·✓lb |
| case3022_goc | api | 3022 | 666194.7 | 666190.0 | 594789.6 | 687360.0 | 0.02 | ✓·✓lb |
| case3022_goc | sad | 3022 | 599221.5 | 599220.0 | 584763.7 | 601430.0 | 0.00 | ✓·✓lb |
| case3022_goc | typ | 3022 | 599221.5 | 599220.0 | 584742.8 | 601380.0 | -0.00 | ✓·✓lb |
| case3120sp_k | api | 3120 | 1326454.4 | 1326500.0 | 1178608.6 | 1403500.0 | -0.01 | ✓·✓lb |
| case3120sp_k | sad | 3120 | — | — | 2141758.0 | 2174900.0 | 0.00 | inf✓·✓lb |
| case3120sp_k | typ | 3120 | 2087974.9 | 2088000.0 | 2135975.3 | 2148000.0 | -0.00 | ✓·✓lb |
| case3375wp_k | api | 3374 | 6272121.1 | 6272100.0 | 5865209.8 | 6364100.0 | -0.00 | ✓·✓lb |
| case3375wp_k | sad | 3374 | 7319637.3 | 7319600.0 | 7397595.4 | 7438200.0 | -0.00 | ✓·✓lb |
| case3375wp_k | typ | 3374 | 7317011.9 | 7317000.0 | 7397405.5 | 7438200.0 | -0.00 | ✓·✓lb |
| case3970_goc | api | 3970 | 1227776.4 | 1227800.0 | 1070893.9 | 1749400.0 | -0.00 | ✓·✓lb |
| case3970_goc | sad | 3970 | — | — | 958294.5 | 965550.0 | -0.01 | inf✓·✓lb |
| case3970_goc | typ | 3970 | 934219.4 | 934220.0 | 957739.2 | 960990.0 | -0.00 | ✓·✓lb |
| case4020_goc | api | 4020 | 1082422.1 | 1082400.0 | 1062324.8 | 1281700.0 | -0.00 | ✓·✓lb |
| case4020_goc | sad | 4020 | — | — | 812671.5 | 889690.0 | -0.00 | inf✓·✓lb |
| case4020_goc | typ | 4020 | 795061.9 | 795060.0 | 812181.5 | 822250.0 | -0.01 | ✓·✓lb |
| case4601_goc | api | 4601 | 796409.8 | 796410.0 | 687104.5 | 871240.0 | -0.01 | ✓·✓lb |
| case4601_goc | sad | 4601 | 1195553.7 | 1195500.0 | 822282.0 | 878180.0 | -0.00 | ✓·✓lb |
| case4601_goc | typ | 4601 | 793813.9 | 793810.0 | 821853.5 | 826240.0 | -0.01 | ✓·✓lb |
| case4619_goc | api | 4619 | 1010784.9 | 1010800.0 | 971704.9 | 1068800.0 | -0.01 | ✓·✓lb |
| case4619_goc | sad | 4619 | — | — | 474687.4 | 484350.0 | -0.01 | inf✓·✓lb |
| case4619_goc | typ | 4619 | 457436.6 | 457440.0 | 472392.3 | 476700.0 | -0.01 | ✓·✓lb |
| case4661_sdet | api | 4661 | 2670623.1 | 2670600.0 | 2623054.3 | 2731500.0 | 0.00 | ✓·✓lb |
| case4661_sdet | sad | 4661 | — | — | 2216647.8 | 2261000.0 | 0.00 | inf✓·✓lb |
| case4661_sdet | typ | 4661 | 2216303.9 | 2216300.0 | 2206725.8 | 2251300.0 | -0.01 | ✓·✓lb |
| case4837_goc | api | 4837 | 1209606.3 | 1209600.0 | 1200021.1 | 1291900.0 | -0.01 | ✓·✓lb |
| case4837_goc | sad | 4837 | — | — | 869666.7 | 877120.0 | -0.00 | inf✓·✓lb |
| case4837_goc | typ | 4837 | 850397.1 | 850400.0 | 868168.2 | 872260.0 | -0.00 | ✓·✓lb |
| case4917_goc | api | 4917 | 1703464.0 | 1703500.0 | 1434729.5 | 1717400.0 | 0.08 | ✓·✓lb |
| case4917_goc | sad | 4917 | 1384325.4 | 1384300.0 | 1354002.9 | 1389000.0 | -0.00 | ✓·✓lb |
| case4917_goc | typ | 4917 | 1383656.1 | 1383700.0 | 1353066.3 | 1387800.0 | 0.00 | ✓·✓lb |
| case5658_epigrids | api | 5658 | 1306345.0 | 1306300.0 | 1318822.6 | 1326800.0 | 0.00 | ✓·✓lb |
| case5658_epigrids | sad | 5658 | — | — | 1206615.6 | 1235800.0 | 0.00 | inf✓·✓lb |
| case5658_epigrids | typ | 5658 | 1195466.5 | 1195500.0 | 1205418.3 | 1207300.0 | -0.00 | ✓·✓lb |
| case6468_rte | api | 6468 | 2343290.4 | 2343300.0 | 2436575.4 | 2452700.0 | 0.01 | ✓·✓lb |
| case6468_rte | sad | 6468 | 1982819.8 | 1982800.0 | 2046409.5 | 2069700.0 | 0.01 | ✓·✓lb |
| case6468_rte | typ | 6468 | 1982819.8 | 1982800.0 | 2046150.9 | 2069700.0 | 0.01 | ✓·✓lb |
| case6470_rte | api | 6470 | 2604137.7 | 2604100.0 | 2685118.4 | 2720900.0 | 0.01 | ✓·✓lb |
| case6470_rte | sad | 6470 | 2139078.9 | 2139100.0 | 2198690.4 | 2241600.0 | 0.00 | ✓·✓lb |
| case6470_rte | typ | 6470 | 2136096.9 | 2136100.0 | 2198106.4 | 2237600.0 | 0.01 | ✓·✓lb |
| case6495_rte | api | 6495 | 2924495.6 | 2924500.0 | 3015652.0 | 3130400.0 | 0.01 | ✓·✓lb |
| case6495_rte | sad | 6495 | 2561805.3 | 2561800.0 | 2604047.9 | 3067800.0 | 0.01 | ✓·✓lb |
| case6495_rte | typ | 6495 | 2561788.8 | 2561800.0 | 2604047.9 | 3067800.0 | 0.01 | ✓·✓lb |
| case6515_rte | api | 6515 | 2959744.8 | 2959700.0 | 3057632.1 | 3129200.0 | 0.01 | ✓·✓lb |
| case6515_rte | sad | 6515 | 2559524.4 | 2559500.0 | 2644411.0 | 2869800.0 | 0.00 | ✓·✓lb |
| case6515_rte | typ | 6515 | 2559330.7 | 2559300.0 | 2644404.0 | 2825500.0 | 0.01 | ✓·✓lb |
| case7336_epigrids | api | 7336 | 1980097.5 | 1980100.0 | 1998086.3 | 2035500.0 | -0.00 | ✓·✓lb |
| case7336_epigrids | sad | 7336 | — | — | 1878684.1 | 1888400.0 | -0.01 | inf✓·✓lb |
| case7336_epigrids | typ | 7336 | 1855900.1 | 1855900.0 | 1878683.5 | 1882400.0 | -0.00 | ✓·✓lb |
| case8387_pegase | api | 8387 | 4974002.4 | 4975900.0 | 4637519.2 | 5242800.0 | 1.42 | ✓·lb |
| case8387_pegase | sad | 8387 | 2595938.7 | 2597700.0 | 977279.0 | 2803900.0 | 5.43 | ✓·lb |
| case8387_pegase | typ | 8387 | 2501101.0 | 2502800.0 | 822867.9 | 2771400.0 | 6.20 | ✓·lb |
| case9241_pegase | api | 9241 | 6814526.0 | 6816300.0 | 6840605.9 | 7067900.0 | 0.27 | ✓·✓lb |
| case9241_pegase | sad | 9241 | — | — | 6084311.7 | 6318500.0 | 1.24 | inf✓·lb |
| case9241_pegase | typ | 9241 | 6027173.8 | 6028700.0 | 6075800.7 | 6243100.0 | 0.14 | ✓·✓lb |
| case9591_goc | api | 9591 | 1470245.0 | 1470200.0 | 1346495.0 | 1570300.0 | -0.01 | ✓·✓lb |
| case9591_goc | sad | 9591 | — | — | 1055855.4 | 1167400.0 | -0.01 | inf✓·✓lb |
| case9591_goc | typ | 9591 | 1030938.8 | 1030900.0 | 1055119.5 | 1061700.0 | -0.00 | ✓·✓lb |
| case10000_goc | api | 10000 | 2499133.4 | 2499100.0 | — | — | — | ✓·— |
| case10000_goc | sad | 10000 | — | — | — | — | — | inf✓·— |
| case10000_goc | typ | 10000 | 1346114.3 | 1346100.0 | — | — | — | ✓·— |
| case10192_epigrids | api | 10189 | 1856478.6 | 1856500.0 | 1849684.2 | 1977700.0 | -0.01 | ✓·✓lb |
| case10192_epigrids | sad | 10189 | — | — | 1673015.6 | 1720200.0 | -0.01 | inf✓·✓lb |
| case10192_epigrids | typ | 10189 | 1665551.1 | 1665600.0 | 1672591.5 | 1686900.0 | -0.00 | ✓·✓lb |
| case10480_goc | api | 10480 | 2712412.5 | 2712400.0 | 2709085.2 | 2863500.0 | -0.01 | ✓·✓lb |
| case10480_goc | sad | 10480 | — | — | 2286465.7 | 2314700.0 | -0.01 | inf✓·✓lb |
| case10480_goc | typ | 10480 | 2215826.2 | 2215800.0 | 2286386.9 | 2314600.0 | -0.01 | ✓·✓lb |
| case13659_pegase | api | 13659 | 9117036.9 | 9126300.0 | 9198494.6 | 9385800.0 | 0.15 | ✓·✓lb |
| case13659_pegase | sad | 13659 | — | — | 8829708.1 | 9042200.0 | 0.67 | inf✓·lb |
| case13659_pegase | typ | 13659 | 8763111.4 | 8769900.0 | 8817544.3 | 8948000.0 | 0.07 | ✓·✓lb |
| case19402_goc | api | 19402 | 2458064.0 | 2458100.0 | 2449028.3 | 2583700.0 | -0.01 | ✓·✓lb |
| case19402_goc | sad | 19402 | 1910224.6 | 1910200.0 | 1954400.7 | 1983800.0 | -0.01 | ✓·✓lb |
| case19402_goc | typ | 19402 | 1897794.8 | 1897800.0 | 1954308.1 | 1977800.0 | -0.00 | ✓·✓lb |
| case20758_epigrids | api | 20758 | 3034846.9 | 3034800.0 | 3042940.7 | 3126500.0 | -0.01 | ✓·✓lb |
| case20758_epigrids | sad | 20758 | — | — | 2612726.1 | 2638200.0 | -0.00 | inf✓·✓lb |
| case20758_epigrids | typ | 20758 | 2572328.1 | 2572300.0 | 2608669.6 | 2618600.0 | -0.01 | ✓·✓lb |
| case24464_goc | api | 24464 | — | — | 2560710.2 | 2684000.0 | -0.01 | —·✓lb |
| case24464_goc | sad | 24464 | — | — | 2605377.1 | 2654000.0 | -0.01 | —·✓lb |
| case24464_goc | typ | 24464 | 2512811.8 | 2512800.0 | 2604171.3 | 2629500.0 | -0.01 | ✓·✓lb |
| case30000_goc | api | 30000 | 1700874.2 | 1700900.0 | — | — | — | ✓·— |
| case30000_goc | sad | 30000 | 1297528.4 | 1297500.0 | — | — | — | ✓·— |
| case30000_goc | typ | 30000 | 1092116.1 | 1092100.0 | — | — | — | ✓·— |
Sensitivity parity (finite differences)
Per size band. adj−fwd is the largest observed difference between the two implicit solve directions. FdClean and coupled are central difference relative errors per parity class, shown as median/worst. Coupled cells contain reactive quantities, squared voltage, or conductance. A central difference that crosses an active set boundary measures two local regimes, so the table keeps both median and worst values. Columns below the stated numerical floor are skipped.
| band | formulation | cases | cells | FD cols | worst adj−fwd | FdClean med/worst | coupled med/worst |
|---|---|---|---|---|---|---|---|
| 100–1k | ac | 30 | 51 | 294 | 7.4898e-14 | 8.4965e-9 / 8.7898e-7 | — |
| 100–1k | dc | 30 | 22 | 16 | 2.6468e-13 | 4.4498e-2 / 9.2257e-1 | — |
| 100–1k | socwr | 30 | 300 | 1127 | 1.6558e-7 | 2.6745e-3 / 5.1572e5 | 8.4129e-2 / 4.1153e2 |
| 1k–10k | ac | 3 | 6 | 36 | 1.6549e-15 | 7.1479e-9 / 9.2028e1 | — |
| 1k–10k | dc | 3 | 2 | 1 | 8.6689e-21 | 8.0256e-5 / 8.0256e-5 | — |
| 1k–10k | socwr | 3 | 30 | 116 | 1.3965e-10 | 1.9303e-1 / 1.3502e0 | 1.7219e0 / 6.1760e0 |
| <100 | ac | 33 | 78 | 329 | 1.1102e-15 | 1.4183e-8 / 2.6527e-6 | — |
| <100 | dc | 33 | 26 | 48 | 1.6409e-10 | 4.0039e-6 / 1.1623e1 | — |
| <100 | socwr | 33 | 330 | 999 | 9.8460e-7 | 4.9246e-5 / 3.4204e1 | 3.9313e-3 / 2.8670e2 |
Performance (wall time per stage)
Median milliseconds per stage, by size band. Solves are single-threaded.
| band | cases | parse | build | DC | SOCWR | AC PF | sens |
|---|---|---|---|---|---|---|---|
| <100 | 33 | 0.08 | 0.04 | 0.74 | 4.73 | 0.22 | 385.35 |
| 100–1k | 30 | 0.28 | 0.18 | 7.64 | 65.45 | 9.60 | 6125.20 |
| 1k–10k | 108 | 2.81 | 2.13 | 165.68 | 1444.30 | 507.97 | 0.00 |
| >10k | 24 | 17.78 | 21.60 | 1297.56 | 10187.04 | 3892.62 | 0.00 |
Limits and skips
Every capped, failed, or caveated case, with its reason (no silent truncation).
| case | var | buses | status | notes |
|---|---|---|---|---|
| case5_pjm | sad | 5 | caveat | DC infeasible (DC OPF solve infeasible: PrimalInfeasible); consistent with BASELINE inf. |
| case14_ieee | sad | 14 | caveat | DC infeasible (DC OPF solve infeasible: PrimalInfeasible); consistent with BASELINE inf. |
| case30_as | sad | 30 | caveat | DC infeasible (DC OPF solve infeasible: PrimalInfeasible); consistent with BASELINE inf. |
| case30_ieee | sad | 30 | caveat | DC infeasible (DC OPF solve infeasible: PrimalInfeasible); consistent with BASELINE inf. |
| case57_ieee | sad | 57 | caveat | DC infeasible (DC OPF solve infeasible: PrimalInfeasible); consistent with BASELINE inf. |
| case60_c | sad | 60 | caveat | DC infeasible (DC OPF solve infeasible: PrimalInfeasible); consistent with BASELINE inf. |
| case89_pegase | sad | 89 | caveat | DC infeasible (DC OPF solve infeasible: PrimalInfeasible); consistent with BASELINE inf. |
| case118_ieee | sad | 118 | caveat | DC infeasible (DC OPF solve infeasible: PrimalInfeasible); consistent with BASELINE inf. |
| case179_goc | sad | 179 | caveat | DC infeasible (DC OPF solve infeasible: PrimalInfeasible); consistent with BASELINE inf.; AC power flow did not converge: best mismatch 4.857e1 over 5 starts |
| case197_snem | sad | 197 | caveat | DC infeasible (DC OPF solve infeasible: PrimalInfeasible); consistent with BASELINE inf. |
| case200_activ | sad | 200 | caveat | DC infeasible (DC OPF solve infeasible: PrimalInfeasible); consistent with BASELINE inf. |
| case240_pserc | sad | 240 | caveat | DC infeasible (DC OPF solve infeasible: PrimalInfeasible); consistent with BASELINE inf.; AC power flow did not converge: best mismatch 7.232e1 over 5 starts |
| case500_goc | sad | 500 | caveat | DC infeasible (DC OPF solve infeasible: PrimalInfeasible); consistent with BASELINE inf. |
| case588_sdet | sad | 588 | caveat | DC infeasible (DC OPF solve infeasible: PrimalInfeasible); consistent with BASELINE inf. |
| case793_goc | sad | 793 | caveat | DC infeasible (DC OPF solve infeasible: PrimalInfeasible); consistent with BASELINE inf. |
| case1354_pegase | sad | 1354 | caveat | DC infeasible (DC OPF solve infeasible: PrimalInfeasible); consistent with BASELINE inf. |
| case1803_snem | sad | 1803 | caveat | DC infeasible (DC OPF solve infeasible: PrimalInfeasible); consistent with BASELINE inf.; AC power flow did not converge: best mismatch 1.519e0 over 5 starts; sensitivity skipped: buses 1803 exceed –max-sens-bus 1500 |
| case1951_rte | sad | 1951 | caveat | DC infeasible (DC OPF solve infeasible: PrimalInfeasible); consistent with BASELINE inf.; AC power flow did not converge: best mismatch 5.113e1 over 5 starts; sensitivity skipped: buses 1951 exceed –max-sens-bus 1500 |
| case2000_goc | sad | 2000 | caveat | DC infeasible (DC OPF solve infeasible: PrimalInfeasible); consistent with BASELINE inf.; AC power flow did not converge: best mismatch 1.828e0 over 5 starts; sensitivity skipped: buses 2000 exceed –max-sens-bus 1500 |
| case2312_goc | sad | 2312 | caveat | DC infeasible (DC OPF solve infeasible: PrimalInfeasible); consistent with BASELINE inf.; sensitivity skipped: buses 2312 exceed –max-sens-bus 1500 |
| case2383wp_k | sad | 2383 | caveat | DC infeasible (DC OPF solve infeasible: PrimalInfeasible); consistent with BASELINE inf.; sensitivity skipped: buses 2383 exceed –max-sens-bus 1500 |
| case2736sp_k | sad | 2736 | caveat | DC infeasible (DC OPF solve infeasible: PrimalInfeasible); consistent with BASELINE inf.; sensitivity skipped: buses 2736 exceed –max-sens-bus 1500 |
| case2737sop_k | sad | 2737 | caveat | DC infeasible (DC OPF solve infeasible: PrimalInfeasible); consistent with BASELINE inf.; sensitivity skipped: buses 2737 exceed –max-sens-bus 1500 |
| case2746wop_k | sad | 2746 | caveat | DC infeasible (DC OPF solve infeasible: PrimalInfeasible); consistent with BASELINE inf.; sensitivity skipped: buses 2746 exceed –max-sens-bus 1500 |
| case2746wp_k | sad | 2746 | caveat | DC infeasible (DC OPF solve infeasible: PrimalInfeasible); consistent with BASELINE inf.; sensitivity skipped: buses 2746 exceed –max-sens-bus 1500 |
| case2848_rte | sad | 2848 | caveat | DC infeasible (DC OPF solve infeasible: PrimalInfeasible); consistent with BASELINE inf.; AC power flow did not converge: best mismatch 5.923e-1 over 5 starts; sensitivity skipped: buses 2848 exceed –max-sens-bus 1500 |
| case2853_sdet | sad | 2853 | caveat | DC infeasible (DC OPF solve infeasible: PrimalInfeasible); consistent with BASELINE inf.; AC power flow did not converge: best mismatch 1.030e1 over 5 starts; sensitivity skipped: buses 2853 exceed –max-sens-bus 1500 |
| case2868_rte | sad | 2868 | caveat | DC infeasible (DC OPF solve infeasible: PrimalInfeasible); consistent with BASELINE inf.; AC power flow did not converge: best mismatch 3.169e1 over 5 starts; sensitivity skipped: buses 2868 exceed –max-sens-bus 1500 |
| case2869_pegase | sad | 2869 | caveat | DC infeasible (DC OPF solve infeasible: PrimalInfeasible); consistent with BASELINE inf.; sensitivity skipped: buses 2869 exceed –max-sens-bus 1500 |
| case3012wp_k | sad | 3012 | caveat | DC infeasible (DC OPF solve infeasible: PrimalInfeasible); consistent with BASELINE inf.; AC power flow did not converge: best mismatch 1.335e0 over 5 starts; sensitivity skipped: buses 3012 exceed –max-sens-bus 1500 |
| case3120sp_k | sad | 3120 | caveat | DC infeasible (DC OPF solve infeasible: PrimalInfeasible); consistent with BASELINE inf.; sensitivity skipped: buses 3120 exceed –max-sens-bus 1500 |
| case3970_goc | sad | 3970 | caveat | DC infeasible (DC OPF solve infeasible: PrimalInfeasible); consistent with BASELINE inf.; sensitivity skipped: buses 3970 exceed –max-sens-bus 1500 |
| case4020_goc | sad | 4020 | caveat | DC infeasible (DC OPF solve infeasible: PrimalInfeasible); consistent with BASELINE inf.; AC power flow did not converge: best mismatch 2.905e0 over 5 starts; sensitivity skipped: buses 4020 exceed –max-sens-bus 1500 |
| case4619_goc | sad | 4619 | caveat | DC infeasible (DC OPF solve infeasible: PrimalInfeasible); consistent with BASELINE inf.; sensitivity skipped: buses 4619 exceed –max-sens-bus 1500 |
| case4661_sdet | sad | 4661 | caveat | DC infeasible (DC OPF solve infeasible: PrimalInfeasible); consistent with BASELINE inf.; AC power flow did not converge: best mismatch 6.734e-1 over 5 starts; sensitivity skipped: buses 4661 exceed –max-sens-bus 1500 |
| case4837_goc | sad | 4837 | caveat | DC infeasible (DC OPF solve infeasible: PrimalInfeasible); consistent with BASELINE inf.; AC power flow did not converge: best mismatch 8.525e0 over 5 starts; sensitivity skipped: buses 4837 exceed –max-sens-bus 1500 |
| case5658_epigrids | sad | 5658 | caveat | DC infeasible (DC OPF solve infeasible: PrimalInfeasible); consistent with BASELINE inf.; sensitivity skipped: buses 5658 exceed –max-sens-bus 1500 |
| case7336_epigrids | sad | 7336 | caveat | DC infeasible (DC OPF solve infeasible: PrimalInfeasible); consistent with BASELINE inf.; sensitivity skipped: buses 7336 exceed –max-sens-bus 1500 |
| case9241_pegase | sad | 9241 | caveat | DC infeasible (DC OPF solve infeasible: PrimalInfeasible); consistent with BASELINE inf.; AC power flow did not converge: best mismatch 6.289e1 over 5 starts; sensitivity skipped: buses 9241 exceed –max-sens-bus 1500 |
| case9591_goc | sad | 9591 | caveat | DC infeasible (DC OPF solve infeasible: PrimalInfeasible); consistent with BASELINE inf.; AC power flow did not converge: best mismatch 7.825e0 over 5 starts; sensitivity skipped: buses 9591 exceed –max-sens-bus 1500 |
| case10000_goc | api | 10000 | caveat | SOCWR solve failed: DC OPF solve did not converge: NumericalError; AC power flow did not converge: best mismatch 5.306e0 over 5 starts; sensitivity skipped: buses 10000 exceed –max-sens-bus 1500 |
| case10000_goc | sad | 10000 | caveat | DC infeasible (DC OPF solve infeasible: PrimalInfeasible); consistent with BASELINE inf.; SOCWR solve failed: DC OPF solve did not converge: NumericalError; AC power flow did not converge: best mismatch 1.452e1 over 5 starts; sensitivity skipped: buses 10000 exceed –max-sens-bus 1500 |
| case10000_goc | typ | 10000 | caveat | SOCWR solve failed: DC OPF solve did not converge: NumericalError; AC power flow did not converge: best mismatch 1.452e1 over 5 starts; sensitivity skipped: buses 10000 exceed –max-sens-bus 1500 |
| case10192_epigrids | sad | 10189 | caveat | DC infeasible (DC OPF solve infeasible: PrimalInfeasible); consistent with BASELINE inf.; bus count 10189 differs from BASELINE nodes 10192; AC power flow did not converge: best mismatch 1.441e1 over 5 starts; sensitivity skipped: buses 10192 exceed –max-sens-bus 1500 |
| case10480_goc | sad | 10480 | caveat | DC infeasible (DC OPF solve infeasible: PrimalInfeasible); consistent with BASELINE inf.; AC power flow did not converge: best mismatch 5.689e0 over 5 starts; sensitivity skipped: buses 10480 exceed –max-sens-bus 1500 |
| case13659_pegase | sad | 13659 | caveat | DC infeasible (DC OPF solve infeasible: PrimalInfeasible); consistent with BASELINE inf.; AC power flow did not converge: best mismatch 2.786e1 over 5 starts; sensitivity skipped: buses 13659 exceed –max-sens-bus 1500 |
| case20758_epigrids | sad | 20758 | caveat | DC infeasible (DC OPF solve infeasible: PrimalInfeasible); consistent with BASELINE inf.; AC power flow did not converge: best mismatch 2.751e-1 over 5 starts; sensitivity skipped: buses 20758 exceed –max-sens-bus 1500 |
| case24464_goc | api | 24464 | failed | DC OPF solve failed: DC OPF solve did not converge: NumericalError; AC power flow did not converge: best mismatch 1.699e1 over 5 starts; sensitivity skipped: buses 24464 exceed –max-sens-bus 1500 |
| case24464_goc | sad | 24464 | failed | DC OPF solve failed: DC OPF solve did not converge: NumericalError; AC power flow did not converge: best mismatch 2.075e1 over 5 starts; sensitivity skipped: buses 24464 exceed –max-sens-bus 1500 |
| case30000_goc | api | 30000 | caveat | SOCWR solve failed: DC OPF solve did not converge: NumericalError; AC power flow did not converge: best mismatch 3.598e0 over 5 starts; sensitivity skipped: buses 30000 exceed –max-sens-bus 1500 |
| case30000_goc | sad | 30000 | caveat | SOCWR solve failed: DC OPF solve did not converge: NumericalError; AC power flow did not converge: best mismatch 1.198e1 over 5 starts; sensitivity skipped: buses 30000 exceed –max-sens-bus 1500 |
| case30000_goc | typ | 30000 | caveat | SOCWR solve failed: DC OPF solve did not converge: NumericalError; AC power flow did not converge: best mismatch 1.198e1 over 5 starts; sensitivity skipped: buses 30000 exceed –max-sens-bus 1500 |
| case78484_epigrids | api | 78484 | skipped | timed out after 180s |
| case78484_epigrids | sad | 78484 | skipped | timed out after 180s |
| case78484_epigrids | typ | 78484 | skipped | timed out after 180s |
198 rows; 55 skipped/failed/caveat.
RMS dynamic simulation in the browser
WECC 240 (243 buses, 103 machines, 37 renewable plants), measured on an Apple
silicon laptop, the wasm module the web app ships (conic, synth, rms,
rms-experimental) run single-threaded in Node:
| Stage | wasm | native (release) |
|---|---|---|
Prepare the case (RmsCase) | 55 ms | — |
| 20 s run, 2.5 ms step, display channels and screening | 1.2–1.5 s | 0.67 s |
| Dense small-signal modes (1,658 states) | many minutes | 8.3 s |
The four validated 20 s scenarios at 5 ms run in about 1.2 s natively in all. The RMS features add 0.78 MB to the raw module (17.1 MB) and 285 kB (5.1 %) gzipped, so they ship in the main module rather than a separate asset.
Multiconductor PF interactive performance
A retained multiconductor power-flow session (McPfSession in Rust,
createMcPfSession in the browser engine) keeps the prepared network, the
compensation operator, its sparse LU factorization, and the last converged
voltages. This page states what an ordinary load edit is allowed to cost, how
that is measured, and the measurements behind it
(#132).
Target and budgets
| Budget | Value | Measured |
|---|---|---|
| UI-visible latency, single-branch load edit, generated ~10,000-bus feeder (9,950 buses, 32,412 terminals), Chromium on Apple M-series | ≤ 100 ms p95 | 15.6 ms p95 |
| Per-edit response | constant size, ≤ 2 KiB (McPfSummary) | 563–571 bytes at every size up to 676,530 terminals |
| Results-panel detail page (one bus, 20 equipment ports) | ≤ 32 KiB | ≈ 4.9 KB |
| Terminal arrays, fetched on demand | 16 bytes per terminal per quantity, transferred rather than copied | 0.5 MiB (32,412 terminals) to 10.3 MiB (676,530) |
| Network materializations during an ordinary edit | 0 | 0 |
| Live engine heap after an edit | unchanged (± 64 KiB) | unchanged (0 bytes) |
| WASM linear memory across edits | no growth | no growth over 20 edits |
| Transient heap during an edit | proportional to terminals, no network or result copy | about 85 bytes per terminal |
The 180 ms debounce that coalesces rapid edits in the Studies panel is a deliberate delay and is excluded from every latency figure. Saving, exporting, attaching geography, and opening the full result build portable documents on demand; their cost is reported below but is not part of an ordinary edit.
What an edit costs
An ordinary edit replaces the absolute set of load-branch powers. The session
updates only the prepared current laws of the loads that changed (physical
nominal admittance is recomputed; the fixed-point compensation reference and
the LU factorization stay frozen), warm-starts from the last converged
voltages, and reduces the converged phasors to a summary: convergence,
residuals, the load voltage range and violation count, source power, passive
loss, and counts. The summary runs the same output finiteness checks as the
full result without building per-terminal records. The base network and
instance are never copied or rebuilt by an edit; materialization_count
counts the edited networks built for portable output, and stays zero across
ordinary edits.
The browser makes one engine round trip per edit. Terminal and equipment
detail is fetched only when a view asks for it: the Studies panel requests one
bus’s terminals and one 20-row equipment page, terminalVoltages() and
terminalCurrents() return transferable Float64Arrays, and result() still
builds the complete McPfResult for export. Whole-network views (the overview
and the diagram) read resultTables() instead: the same terminals, ports, and
source reactions as columns, moved as two transferable arrays plus one list of
names. For a 57,757-bus city model that is about 40 MB, against a 166 MiB JSON
result that the page would parse into an object per terminal and port. Detail pages
carry the solve count they describe, so a page from an older operating point is
discarded.
The four latency components are measured separately:
| Component | Meaning | How it is measured |
|---|---|---|
| Numerical solve | Engine time for the edit request: the warm fixed point and the summary | engine_ms from the worker, split by the session profile into load evaluation, KCL residuals and compensated right-hand sides, retained LU solves, and the summary |
| Network materialization | Building an edited network for portable output | Zero per edit (materializationCount()); inputModule() and snapshot() are timed separately |
| Serialization and parsing | Moving the response to the page | Summary JSON in the engine, transfer (round trip minus engine time), and JSON.parse on the page |
| UI-visible | From the edit request to the updated state and the next animation frame | Round trip, parse, and one requestAnimationFrame; with the results panel open, plus its detail request |
Results
Measurements below use deterministic generated feeders
(benchmarks::mc_feeder), on an Apple M5 Pro (18 CPUs, 64 GiB). feeder-10k
and feeder-106k match the shapes reported in #132; x300k and x650k are
exploratory points at the SMART-DS Greensboro and San Francisco P5U
conductor-node counts. Each preset converges in 9–11 iterations with a minimum
load-branch voltage of about 0.93 pu; single-branch edits take 6–8. “Before”
is the session as of 0.3.0 (commit ee23ab8, which cloned the network,
rebuilt the instance, and returned the complete result on every edit), run
with the same harness, inputs, and edit sequence.
| Preset | Buses | Terminals | Lines | Transformers | Loads (branches) | Module |
|---|---|---|---|---|---|---|
feeder-10k | 9,950 | 32,412 | 9,299 | 650 | 7,721 (9,299) | 11.4 MiB |
feeder-106k | 27,239 | 106,038 | 27,803 | 0 | 2,103 (3,391) | 21.7 MiB |
x300k | 81,406 | 316,904 | 83,095 | 0 | 6,285 (10,135) | 65.1 MiB |
x650k | 173,787 | 676,530 | 177,391 | 0 | 13,418 (21,636) | 139.2 MiB |
Browser
Chromium 153 (headless), the shipped WASM build (release profile,
opt-level “s”), 20 single-branch edits.
| Preset | UI-visible median / p95, before | after | Per-edit response, before | after |
|---|---|---|---|---|
feeder-10k | 147.5 / 153.3 ms | 15.2 / 15.6 ms | 25.8 MB result + 1.4 MB load branches | 566 B |
feeder-106k | 427.4 / 446.7 ms | 50.0 / 65.3 ms | 75.9 MB + 0.5 MB | 568 B |
x300k | 1,365 / 1,480 ms | 181 / 203 ms | 227.1 MB + 1.6 MB | 569 B |
Opening the results panel adds one detail request of 0.1–0.2 ms and about 4.9 KB. Median components after the change:
| Preset | Engine solve | Load evaluation | KCL and matvec | LU solves | Summary | Transfer + parse | Materialization |
|---|---|---|---|---|---|---|---|
feeder-10k | 11.8 ms | 1.7 | 3.2 | 4.7 | 1.4 | < 0.1 ms | 0 |
feeder-106k | 49.8 ms | 0.7 | 9.5 | 32.3 | 4.4 | < 0.1 ms | 0 |
x300k | 180.6 ms | 2.7 | 30.8 | 121.7 | 13.1 | < 0.2 ms | 0 |
Before the change the corresponding engine call took 102.6, 299.2, and 979 ms (solve, network copy, instance rebuild, result construction, and JSON serialization together), and parsing the result on the page took a further 37.3, 111.5, and 356 ms. Building the complete result on demand now costs 51 / 153 / 450 ms in the engine plus 41 / 117 / 361 ms of parsing, only when it is requested.
Creating a session (parse, prepare, factor, first solve, summary, and the load branch list) takes 256 ms, 832 ms, and 2.79 s, compared with 428 ms, 1.22 s, and 3.98 s when the full result was fetched with it.
Native
release-py profile (opt-level 3), 20 single-branch edits; the counting
allocator reports heap bytes.
| Preset | Edit median / p95, before | after | Result or summary JSON per edit, before | after | Edit heap peak, before | after |
|---|---|---|---|---|---|---|
feeder-10k | 42.9 / 46.8 ms + 20.8 ms JSON | 5.7 / 6.5 ms | 24.6 MiB | 565 B | 39.1 MiB | 2.6 MiB |
feeder-106k | 105.5 / 119.3 ms + 61.3 ms | 18.8 / 25.3 ms | 72.4 MiB | 569 B | 80.2 MiB | 8.7 MiB |
x300k | 356.3 / 381.5 ms + 185.1 ms | 72.4 / 79.5 ms | 216.6 MiB | 570 B | 274.7 MiB | 25.9 MiB |
x650k | 733.3 / 768.8 ms + 399.2 ms | 139.0 / 154.6 ms | 464.4 MiB | 571 B | 570.0 MiB | 55.3 MiB |
| Preset | Load evaluation | KCL and matvec | LU solves | Summary | Cold start, before → after | Retained heap, before → after |
|---|---|---|---|---|---|---|
feeder-10k | 0.8 ms | 1.4 | 2.4 | 0.7 | 182 → 131 ms | 106 → 67 MiB |
feeder-106k | 0.4 ms | 3.7 | 11.6 | 2.1 | 442 → 391 ms | 319 → 230 MiB |
x300k | 1.5 ms | 12.6 | 46.0 | 6.5 | 1.43 → 1.19 s | 968 → 667 MiB |
x650k | 3.4 ms | 25.5 | 87.5 | 14.1 | 3.12 → 2.61 s | 1.86 → 1.25 GiB |
The retained heap fell because the session no longer keeps a second copy of the stored module text and freezes the stamped admittances into compressed rows. A feeder-wide 1.05× edit takes 9.5 ms, 31 ms, 97 ms, and 216 ms (before: 47, 129, 392, and 890 ms) and agrees with a freshly prepared solve to 8.7×10⁻¹⁰ V / 3.5×10⁻⁹ A, 6.8×10⁻⁹ V / 2.0×10⁻⁸ A, 5.1×10⁻⁹ V / 2.9×10⁻⁸ A, and 5.1×10⁻⁹ V / 4.2×10⁻⁸ A, unchanged from before, with one factorization throughout. Results are bit-identical to the previous solver on every oracle and load-model fixture, for one-shot solves and for warm session edits.
Memory in the browser engine
| Preset | Live heap after create | Linear memory after create | Transient per edit | Linear memory after 20 edits, before → after | Page JS heap after edits, before → after |
|---|---|---|---|---|---|
feeder-10k | 47.8 MiB | 115.6 MiB | 2.6 MiB | 171 → 115.6 MiB | 195 → 4.6 MiB |
feeder-106k | 177.8 MiB | 394.1 MiB | 8.7 MiB | 587 → 394.1 MiB | 543 → 3.4 MiB |
x300k | 508.5 MiB | 1,008 MiB | 25.9 MiB | 1,394 → 1,008 MiB | 541 → 5.1 MiB |
WASM linear memory only grows, so it records the largest transient since the worker started; the live heap is what a session holds. Saving or exporting is the memory high-water mark: at 106,038 terminals the snapshot takes 668 ms, peaks at 563 MiB of engine heap, and grows linear memory to 938 MiB.
Reproduce
# Native: any preset, a stored PowerIO module, or a raw BMOPF file.
just mc-pf-bench feeder-106k
cargo run -p benchmarks --profile release-py --bin mc-pf-session-bench -- --bmopf case.json
# The CI regression (deterministic checks only, never timing).
just mc-pf-regression
# Browser: build the WASM, write the modules, then run the opt-in spec.
npm run wasm
cargo run -p benchmarks --profile release-py --bin mc-pf-session-bench -- \
--preset feeder-10k --write-module target/mc-pf-bench/modules/feeder-10k.pio.json
TELLEGEN_MC_BENCH=1 \
TELLEGEN_MC_BENCH_MODULES=$PWD/target/mc-pf-bench/modules/feeder-10k.pio.json \
npx --prefix apps/web playwright test --config apps/web/playwright.config.ts mc-pf-bench
The native harness writes native-<label>.json and .md, and the browser
spec writes browser-<label>.json, under target/mc-pf-bench/.
Scope and limits
- The generated feeders reproduce the dimensions of the cases reported in
#132, not their files: the original ~10,000-bus case needed 21 cold
iterations and carried a 70.3 MB BMOPF document, while the generated preset
needs 9 and 11.4 MiB.
--bmopfand--modulerun the same measurements on a real file. x650k’s 139 MiB module exceeds the browser’s 128 MiB input boundary, so the 676,530-terminal point is native only. A saved Study embeds its input, its PowerIO solution, and the full result; at 106,038 terminals that is about 138 MiB, beyond the same boundary. Reading back a stored solution with more than 65,536 terminal values needs PowerIO 0.11.4 (eigenergy/powerio#550), which reads up to 4,194,304 per vector; the document-size limit is tracked in eigenergy/powerio#544.- With copying and result construction removed, the retained LU solves are the largest share of a large edit. Backend speed, conditioning, and the faer/KLU comparison are tracked in #153.
- At the largest sizes the cold start is dominated by preparation (admittance stamping), 1.48 of 2.61 s at 676,530 terminals; the per-load lookup that made preparation quadratic in the load count has been removed.
- Raw SMART-DS import and nonlinear Tellegen solves of those regions are not established; the exploratory presets are generated models of the same size.
References
Citing tellegen
- S. Talkington, F. Geth, Q. Zhang, L. Xie, and S. Liu, Interactive Power Flow
in the Browser, The Inaugural ACM Conference on Digital Transformation (ACM
DXConf 2026), Ann Arbor, MI, USA, October 2026. ACM, New York, NY, USA, 9 pages.
doi:10.1145/3847238.3849038,
arXiv:2610.01922. The repository’s
CITATION.cffand README carry the BibTeX entry.
PGLib-OPF
The benchmark corpus and the reference solves.
- IEEE PES Power Grid Library — Optimal Power Flow, v23.07. https://github.com/power-grid-lib/pglib-opf
- Archive report: S. Babaeinejadsarookolaee et al., The Power Grid Library for Benchmarking AC Optimal Power Flow Algorithms, arXiv:1908.02788.
- License: the PGLib data is CC BY 4.0; the software is MIT. The corpus is
read from
$PGLIB_OPF_PATHand never vendored. Per-file header attribution is preserved for any case quoted in these docs. - Reference solves:
$PGLIB_OPF_PATH/BASELINE.md(PowerModels.jl with IPOPT).
Formulation references
- Jabr SOCWR: R. A. Jabr, Radial distribution load flow using conic programming, IEEE Transactions on Power Systems, 21(3), 2006. The paper gives the W-space second-order cone relaxation, also implemented in PowerModels.jl (BSD-3-Clause); the conic implementation in tellegen is independent.
Solvers and linear algebra
- Clarabel.rs: the convex conic and quadratic program solver.
- faer: the dense linear algebra used by the sensitivity driver.
PowerIO consumer review
Tellegen builds against PowerIO 0.12, starting with 0.12.0. The workspace
requires 0.12, so any later 0.12 release satisfies it, and the lockfile
records one checksummed crates.io release for every PowerIO component.
docs/evidence/webmcp/powerio-releases.json maps each published release tag to
its commit.
Pull requests that change the dependency manifests, lockfile, or pin scripts
run the PowerIO Candidate workflow against the committed dependency set.
Manual dispatch can test a full PowerIO commit SHA using temporary Git patches
and a disposable lockfile. It reads the exact selected checkout’s version and
temporarily updates the dependency requirements too, and it accepts only a
0.12 checkout. Both paths verify one common version and source for every
PowerIO component, including the archive crate, before exercising Rust,
WebAssembly, WebMCP, and browser integration.
Moving from PowerIO 0.11
PowerIO’s own guide, “From 0.11 to 0.12”, lists every change. The ones that reach Tellegen:
- Thermal ratings. PowerIO 0.12 states a branch or winding with no thermal
bound as a rating of positive infinity and reads a numeric zero as a zero
apparent-power bound. Format readers translate their own convention (a
MATPOWER
0still means no bound in the file), and a 0.11 IR document is read with the meaning it had.tellegen::ratings::unlimitedis the one place Tellegen decides whether a rating limits a branch; the browser and HTTP payloads still state an unrated branch as0. - SOCWR solution columns. The SOCWR result’s branch power columns are named
*_flow, with identical row order, units and values. - OpenDSS snapshots. PowerIO 0.12’s distribution readiness checks let a raw OpenDSS import solve as a multiconductor power flow snapshot instead of remaining view-only.
- Document version. See below.
The powerio-012 Cargo feature selected these paths while the shipping build
was on 0.11. They are now unconditional and the feature is a no-op, kept in
every manifest so existing build commands and TELLEGEN_POWERIO_FEATURES
values keep resolving. ZIP and folder collection support is still opt-in
through the tellegen-wasm powerio-collections feature.
PowerIO owns document-version validation. The 0.12 reader accepts both the
0.11 integer 2 and its own release-string header, such as "0.12.0", and
writes "0.12.0". A 0.11 reader refuses a 0.12 document, so documents
Tellegen saves now need PowerIO 0.12 to read them; documents saved by earlier
Tellegen releases still open. Tellegen does not rewrite that header. Study
artifacts pass through the same PowerIO reader as ordinary imports, so a
reader-compatible document is not rejected by an independent Tellegen version
check. The Python package’s optional mcp extra reads the engine’s documents
with the PowerIO Python wheel, so it requires the 0.12 series of that wheel.
Tellegen consumes PowerIO modules at its public entry points. DcNetwork and
AcNetwork are private solver workspaces built from a PowerIO problem
instance. The browser and CLI save PowerIO case and solution modules; Tellegen
uses PowerIO IR for portable networks and solutions. Its optional experiment
journal records browser tool activity and never replaces the electrical module. PowerIO IR
text is written and read through tellegen::ir, which calls
powerio::serialize and powerio::deserialize.
Release and IR versions
| Concern | Current value | Tellegen integration |
|---|---|---|
| Rust crate release | 0.12.0 | dependency requirement 0.12 |
| Stored IR | "schema": "pio-ir", "version": "0.12.0" | sole durable browser and CLI JSON boundary |
| Producer | powerio 0.12.0 | records which release wrote an IR document |
PowerIO 0.12 replaced the separate C ABI number with the release; Tellegen does
not use the C ABI. The historical powerio.module version 1 document and bare
balanced-network model JSON are not current input formats. Regenerate those
documents from their original case data. Checked-in evidence produced with an
older PowerIO is historical and must be rerun before it is cited for this
release.
Cargo features
Run the complete numerical checks with this explicit list:
cargo test -p tellegen --features sensitivity,mc-pf,conic,acopf,mc-opf,schema --locked
The Rust gate, just mc-opf-test, just crate-package, package inspection,
and release API comparison use this shipping list. The API comparison disables
cargo-semver-checks’ feature heuristic with --only-explicit-features. Add new
shipping features to those lists together. powerio-012 is a no-op and need
not be listed.
The powerio facade enables a sincal feature by default. It reads SINCAL
projects through powerio-tnd and a bundled SQLite, which the wasm engine
could only link with a C compiler that targets WebAssembly. Tellegen reads no
SINCAL projects, so the workspace depends on powerio with
default-features = false, and on powerio-tx and powerio-dist the same
way so no SINCAL code comes in through them. The CLI, server and browser
therefore list no SINCAL format, and PowerIO refuses a SINCAL source or target
with REQUEST.SINCAL.FEATURE_DISABLED. powerio-tnd itself, which composes
transmission and distribution models, is always part of the facade.
HVDC lines
Since PowerIO 0.11.7, an AC power flow instance built from a network adds each
in-service HVDC line’s terminal powers to its buses’ stated injections, and the
DC OPF preparation states the same transfers as p_hvdc. A stored instance
without hvdc_treatment reads as ignore, so earlier documents solve as
before.
Tellegen’s DC OPF, DC power flow and AC power flow carry each in-service HVDC
line as these fixed injections. The DC models subtract p_hvdc from the fixed
withdrawal, so the balance is p_d + g_s + p_shift - p_hvdc, and an emitted DC
OPF solution restates the same bus injections. The AC power flow solves the
instance’s stated injections; a network solved directly goes through that
instance when it has in-service HVDC lines. A line with a terminal bus outside
the solve, for example in an island with no generator, injects at neither end.
Each solve reports PowerIO’s BUILD.HVDC.FIXED_INJECTION and
BUILD.HVDC.TERMINAL_INACTIVE diagnostics. The AC OPF and the SOC relaxation
have no HVDC term yet and still refuse a network with an in-service HVDC line.
tellegen-synth validates on a copy that replaces each HVDC link with a fixed
transfer, so its verdicts do not change; the viewer and the CLI now solve the
generated network as written.
OpenDSS imports carry the circuit’s source impedance: PowerIO places the Vsource EMF on an internal bus behind a series impedance line to the source bus, and the distribution graph shows both.
Current module API
Tellegen uses the PowerIO facade directly:
powerio::parse(input)for automatic routing andpowerio::parse_with_options(input, &ParseOptions)for an explicit format;powerio::serializeandpowerio::deserializefor.pio.jsondocuments;PioModule::value()anddiagnostics()for reads, withvalue_mut()for edits;PioModule::try_map_valuefor typed narrowing;PioValue::type_name()for canonical structural type names;powerio::emitfor grid exchange formats.
Calling value_mut() is material to correctness: PowerIO drops retained
source bytes and severs value source-map targets before an in-place edit.
Tellegen therefore applies geographic data and auxiliary substation locations
through the retained module, then serializes that updated module back to the
browser.
PowerIO JSON classification now has five families: module, transmission,
distribution, ambiguous, and unknown. The removed model-json family is
not recreated in Tellegen. A PowerWorld .pwd display also follows the
universal parse route and narrows to powerio.GeoLayer.
Browser boundary
Every solvable browser payload carries module_json. That PowerIO IR is
used for Study construction, geographic transforms, saved cases, and exact
solution modules. Counts, topology, and map views remain derived response data;
there is no separately serialized network_json integration point.
This keeps provenance and mutation behavior intact across the whole browser flow. It also prevents a stale generation-1 shape from being accepted by a display helper while the solver receives a different module.
Preparation and results
Tellegen continues to consume typed PowerIO problem instances and shared numerical preparation. Objective and constraint selections, persistent identities, analysis-to-source row mappings, three-winding lowering, and declared thermal limits come from PowerIO. DC and AC solution modules retain convention-neutral demand marginals and terminal multipliers.
When Tellegen commits edits, it retains valid module diagnostics, history,
extensions, and producer data; replaces the module value with the committed
network; and severs obsolete source targets. A saved exact solution contains
the amended OPF instance that was solved and is emitted as
pio-ir with value type powerio.DcOpfSolution.
HTTP API
The demo server’s surface. Data endpoints are always served; the compute
endpoints ship disabled and answer 403 unless TELLEGEN_SERVER_COMPUTE=1
(see Deployment).
Data
GET /api/health— liveness and the served case ids.GET /api/compute—{"enabled": bool}, whether the compute endpoints are on.GET /api/cases— case summaries.GET /api/cases/{id}/case— the portable PowerIO module the browser engine consumes.GET /api/cases/{id}/network— the map view (buses, branches, coordinates).GET /api/cases/{id}/solution— the cached base DC OPF solution, computed once at startup.
Case summaries report canonical PowerIO row counts as n_bus/n_branch and
rendered, three-winding-lowered counts as
n_analysis_bus/n_analysis_branch. Older servers may omit the analysis
counts.
Summaries include model: "balanced" or "multiconductor"; an omitted model
on an older server means balanced. Hosted distribution modules are registered
through the distribution manifest.
For them, bus/branch counts describe the distribution graph and the analysis
counts equal those graph counts. /case retains the full module, including
geometry and diagnostics. The browser builds the distribution view and runs
supported AC power flow locally. Balanced-only /network, /solution,
/snapshot, and enabled compute routes return 400 for distribution IDs.
The global disabled-compute gate still returns 403 when compute is off.
Compute
GET /api/cases/{id}/sensitivity/lmp/d/{bus}— the ∂LMP/∂demand column at a bus.GET /api/cases/{id}/sensitivity/lmp/fmax/{branch}— the ∂LMP/∂rating column at a branch.GET /api/cases/{id}/solve— a DC OPF solve streamed over server-sent events:status,solution, optionalsensitivity, anddone.
The sensitivity and solve endpoints accept ?d=bus:mw,bus:mw, each value a MW
delta from the base case. They take no other request fields: linear
constraints and the rest of the solve request go through the engine’s
solveModule, the tellegen CLI, or the crate (see
Formulations).
Limits
Solve work is bounded by TELLEGEN_SOLVER_CONCURRENCY (default 2) and
TELLEGEN_SOLVER_TIMEOUT_SECS (default 30). Compute routes are rate limited
per client: 5 solve and 25 sensitivity requests per 10 seconds by default,
tuned with TELLEGEN_RATE_LIMIT_WINDOW_SECS,
TELLEGEN_SOLVE_RATE_LIMIT_EVENTS, and
TELLEGEN_SENSITIVITY_RATE_LIMIT_EVENTS.
Hosted distribution summaries may include distribution metadata: description,
HTTPS source URL, related transmission case ID, and PF option defaults. The
/api/cases/{id}/case endpoint negotiates gzip for portable module downloads.
Deployment
tellegen deploys as one container: the tellegen backend with the built tellegen frontend copied into the image. Production can run behind an existing Caddy edge proxy that owns ports 80 and 443.
Requirements
- Docker Engine with the Compose plugin
flock(normally provided by util-linux)- 4 GB RAM minimum; 8 GB recommended for the bundled cases
- external Docker network
edge, owned by the Caddy edge stack - staged demo data under the deploy path’s
data/directory - For manual deployment, GHCR pull access on the host or a public
ghcr.io/eigenergy/tellegenpackage; the workflow authenticates its own pulls
Shared Edge Layout
On a host with an existing reverse proxy, tellegen joins external Docker
network edge under container name tellegen. The proxy should route the
public hostname to tellegen:8000. The tellegen workflow does not mutate the
proxy config; it only deploys the app container and ensures that container
joins edge.
The staged case data should live under the deploy path, for example:
$TELLEGEN_DEPLOY_PATH/data
For the full demo geometry, stage these files:
ACTIVSg200/case_ACTIVSg200.m
ACTIVSg200/ACTIVSg200.aux
ACTIVSg500/case_ACTIVSg500.m
ACTIVSg500/ACTIVSg500.aux
ACTIVSg7000/Texas7k_20210804.m
ACTIVSg7000/Texas7k_lat_long.csv
CATS/CaliforniaTestSystem.m
CATS/CATS_buses.csv
CATS/CATS_lines.json
The server serves the staged subset. If no complete case pair is staged, the
container exits unless TELLEGEN_ALLOW_FALLBACK=1 is set for a CI or local
smoke check. Production deploys should stage the intended public case set before
enabling the workflow.
CATS/CATS_gens.csv is also staged when available. It is source metadata for
generator locations; the current map does not draw a separate generator layer.
Treat every staged case as public. The browser fetches the full staged network
JSON through /api/cases/{id}/case so it can build browser studies and exact
solves locally.
Hosted Distribution Cases
Stage portable PowerIO multiconductor modules alongside the balanced demos and
add distribution-cases.json at the root of TELLEGEN_DATA (normally data/):
[
{
"id": "my-feeder",
"name": "My distribution feeder",
"file": "feeders/my-feeder.pio.json"
}
]
Each file is relative to the data directory and must stay inside it, including
when resolving symlinks. IDs must be unique, use ASCII letters, digits, - or
_, and cannot reuse a built-in demo ID or the browser’s local-/dist-
prefixes. Names must be nonempty. The manifest is optional; omitting it retains
the existing demo catalogue.
Files must be PowerIO pio-ir modules containing a multiconductor network,
AC PF/OPF instance, or AC PF/OPF solution. Geometry and diagnostics are retained.
For a feeder already solved in the browser, export its distribution Study and
extract its portable input module:
mkdir -p data/feeders
jq -r '.input_module' tellegen-study.json > data/feeders/my-feeder.pio.json
Raw OpenDSS, BMOPF, and PMD files must first be imported into a PowerIO module;
they are not accepted directly by this manifest. A Tellegen Study export is a
wrapper, so stage its input_module, not the entire export.
Rebuild once to install a server/frontend version with distribution hosting. Subsequent manifest and case changes need only a server restart and browser reload. The normal Docker data mount also serves these files. No frontend registration or staging-script change is needed.
The catalogue reports model: "multiconductor". Selecting a feeder fetches
/api/cases/{id}/case and opens the existing distribution viewer. Coordinates
select the map or diagram view. Supported cases can run AC power flow in browser
WebAssembly; unsupported electrical models remain viewable with an explanation.
They also appear in WebMCP list_cases/select_case. Closing a hosted feeder
hides it in that browser; Restore defaults brings it back.
Distribution cases do not have server DC OPF solutions, snapshots, or sensitivity
endpoints. Their health check validates module loading, not AC power-flow
convergence. Missing or invalid files remain listed as unavailable and make
/api/health return 503; if no case can load, startup fails. A malformed manifest
or duplicate ID fails startup. All hosted modules are downloadable by clients.
A distribution-only data directory is supported and does not require the four
balanced demos or TELLEGEN_ALLOW_FALLBACK. When balanced demo files are also
staged, their existing requirement that all configured demos load still applies.
The public-demo deployment health assertion requires the four transmission
cases. It accepts the Texas7k distribution pilot described below without
requiring it. Custom deployments can use their own manifest and catalogue
expectations.
Server Compute
The website build includes the experimental nonlinear AC OPF solver at
/experimental-acopf/tellegen_acopf_wasi.wasm, with its EPL-2.0 license,
notice, and checksummed source manifest alongside it. The Docker build compiles
this separate WASI reactor and copies it into the frontend. It does not enable
AC OPF in the native server. Pass --build-arg TELLEGEN_SOURCE_REVISION=$(git rev-parse HEAD)
when manually building an image to record the source commit; CI and deployment
workflows supply it automatically.
DC OPF remains the default calculation. The AC OPF dropdown option enables only after the browser successfully probes the solver, and only for an unedited balanced case. The browser runs each AC OPF solve in a dedicated, terminable worker. There is no server fallback, and AC OPF edits, LMPs, sensitivities, and saving/exporting results remain unavailable.
Local website builds require npm run wasm:acopf before npm run build:web
or the Vite development server. PUBLIC_TELLEGEN_ACOPF_WASM_URL can override
the bundled solver URL; an unset or empty value uses the bundled asset.
Public distribution still requires the release review recorded in
the POUNCE decision.
The compute endpoints (/api/cases/{id}/solve over SSE and the
/api/cases/{id}/sensitivity/... routes) ship disabled and answer 403
server compute is disabled. Set TELLEGEN_SERVER_COMPUTE=1 to enable them as
the fallback for browsers that cannot run the WebAssembly engine; the rate
limits and solver concurrency caps then apply. /api/compute reports the gate
({"enabled": bool}) so the frontend picks honest fallback copy and skips
requests that would 403. The data endpoints, including the cached base
/solution, are always served.
Local Build Deploy
For a host that builds from source:
git clone <repo> /opt/tellegen
cd /opt/tellegen
scripts/stage-data.sh /path/to/datasets
docker compose -f docker-compose.yml -f deploy/docker-compose.edge.yml up -d --build
docker-compose.yml binds the service to 127.0.0.1:8000. The edge overlay
also joins the app to Docker network edge under container name tellegen, so
the shared proxy can route to it. Set TELLEGEN_ALLOW_FALLBACK=1 only for CI
or local smoke checks that intentionally use the two pglib cases with synthetic
coordinates.
Image Deploy
The production compose file consumes an image built by GitHub Actions:
TELLEGEN_IMAGE=ghcr.io/eigenergy/tellegen@sha256:<digest>
TELLEGEN_DATA_DIR=/opt/tellegen/data
docker compose -p tellegen --env-file .env \
-f deploy/docker-compose.prod.yml \
-f deploy/docker-compose.edge.yml up -d
The production compose file binds 127.0.0.1:8000, mounts staged data read
only, runs with a read only root filesystem, drops Linux capabilities, blocks
new privileges, caps process count, and sets the memory limit. The edge overlay
adds the fixed container name and external edge network membership needed by
the Caddy route. The fixed Compose project name matters because the shared Caddy
edge stack is a separate project.
Use the host deploy script for normal deploys and rollbacks:
bash deploy/remote-deploy.sh \
ghcr.io/eigenergy/tellegen@sha256:<digest> \
"$TELLEGEN_DEPLOY_PATH/data"
The script validates Docker, Compose, the external edge network, that at
least one case directory exists below the canonical deploy root, and the
compose config. A host flock serializes workflow and operator invocations. The
script pulls the selected digest before recreating the container, then waits
for Docker health and /api/health. It does not use --remove-orphans; the
shared edge proxy is owned by a separate stack.
Before changing the container, the script records a pending snapshot containing the digest, data path, and exact two Compose files. Promotion atomically makes that snapshot the last known good state. Rollback therefore restores the prior Compose configuration as well as its image, and a later invocation recovers an unpromoted candidate left by runner cancellation or SSH loss. The first run migrates a healthy existing deployment from Docker’s Compose file labels.
GitHub Actions Deploy
.github/workflows/deploy.yml runs after a successful CI workflow for a push
to main, or by workflow_dispatch from main. Every job is gated by the
repository variable:
TELLEGEN_DEPLOY_ENABLED=true
Leave that variable unset until the host has staged data and an edge network.
Once enabled, the workflow builds and smoke-tests the
exact commit whose CI passed, then checks that it is still the latest successful
CI push for main. Superseded runs stop without publishing; a newer failing or
in-progress commit does not suppress the last green deployment. The current run
pushes the already smoke-tested local image, resolves its immutable registry
digest, and repeats the latest-green check after any environment wait. It then
copies the deploy files into a unique per-run bundle, invokes the locked
host deploy with that bundle and digest, and checks
${TELLEGEN_DEMO_URL}/api/health. A manual run redeploys the latest green
commit. It checks latest-green state again immediately before promotion; a
candidate superseded during health checks is rolled back.
All demo runs share one non-canceling workflow mutex with the maximum pending queue. Dispatch and start order are not a publication guarantee, so the repeated latest-green checks remain the source of truth for which commit may publish or reach the host. Per-run bundles keep an interrupted remote process from observing files uploaded by its successor; the host lock serializes their use. After a healthy deploy, bundles older than seven days are removed.
Required repository secrets:
TELLEGEN_DEPLOY_HOSTTELLEGEN_DEPLOY_USERTELLEGEN_DEPLOY_SSH_KEYTELLEGEN_DEPLOY_PATH, for example/opt/tellegenTELLEGEN_DEMO_URL, for examplehttps://tellegen.devTELLEGEN_DEPLOY_KNOWN_HOSTS: the pinned SSH host key for the deploy host, the verified output ofssh-keyscan -H <host>or an equivalent known hosts entry. The workflow refuses to deploy without this secret.
The deployment job has read-only package access. It sends its temporary
GITHUB_TOKEN through SSH stdin for docker login, with a private temporary
Docker configuration used only by that deployment or rollback command.
The helper removes the configuration on success, failure, or a handled signal,
and the job token expires when the job finishes. Existing host credentials
remain untouched. No registry token needs to be stored as a repository secret
or kept on the host.
Preflight
Read only checks for a configured host:
ssh "$DEPLOY_HOST" docker network inspect edge
ssh "$DEPLOY_HOST" find "$TELLEGEN_DEPLOY_PATH/data" -maxdepth 2 -type f
ssh "$DEPLOY_HOST" curl -fsS http://127.0.0.1:8000/api/health
After a deploy:
ssh "$DEPLOY_HOST" docker inspect tellegen --format '{{if index .NetworkSettings.Networks "edge"}}edge{{end}}'
curl -fsS "${TELLEGEN_DEMO_URL%/}/api/health"
Both health checks should report status: "ok", an empty unavailable array
and a nonempty cases array. For the full public demo, that array should
contain case200, case500, case7000, and cats. It also lists
texas7k-p1uhs0_1247 once that case’s bundle and distribution-cases.json are
staged (see Texas7k distribution demo). The deploy
workflow requires the four transmission cases and allows, but does not require,
the Texas7k case.
Local full-data browser check
Build the web app and start a native server from the repository root with all four cases staged. The suite checks that the server is serving the current production build. Build the WebAssembly engine first if the workspace has no generated Wasm package.
npm run build:engine
npm run build:web
TELLEGEN_DATA="$PWD/data" TELLEGEN_FRONTEND_BUILD="$PWD/apps/web/build" \
TELLEGEN_HOST=127.0.0.1 TELLEGEN_PORT=4216 cargo run --release -p tellegen-server
In a second terminal, wait until the health check reports status: "ok", then run the suite
against the same server.
curl -fsS http://127.0.0.1:4216/api/health
TELLEGEN_FULL_DATA=1 TELLEGEN_PREVIEW_PORT=4216 \
npm --workspace tellegen-frontend run test:browser -- full-data-release.spec.ts
The checks load every demo case, save and reopen Texas7k results, exercise browser sensitivity and planning, verify that an ACTIVSg200 geographic attachment preserves the result, and follow CATS transfer and thermal limit results into the equipment inspector.
Reverse Proxy
deploy/Caddyfile is a sample route for a shared edge proxy. Tellegen CI does
not mutate proxy config files.
The sample route sets HSTS, CSP, permissions policy, referrer policy, frame
ancestor denial, and content type sniffing protection. The CSP allows the
current SvelteKit bootstrap, WebAssembly compilation, MapLibre blob workers, and
the basemap hosts: https://tiles.openfreemap.org (the OpenFreeMap style,
vector tiles, fonts and sprites, all fetched, so connect-src must carry it)
and https://*.cartocdn.com (CARTO, the primary with a basemap key and the
fallback without one), in both img-src and
connect-src. The policy that ships with the build lives in
apps/web/vite.config.ts; a proxy policy must list the same hosts or the map
stays blank behind it. A deployment that points TellegenMap at another style
adds that host in both places.
To lead with CARTO’s basemap, set the repository variable
CARTO_BASEMAP_KEY to a CARTO basemap key from
carto.com/basemaps/apikey. Keys are free
for non-commercial use, and no account is needed. The deploy workflow passes
the key to the frontend build as PUBLIC_CARTO_BASEMAP_KEY; a local build
reads the same variable from the environment. The key ships in the page and
is sent with every tile request, so it is public by design: keep it in a
repository variable, not a secret, and restrict it to the deployment’s hosts
in CARTO’s key dashboard. Without the variable, the build has no key:
OpenFreeMap leads and CARTO is the fallback. The CSP is the same either way.
Agents reach the app’s WebMCP tools through document.modelContext. Chrome and
Edge offer it on an origin with a WebMCP origin trial token, so visitors do not
need to enable a browser flag. Register the deployment’s origin for the trial
and set the repository variable WEBMCP_ORIGIN_TRIAL_TOKEN to the token. The
deploy workflow passes it to the frontend build as
PUBLIC_WEBMCP_ORIGIN_TRIAL_TOKEN, and the prerendered pages carry it in an
origin-trial meta tag. A token is valid for one origin only, so a staging host
needs its own. To let other sites call the tools when they embed the app, set
WEBMCP_EXPOSED_TO to a comma-separated list of their origins, such as
https://maptogrid.example; the workflow passes it as
PUBLIC_WEBMCP_EXPOSED_TO, and the embedding page must also opt in. Both values
ship in the page, so keep them in repository variables, not secrets. Without
them the build adds no meta tag and the tools stay same-origin. A local build
reads both variables from the environment.
A Caddy image with github.com/mholt/caddy-ratelimit is needed for the sample
rate limits; stock Caddy does not include that module. The tellegen backend also
enforces solve and sensitivity rate limits with the same defaults, so the
container has a guard even when the proxy module is absent. Keep solve endpoints
compatible with SSE: do not buffer responses, and do not use short write
timeouts on /api/cases/*/solve.
Capacity
Staged cases are parsed at boot, and the base DC OPF solution is cached for each case. Browser WebAssembly handles the normal exact solve path; the tellegen backend recomputes fallback solves on demand. Read endpoints serve prebuilt case payloads.
Public Hardening
- Keep the Caddy security headers and rate limits on solve and sensitivity endpoints.
- Keep the backend rate limits enabled. Defaults are 5 solve requests and 25
sensitivity requests per client per 10 seconds. Set
TELLEGEN_SOLVE_RATE_LIMIT_EVENTS=0orTELLEGEN_SENSITIVITY_RATE_LIMIT_EVENTS=0only for local debugging. - Keep the image running as the bundled unprivileged user and keep the compose read only filesystem, dropped capabilities, no new privileges, process cap, and memory cap.
- Keep staged data mounted read only.
- Stage only cases that are cleared for public distribution; the demo serves the full network JSON for each staged case.
- Add request body limits before adding any tellegen backend upload endpoint.
- Current file drop parsing runs in the browser and does not reach the tellegen backend.
Texas7k distribution demo
The intended public example is texas7k-p1uhs0_1247, the main energized island
of the six-feeder substation associated with Texas7k. It contains 22,076 modeled
buses and all 15,299 loads. Two original unsupplied line sections (five buses,
three lines) are removed; retained electrical values and coordinates are
unchanged. The prepared source and notices are checksum-pinned in
scripts/datasets/texas7k-main-island-source.json.
Reproduce the PowerIO 0.11.7 conversion and extraction using
docs/evidence/studies/texas7k-reconversion/README.md, build the browser engine,
then prepare the hosting data:
npm run wasm
npm run build:engine
python3 scripts/datasets/stage-texas7k.py /path/to/prepared-main-island data --main-island
Alternatively set TELLEGEN_TEXAS7K_MAIN_ISLAND=/path/to/prepared-main-island
when invoking scripts/stage-data.sh. Staging verifies all prepared input
checksums, reduces duplicate representation, converts to portable PowerIO, and
compares original/reduced geometry and complete WASM PF results. Source labels
remain in a provenance sidecar. The reduction removes no further equipment and
rounds no electrical values. It requires Python 3 and Node and does not download
data. The historical full-pilot path remains available through
TELLEGEN_BMOPF_REPO and is used only when no main-island path is supplied.
The script preserves other distribution entries and atomically registers an
immutable bundle under data/distribution/. Each bundle contains license and
source notices, reduction provenance, solver options, source revision/checksums,
and validation evidence. The case appears in the demo once the complete bundle
and distribution-cases.json are staged under the deployment data directory and
readable by the container user (uid 10001); restart the server after staging.
Deploys do not wait for it: the public deployment gate requires only the four
transmission cases. A manifest whose bundle is missing or unreadable makes the
case unavailable and fails that gate, so stage the bundle before the manifest.
Data is an operator staging step; the image deployment workflow does not upload
it. Retain the old manifest and bundle for data rollback.
The optional manifest metadata object supports description, an absolute
HTTPS source_url, a built-in transmission related_case_id, and pf_options.
pf_options accepts any of the ten multiconductor power-flow options listed in
Settings, checked by the same Rust resolver as every other
caller. Unknown metadata fields fail manifest parsing; an unknown or invalid
pf_options entry makes the case unavailable. Missing values retain engine
defaults. Explicit solve options override case defaults, and successful solves
retain their effective options for later runs and Study export/reopen. Hosted
distribution cases appear in WebMCP with the same solver defaults as the UI.
The pilot uses constant-power loads without the bounded-voltage envelope, frozen regulator taps and nominal loads; it has voltage drops and overloads. The association is case-level, not a coupled transmission/distribution solve. The catalogue link does not assert a specific transmission bus mapping.
The case endpoint negotiates gzip, serving a copy compressed once when the
server loads the case. Measure the served PowerIO payload, not the
reduced BMOPF file, when estimating downloads. The current hosted module is
36.69 MB uncompressed and 1.26 MB gzipped; its BMOPF companion is 13.69 MB and
1.10 MB respectively. See docs/evidence/studies/texas7k-reconversion/SHIPPING.md.
The main island remains a
large browser workload. Run the opt-in browser check against a server serving
both the production build and staged data:
TELLEGEN_DATA=data TELLEGEN_FRONTEND_BUILD=apps/web/build \
TELLEGEN_PORT=4173 cargo run --release --locked -p tellegen-server
# In another terminal; Playwright reuses the running server on port 4173:
TELLEGEN_TEXAS7K=1 npm run test:browser -- texas7k-distribution.spec.ts --workers=1
The test checks actual API metadata, geography, UI/WebMCP solves, study round-trip options/results, and a load edit. It writes timing, transfer-size and screenshot artifacts. Routine browser CI uses small fixtures; run this full-data check before changing the pinned source, converter, solver or demo bundle.
The historical full-pilot desktop acceptance run loaded in 5.34 s and solved in 1.78 s over
loopback. Combined Chromium RSS was about 1.65 GB after solving and 4.80 GB after
the export/reopen/rerun workflow (checkpoint samples, not exclusive allocation
or a continuous peak). Those timings were not rerun for the main-island bundle.
The six-feeder case is intended for desktop evaluation;
low-memory/mobile operation remains unqualified. See
docs/evidence/studies/texas7k-reduction/BROWSER.md for methodology and limits.
Privacy
tellegen parses dropped case files in your browser. The current public demo does not upload those files to the tellegen backend.
Current Demo
- Dropped
.m,.raw,.aux,.epc,.pwb,.dss,.pwd,.csv,.json, and.geojsonfiles stay on your device. - The browser uses local file contents to draw the map and run DC solves.
- The tellegen backend receives ordinary page and API requests for the bundled demo cases.
- The public site (tellegen.dev and www.tellegen.dev) sends aggregate usage
counts to Umami Cloud, a service of Umami
Software, Inc.: page visits, actions, completion status, counts and
calculation timings. The site’s own code (
@tellegen/analytics) posts each count to Umami’s collection address; no third-party script runs on the page and no cookie is set. Each count carries a fixed event name, values from a fixed list and one of the public page addresses. Analytics exclude uploaded filenames and contents, study names and goals, equipment identities, coordinates, electrical values, agent prompts, error text, search parameters, fragments and referring addresses. The request carries the browser’s IP address and identification, which Umami turns into a visitor hash with a monthly salt and an approximate country, keeps neither as a field of the record, and may hold in its operational logs; records are kept for two years in the United States. Do Not Track and Global Privacy Control are respected, local and preview addresses send nothing, and the in-app privacy page has a switch to turn the counts off in your browser. - The map basemap comes from CARTO (
*.basemaps.cartocdn.com) when the deployment has a CARTO basemap key, with OpenFreeMap (tiles.openfreemap.org) as the fallback. Without a key, OpenFreeMap leads and CARTO is the fallback. Your browser requests the style, tiles, fonts and sprites directly from whichever provider is on screen, so that provider receives your IP address, your user agent, and the map area you view. Your case file is never sent, but the map area shows where a locally parsed case sits. Apart from the analytics above, nothing else on the page loads from a third party.
Future Opt In Sharing
If tellegen adds a sharing feature, it will be explicit. The action will say what will be sent and will require a separate confirmation before upload.
Planned defaults for shared files:
- Raw shared files will be retained for 180 days.
- Derived aggregate statistics may be retained without a fixed end date.
- Each upload will return a share id that can be used to request deletion.
- Shared files will not be sold or used for third party advertising.
Hosting And Legal Notes
The public demo is intended to run on Hetzner infrastructure. Before accepting uploaded user files, the operator will conclude Hetzner’s Data Processing Agreement and publish controller contact details.
Third Party Notices
This page records attribution sources for the repository and public demo. It
does not replace the license metadata in Cargo.lock, package-lock.json, or
the source distributions for each dependency.
Project Code
The project, including the Rust crates and the npm packages
@tellegen/engine and @tellegen/svelte, is MIT licensed. See LICENSE.
The engine uses the W space SOCWR formulation as implemented in PowerModels.jl as a formulation reference. PowerModels.jl is BSD 3-Clause licensed. The tellegen implementation is independent.
Direct Software Dependencies
Rust dependencies are resolved by Cargo and governed by deny.toml. Direct
runtime dependencies include powerio, clarabel, faer, num-complex,
serde, serde_json, wasm-bindgen, console_error_panic_hook, axum,
tokio, tokio-stream, tower-http, tracing, and tracing-subscriber.
The web app dependencies are resolved by npm. Direct dependencies include
SvelteKit, Svelte, Vite, TypeScript, deck.gl, MapLibre GL JS, Prettier,
@fontsource-variable/bricolage-grotesque, and @fontsource/ibm-plex-mono.
The repository does not modify or vendor those dependency sources. License and notice files from dependencies are distributed through their normal package archives.
Optional POUNCE backend
The non-default native tellegen/acopf feature depends on
POUNCE, a pure-Rust nonlinear solver
licensed under EPL-2.0. It is pinned to the checksummed crates.io release
0.15.0. The default engine and the
published WASM, server, CLI, and Python adapters do not enable this feature.
scripts/epl-guard.sh checks that boundary from Cargo’s resolved dependency
trees. The separate tellegen-acopf-wasi adapter deliberately enables it.
The website bundles that generated asset, its EPL-2.0 license, notices, and
POUNCE-SOURCE.json under /experimental-acopf/. The manifest records exact
source archive URLs and checksums. The native server and ordinary npm packages
do not contain the solver asset.
Before any binary containing POUNCE is distributed, the release owner must approve the EPL-2.0 obligations, ship the POUNCE license and notices, and state where the corresponding POUNCE source can be obtained. This repository does not modify POUNCE. The current dependency exception records a review boundary; it is not release approval.
Populated Places
The synthetic grid generator ships crates/tellegen-synth/data/populated_places.json
(copied into @tellegen/engine as data/populated_places.json): name,
longitude, latitude, population and country of every place of 5,000 people
or more in GeoNames’ cities5000 dump, derived by
scripts/derive-populated-places.py from cities5000.txt and
countryInfo.txt, whose SHA-256 the table records. GeoNames data is
licensed under CC BY 4.0
(geonames.org): the table was trimmed to those
five fields and rounded to three decimals, so changes were made, and
anything that redistributes a generated grid or the table must credit
GeoNames. Earlier releases shipped Natural Earth’s populated places instead.
It also ships crates/tellegen-synth/data/national_demand.json, compiled
into the engine: each country’s annual electricity demand and population,
derived by scripts/derive-national-demand.py from Our World in Data’s
energy dataset (github.com/owid/energy-data),
whose electricity_demand column comes from Ember’s Yearly Electricity Data.
Ember, Yearly Electricity Data, and Our World in Data, Energy dataset, are
licensed under CC BY 4.0; the
table keeps each country’s latest year, so changes were made. The
population column is Our World in Data’s population series, compiled from
the sources listed at
ourworldindata.org/population-sources
and subject to their terms. The table records the SHA-256 of the CSV it was
derived from.
crates/tellegen-synth/data/country_areas.json, also compiled into the
engine, gives each country’s area, measured by
scripts/derive-country-areas.py from Natural Earth’s 1:50m admin-0
countries (public domain). crates/tellegen-synth/data/voltage_ladders.json
lists national transmission voltage levels with the operator, regulator and
standards documents each entry was taken from; it copies no dataset.
Demo Case Data
The demo data is staged by the operator and is not vendored in this repository.
ACTIVSg synthetic grids come from the Texas A&M Electric Grid Test Case Repository. The case file headers request this citation:
A. B. Birchfield, T. Xu, K. M. Gegner, K. S. Shetye, and T. J. Overbye, “Grid Structural Characteristics as Validation Criteria for Synthetic Networks,” IEEE Transactions on Power Systems, 2017.
CATS comes from the WISPO POP CATS California Test System repository and is BSD 3 Clause licensed in that repository. The source repository requests this citation:
S. Taylor, A. Rangarajan, N. Rhodes, J. Snodgrass, B. C. Lesieutre, and L. A. Roald, “California Test System (CATS): A Geographically Accurate Test System Based on the California Grid,” IEEE Transactions on Energy Markets, Policy and Regulation, vol. 2, no. 1, pp. 107-118, 2024. doi:10.1109/TEMPR.2023.3338568.
The Texas7k distribution example, texas7k-p1uhs0_1247, is derived from the
SMART-DS synthetic distribution substation p1uhs0_1247 that the
Texas7k combined transmission and distribution dataset page
identifies. The Open Energy Data Initiative publishes it under the
Creative Commons Attribution 3.0 United States
license (CC BY 3.0 US). The source page requests this citation:
C. Mateo, F. Postigo, T. Elgindy, A. Birchfield, P. Duenas, B. Palmintier, N. Panossian, T. Gomez, F. de Cuadra, T. Overbye, F. Safdarian, and D. Wallison, “Building and validating a large-scale combined transmission & distribution synthetic electricity system of Texas,” International Journal of Electrical Power and Energy Systems, vol. 159, Aug. 2024.
The demo uses a modified version. Frederik Geth converted the OpenDSS source
to a fixed nominal-load power-flow snapshot in
BMOPFDraftData: regulator
taps are solved and frozen, disabled switches are excluded, and transformers
and tap-dependent impedances use equivalent conventions. The hosted bundle
then keeps only the main energized island, removing two unsupplied line
sections (five buses, three lines, three line codes and five coordinate
features). For storage it shares identical line-code records, keeps their
source labels in a provenance sidecar, and drops duplicate GeoJSON bus points
and default constant-power load labels. No electrical value or coordinate is
rounded. The staged bundle carries License.md and SOURCE_NOTICE.md with the
full attribution and list of changes. No endorsement by the original authors
is implied.
Embedded fallback cases are from PGLib OPF and are used only when
TELLEGEN_ALLOW_FALLBACK=1 is set. PGLib OPF data is CC BY 4.0; the PGLib
software is MIT licensed.
RMS Dynamic Models and Validation Data
The RMS dynamic simulation (crates/tellegen/src/rms) translates the device
equations, network formulation and PSS/E parameter mapping of
PowerSimulationsDynamics.jl
v0.16.2 and PowerSystems.jl
v5.12 into Rust, the WECC generic renewable plant (REGCA1, REECB1,
REPCA1) included. Both are BSD 3-Clause licensed by Alliance for Sustainable
Energy, LLC and The Regents of the University of California: PowerSimulationsDynamics.jl
Copyright (c) 2020, 2023 (crates/tellegen/licenses/PowerSimulationsDynamics.jl-LICENSE),
PowerSystems.jl Copyright (c) 2018, 2023 (crates/tellegen/licenses/PowerSystems.jl-LICENSE), shipped with the crate.
The WECC 240-bus case under crates/tellegen/tests/data/rms_examples/wecc240
is copied from that package’s test/data_tests directory under the same
license, with the bus coordinates of
eudoxys/wecc240 (MIT,
LICENSE-wecc240-coordinates); its psid_reference.json holds output of
PowerSimulationsDynamics.jl and the load values of the WECC 240 system of
PowerSystemCaseBuilder.jl (BSD 3-Clause, LICENSE-PowerSystemCaseBuilder.jl).
It is test data, excluded from the published crate and not compiled into any
tellegen artifact. The hosted web app serves case.raw, case.dyr,
case.geo.csv and their licence files as its dynamics demo, with
case-validation.raw, the same raw file with the PowerSystemCaseBuilder.jl
load values of the validation study, written at build time. Please cite:
J. D. Lara, R. Henriquez-Auba, M. Bossart, D. S. Callaway, and C. Barrows, “PowerSimulationsDynamics.jl – An Open Source Modeling Package for Modern Power Systems with Inverter-Based Resources,” arXiv:2308.02921, 2023.
No other case is distributed with tellegen. Tests that use further cases read
them from a data folder outside this repository and are skipped where it is
absent; see crates/tellegen/tests/data/rms_examples/README.md.
Maps
The web app’s basemap comes from one of two providers, depending on whether the deployment has a CARTO basemap key. CARTO’s terms ask for one; keys come from carto.com/basemaps/apikey.
- With a key, the basemap is CARTO’s vector basemap (
basemaps.cartocdn.com), with OpenStreetMap data, and OpenFreeMap is the fallback. - Without a key, OpenFreeMap serves it (styles, vector tiles, fonts and
sprites from
tiles.openfreemap.org), and the keyless CARTO style is the fallback.
OpenFreeMap’s style and tile schema are OpenMapTiles (BSD 3-Clause for the schema, CC BY 4.0 for the design), and the map data is © OpenStreetMap contributors under the ODbL. The app modifies the OpenFreeMap styles when it renders them: road lines start at zoom 8, and in the dark theme water, waterways and land fills are recoloured.
The attribution control shows the credits of whichever provider is on screen and cannot be switched off. Keep it visible in any hosted demo or derivative deployment.
OpenStreetMap Mode
A grid generated with source: "osm" contains data derived from
OpenStreetMap, © OpenStreetMap
contributors, available under the Open Database License (ODbL) 1.0. Check the
ODbL’s attribution and share-alike terms before redistributing such a module
or its exports.
Desktop and mobile (planned)
None of this is built yet. This page records the plan for native desktop and mobile builds.
tellegen runs in the browser today. A native build adds three things the browser cannot:
- Cross-platform reach. Tauri 2 builds desktop (macOS, Windows, Linux) and mobile (iOS, Android) from one Rust and web codebase. Phones and tablets get an installable app, not a tab.
- The full nonlinear AC OPF. The browser solves DC OPF, AC power flow, and the SOCWR relaxation. The engine now has a non-default, development-only native AC OPF backend; a Tauri product would expose it on the device after its solver, licensing, and distribution gates are complete.
- Offline and local. Cases stay on the device and solve in process.
The pieces already fit. The SvelteKit app is a static single-page app and the engine is a Rust crate, so the native build reuses both:
apps/desktop: the Tauri shell. It loads the sameapps/webbuild.crates/tellegen-tauri: a workspace member that holds a nativeStudyand exposes it through#[tauri::command]. It would provide the approved transport for the engine’s existing opt-in AC OPF backend.
One UI, three transports: the in-browser Study, the HTTP server, and the Tauri bridge, chosen at runtime. The Study interface is the same across all three; only the transport differs.