Examples Overview

All runnable examples live under examples/, grouped by topic: examples/powerflow/, examples/others/, examples/state_estimation/, examples/dtf/, shared suite infrastructure in examples/others/, CGMES tooling material in examples/cgmes/. Run any example directly:

julia --project=. examples/<folder>/<example>.jl

or run a whole topic through its suite runner (fresh subprocess per example, summary at the end): run_powerflow_suite.jl, run_others_suite.jl, run_state_estimation_suite.jl, run_val_dtf_suite.jl, run_cgmes_suite.jl, run_short_circuit_suite.jl, run_parallel_suite.jl (parallel-vs-serial demos with identity checks).

Power flow and network operation

ExampleFolderDemonstratesSuite
matpower_import.jlpowerflowMinimal MATPOWER import and solvepowerflow
matpower_import_multi_config.jlpowerflowOne case under several configurationspowerflow
exp_configured_matpower_cases.jlpowerflowOrdered runtime.cases batches via run_sparlectra_casespowerflow
exp_programmatic_api.jlpowerflowGUI-ready run_sparlectra_api contract, explicit artifactspowerflow
exp_powerflow_service.jlpowerflowLocal service run, result lookup by run ID, artifact listing (no HTTP server)powerflow
exp_distributed_slack_modes.jlpowerflowClassical single slack vs distributed slack (pg_weighted vs imported APF shares, lambda_P metadata)standalone
exp_external_grid_comparison.jlpowerflowGrid-connection modeling comparison on an 8-bus ring (issue #299): ideal slack at two alternative buses, non-ideal external-grid source with internal impedance, and distributed slack, tabulated per buspowerflow
exp_dc_powerflow.jlpowerflowStandalone DC power flow (rundcpf!), DC-seeded AC startpowerflow
exp_condition_number.jlpowerflowJacobian condition-number estimate at the solved operating point (condestJacobian, reportCondition), incl. a stressed near-singular variantpowerflow
exp_hvdc_b2b_pairing.jlothersBack-to-back HVDC pairing controller: Stage-0 snapshot vs steerable transfer on a two-island net (#297 Draft B)others
exp_hvdc_meshed_ac_tie.jlothersHVDC pair in parallel to an AC tie: one reference per synchronous island, setpoint pair as parallel PQ path, island_feed rejected (theory)others
exp_parallel_islands.jlpowerflowislands.mode solve_parallel vs solve_independent on an 8-island net, wall clocks side by side, bitwise-identical voltagesparallel
exp_parallel_sc_sweep.jlothersIEC 60909-0 all-bus sweep serial vs threaded chunks (8000 fault locations), row-identical resultsparallel
exp_contingency_n1.jlothersFull branch N-1 on case1354pegase (runContingencies!): serial vs parallel, warm-start evidence, top-10 worst contingencies (theory)parallel
exp_open_terminal_line.jlothersOne-sided open line: full charging draw at the closed bus and the Ferranti rise at the open end (theory)others
exp_current_iteration_start.jlpowerflowGuarded current-iteration start pre-solve via config overridespowerflow
exp_diagnose_self_check.jlothersrun_fixed_reference_self_check and the narrative diagnose.log reportothers
exp_short_circuit.jlothersrunShortCircuit! (IEC 60909-0) on a hand-built feeder+machine net: Ik'' max/min and the safety flag on defaulted datashort_circuit
exp_short_circuit_reference.jlothersPASS/FAIL check against the analytic IEC 60909-0 reference valuesshort_circuit
exp_short_circuit_cgmes.jlothersrunShortCircuit! on the ENTSO-E MicroGrid BE delivery from the local test-set cacheshort_circuit
exp_synthetic_tiled_grid_pf_perf.jlpowerflowSynthetic tiled-grid PF performance studypowerflow
qlimit_large_case_mode_comparison.jlpowerflowQ-limit enforcement modes on large casespowerflow
apslf_demo.jlpowerflowAPSLF analytic solver as standalone/primary/start-value backendpowerflow
mc_probabilistic_powerflow.jlpowerflowMonte-Carlo load scaling on case14.m (N = 1000): per-bus Vm statistics, band violations, convergence ratepowerflow

Transformers and controllers

Example (examples/others/)DemonstratesSuite
exp_transformer_tap_changer_model.jltap_changer_model = :ideal vs :impedance_correction on an off-nominal tapothers
exp_transformer_loss_extension.jlMATPOWER transformer-loss extension export/reimport round tripothers
exp_3wt_phase_taps.jl3WT with phase_tap_side/phase_taps: OLTC-only, PST-only, combined (data model only)others
tap_control_demo_grid.jlThree controllers at once (OLTC + PST + combined) via run_sparlectra(net = …) and latest_control_resultothers
tap_control_schraeg_two_controllers.jlSplit combined regulation: independent voltage/ratio and power/phase controllers on one unitothers
exp_pst_reactance_coupling.jlPST control with tap-dependent series reactance X(α) vs. a static-reactance runothers
exp_svc_shunt_voltage_control.jlSVC variable-shunt voltage control (in-range + honest at_limit) with the controllable-element viewothers
exp_tcsc_series_reactance_control.jlTCSC series-reactance control steering a loop-network flow split onto a branch target (theory), incl. honest at_limitothers
exp_facts_limit_modes.jlFACTS limit characteristics side by side (theory): constant-Q box vs STATCOM V*S_max vs SVC V^2*B, plus SSSC injected-voltage window vs TCSC fixed window (#297 Drafts A/E/F)others
exp_facts_base_impedance.jlequipment impedance vs FACTS operating point (theory): short circuit and MATPOWER export read the physical base after a full-UPFC run (#329)others
exp_auto_slack_selection.jlAutomatic slack selection (power_flow.auto_slack / ensureSlack!) when a case registers no voltage referenceothers
exp_ac_rescue_dc_fallback.jlNon-convergence handling: power_flow.rescue strategy ladder plus power_flow.dc.fallback standalone-DC resultothers
exp_cgmes_import_analysis.jlanalyzeCGMES report naming the missing declared dependency of an incomplete CGMES deliveryothers
exp_cgmes_infer_base_voltages.jlcgmes_import.infer_base_voltages: reconstruct missing nominal voltages from the SV state and solveothers
exp_cgmes_topology_processor.jlNode-breaker import without a TP profile (#314): derived bus partition compared bus for bus against the shipped TP on MiniGridothers
machine_remote_voltage_control.jlRemote voltage control via machine reactive power (theory), incl. the honest at_limit outcomeothers
using_links.jlBusbar coupler as bus link, open/close behaviorothers
network_analyzer.jlTopology analysis before/after removing a branchothers
export_solution.jlSolver-agnostic PFModel/PFSolution exportothers

Voltage-dependent and Q-limit control

Example (examples/powerflow/)DemonstratesSuite
example_voltage_dependent_control_rectangular.jlP(U)/Q(U) droop behavior in the rectangular solverpowerflow
example_q_limit_voltage_adjustment.jlqlimit_mode = :adjust_vset run variantspowerflow

CGMES

ExampleDemonstratesSuite
run_cgmes_suite.jlGuided walkthrough (diagnose → import → solve → SV validation) plus the full sweep over every ENTSO-E/ReliCapGrid test set with a result tablecgmes
cgmes/cgmes_fetch_testsets.jlOne-time fetch of the ENTSO-E test-set package into the local cachestandalone
cgmes/cgmes_export_demo.jlCGMES export (writeCGMESFiles) on a small netothers (optional)
cgmes/val_realgrid_remeasure.jlRealGrid measurement ladder: baseline, Q-limits, distributed slack, machine controlstandalone

DTF validation (Testnetz13 / FOR001-FOR002)

External FOR001/FOR002 datasets are not shipped; place files under data/DTF/ or pass --dtf-file/--for002-file.

ExampleDemonstratesSuite
run_val_dtf_suite.jlUnified CLI: import audit, base-case validation, outage validation, MATPOWER round trip (--mode, --case)val_dtf
dtf/dtf_validation_report.jlCross-case CSV/Markdown report: loss decomposition, voltage-transfer diagnostics, ratio-mode comparisonsstandalone
dtf/for002_matpower_metadata_validation.jlFOR002/MATPOWER metadata fixtures (name normalization, comparison artifacts)standalone

State estimation

Example (examples/state_estimation/)DemonstratesSuite
state_estimation_wls.jlBaseline WLS runstate_estimation
state_estimation_manual_measurements.jlManual measurement setupstate_estimation
state_estimation_observability.jlObservability scenario and diagnosticsstate_estimation
state_estimation_passive_bus_zib_comparison.jlPassive-bus / ZIB handling comparisonstate_estimation
state_estimation_pmu_angles.jlPMU angle measurements and the reference-offset state αstate_estimation
usage_state_estimation_diagnostics.jlPractical diagnostics workflowstate_estimation
state_estimation_imag_bad_data.jlCurrent-magnitude measurements (ImagMeas) raising localizability (wii), sequential elimination trace, value gatestate_estimation
state_estimation_shunt_estimation.jlShunt estimation: stale reactor susceptance recovered as a state (case A), SHDERIV bay pseudo-measurement derived (case B)state_estimation
state_estimation_links_facts.jlSE on the contracted net (busbar coupler): LINKAGG aggregation, member sync, measured W2 allocation, se_viewstate_estimation
state_estimation_robust.jlRobust R modification suppressing a gross error (statistics on original sigmas), Wilson-Hilferty :high/:lowstate_estimation
state_estimation_chain.jlMeasurement CSV v1 roundtrip and the SE-started PF (se_state/se_snapshot, runpf_from_se!)state_estimation
bench_takahashi_diagnostics.jlBenchmark: dense pinv vs Takahashi selected inverse over a synthetic-grid size sweep (calibrates takahashi_min_states)(manual, not in suite)
h_matrix_observability_demo.jlMatrix-level observability/redundancy explorationstate_estimation
mc_state_estimation_study.jlMonte-Carlo WLS error statistics on the 7-bus workshop-tour network (M = 500)state_estimation

The suite column names the runner that executes the example (standalone = run directly, not part of a suite; optional = skipped when its inputs are unavailable). The suite runners print a per-example pass/fail summary and are themselves exercised by the extended test profile.