Sparlectra.jl
Power-system analysis in Julia: AC and DC power flow, WLS state estimation, IEC 60909 short circuit, scenarios and N-1 contingency, import and export in various formats.

Nothing in Sparlectra is a black box. The rectangular Newton-Raphson solver exposes model construction, Jacobian assembly, PV/PQ switching and convergence at runtime; a DC power flow and the analytic APSLF backend (AnalyticLoadFlow.jl) are available alongside it. State estimation reports observability and bad data, short-circuit sweeps and SE diagnostics use the Takahashi selected inverse. Every run is deterministic and configuration-driven, results are machine-readable. This suits grid studies as well as solver development and teaching.
The full capability list is in the feature matrix.
Try it in your browser
No installation required, the workshop notebooks run on Google Colab:
The notebooks are generated from docs/lit/ and are also part of the documentation.
Installation
As a Julia package:
using Pkg
Pkg.add("Sparlectra")Web UI: one-line install
Installs Julia if missing, downloads the latest tagged release into Sparlectra/ in the current directory, and starts the Web UI.
Linux/macOS:
curl -fsSL https://raw.githubusercontent.com/Welthulk/Sparlectra.jl/main/tools/install_webui.sh | shWindows (PowerShell):
iwr -useb https://raw.githubusercontent.com/Welthulk/Sparlectra.jl/main/tools/install_webui.bat -OutFile install_webui.bat; .\install_webui.bat[!IMPORTANT] This downloads and runs a script. If you prefer to read it first: install_webui.sh, install_webui.bat.
Re-running the command updates an existing copy (the old one is kept as Sparlectra.old). From a checkout, ./start_webui.sh or start_webui.bat starts the Web UI directly. Environment variables for unattended installs and all other options: Web UI documentation.
Startup time
[!IMPORTANT] Julia compiles on first use, so the first run in a fresh process is slow. The installer offers to build a sysimage once (10 to 20 minutes); afterwards
using Sparlectrareturns at once. How to build and use it in your own scripts: integration guide.
SBOM
Every release ships an SPDX SBOM as a release asset: Sparlectra.spdx.json. julia tools/generate_sbom.jl builds one locally.
Quick start
run_sparlectra runs the whole chain: import, configuration, control loops, solve, report. ensure_casefile downloads case14.m if it is not present locally.
using Sparlectra
case_path = ensure_casefile("case14.m")
result = run_sparlectra(
casefile = basename(case_path),
path = dirname(case_path),
)
println(result.outcome)
println(result.iterations)
println(result.final_mismatch)An ENTSO-E CGMES delivery: diagnose, import, solve, compare with the delivered SV profile:
using Sparlectra
summary = summarizeCGMES(path = ["grid.zip", "boundary.zip"])
result = importCGMES(path = ["grid.zip", "boundary.zip"])
runpf!(result.net, 30, 1e-8, 0)
cmp = compareWithSV(result)
@show cmp.max_dvmEmbedding Sparlectra in your own tooling (scripts, sysimage, API): integration guide.
Local Web UI
Case management, run history and results in the browser. Cases can be taken from the local cache, uploaded (MATPOWER, DTF, CGMES ZIP) or fetched by name.

Documentation
Full documentation: https://welthulk.github.io/Sparlectra.jl/
- Feature matrix
- Integration guide
- Web UI
- Import/Export, CGMES import, CGMES export
- Solver guide, External solvers
- State estimation
- Short circuit
- Function reference
- Changelog
Contributing
Bug reports, test networks and import edge cases (CGMES, MATPOWER, DTF) are welcome. Questions: Discussions. Please read CONTRIBUTING.md and CODEOFCONDUCT.md first.
Citing
@software{sparlectra_jl,
title = {Sparlectra.jl: A Power-Flow and State-Estimation Framework in Julia},
author = {Schmitz, Udo},
year = {2026},
url = {https://github.com/Welthulk/Sparlectra.jl}
}License
Apache License 2.0, see LICENSE.