Post-OPF voltage operability
check_opf_operability evaluates an already extracted, SI-valued power-flow solution as a diagnostic point. The first implementation is intentionally scoped to the native BMOPFTools.ybus_linearized static network residual: constant-P, constant-I, constant-Z, ZIP, and exponential loads, with wye, single-phase, and delta connection records.
The checker reports:
- the independent non-source current-balance residual;
- an explicit terminal model-domain check for finite, nonzero phasors before angle and load-law derivative evidence is interpreted;
- a coordinate-scaled voltage Jacobian, singular values, condition number, and a rank/regularity check with critical left/right singular-mode participation;
- connection-level terminal voltages, requested-versus-realized powers, and derivatives under uniform load scaling plus named P/Q perturbations;
- optional independent finite-difference re-solves that validate the implicit uniform-load and named P/Q sensitivities; and
- path-qualified
dP/dVbranch indicators, with explicit sign convention and high-side/near-nose/low-side classifications; and - positive-/negative-sequence magnitude and VUF path derivatives, retained as complementary evidence rather than a replacement for per-phase checks; and
- positive-, negative-, and zero-sequence voltages and VUF on complete three-phase buses; and
- an opt-in HELM cross-check of the no-load-connected branch for networks without generators or IBRs (every static load law is supported); and
- an explicit natural-parameter load-scale continuation trace with corrector, residual, singular-value, and event history; and
- an opt-in pseudo-arclength predictor/corrector trace for the same static load-scale path, including voltage-normalized arclength provenance, target crossings, fixed-λ target refinement, and fold-candidate events with critical left/right mode participation and optional bordered fold localization; and
- a path-specific continuation-margin summary that identifies the first declared voltage-limit or localized fold boundary relative to λ=1; and
- an opt-in Bernstein-style Z-bus fixed-point certificate on the native constant-P/I/Z, ZIP, and finite exponential-law scope, with connection-aware wye/delta incidence, conservative voltage-domain Lipschitz bounds, an invariant contraction region around the energized no-load solution, and an independent fixed-point oracle trace; plus a separate candidate-centered contraction check that can provide local uniqueness evidence without claiming no-load reachability; and a conservative Euclidean-ball contraction certificate derived from the same connection incidence and load-law bounds; and
- deterministic one-row-per-point continuation records for table-ready residual, conditioning, curvature, and event summaries; and
- bounded named stress-direction snapshots with explicit P/Q and connection-weight transformations, caller-supplied solve callbacks, and table-ready residual/certificate rows; and
- deterministic direction-level and model-ensemble summaries with first observed non-pass boundaries and finite path-specific margins; and callback programming errors are rethrown, while expected bad snapshot data is represented by
OperabilityModelErrorand retained as an inconclusive row; and operability_snapshot_row, a compact single-snapshot projection for study tables that does not imply contingency or envelope coverage; and- explicit
:not_applicablescope evidence when generator or IBR equations are outside the residual seam.
Call operability_scope_audit(net) before solving when a workflow needs a machine-readable readiness check. It reports the native equilibrium scope, frozen-dispatch closure, generator/IBR counts, load inventory, and retained topology evidence (including voltage-source presence and source-bus references), and retained reasons for any extension requirement. An out-of-scope result is a readiness diagnostic, not an infeasibility claim. A missing or dangling voltage source is reported here before the full checker is invoked.
operability_upstream_audit() exposes the compatibility boundary behind that scope. It records the pinned BMOPFTools version, the public ybus_linearized seam, and the single isolated private load-decomposition adapter. It also records that generator/IBR/controller residual equations are not yet available through this seam; this provenance prevents a future closure extension from silently reusing only the native static equations. The audit also checks that the declared public seam and private imports are present; operability_scope_audit retains a :not_applicable reason if that compatibility check fails.
Scaling is part of the evidence contract. Supply the staged OPF context so the audited policy, AC coordinate bases, and research provenance are inherited, or pass an explicit OperabilitySpec(scaling_policy=...). Non-SI policies also require scaling_bases keyed by every bus; the checker rejects an incomplete base map and never invents a per-unit base. Equivalent SI and per-unit audits should preserve the physical conclusion (endpoint claim, voltage/VUF limits, branch-indicator classification, and certificate status), while normalized residuals and singular values remain coordinate-dependent evidence. The current equilibrium closure is explicitly :frozen_dispatch and is recorded in provenance; other closures are rejected until their equations are available through a public upstream seam.
Local load-law power derivatives are evaluated analytically from the isolated BMOPFTools sub-load coefficients and compared with the retained finite- difference derivative. Each terminal record keeps both values, the absolute discrepancy, and a validation status. The default network Jacobian and load-scale forcing use finite differences. The analytic native static validation paths below are implemented; they do not extend the residual scope to controllers, generators or IBRs.
Set compute_analytic_jacobian_validation=true to compare the full scaled finite-difference Jacobian against the analytic native static load-law assembly. The check retains its relative error and tolerance; zero-magnitude operating points are :not_applicable because the current-law derivative is singular or undefined there. Set compute_analytic_sensitivity_validation=true to validate the corresponding uniform-load F_lambda contribution from the zero-load/native-Ybus decomposition against a central finite difference.
The aggregate result is :pass only when a requested primary operational claim (terminal-voltage bounds, sequence-unbalance bounds, HELM reachability, or the fixed-point certificate) has passed. If no such claim was requested, the result remains :not_applicable even when endpoint and Jacobian evidence are good.
If the network contains a generator, IBR, unsupported load law, or unsupported connection, the checker returns :not_applicable before evaluating a partial residual. The reasons are retained in result.unsupported, the scope check, and result.provenance["operability"]; this is explicit scope evidence, not a pass and not a claim that the omitted equations are feasible.
The fixed-point certificate is a sufficient, local-in-model-region result. It uses the source-eliminated implicit Z-bus map and conservative connection-aware componentwise complex-voltage polydisc bounds around the no-load solution, retaining a uniform-radius fallback. A :pass means the candidate lies inside a contraction region that contains a unique equilibrium and has a nonsingular equilibrium Jacobian on that region. A failed sufficient condition, unsupported load model, or candidate outside the region is :inconclusive; it is not evidence of non-existence, multiplicity, or a low-voltage branch.
When requested with the certificate, checks["fixed_point_local_region"] is a separate candidate-centered contraction result. It can certify local uniqueness around a feasible candidate even when the no-load-connected certificate is inconclusive, but it never establishes reachability from the energized germ. checks["fixed_point_euclidean_region"] is an alternative no-load-connected sufficient condition using a Euclidean ball in the complex free-voltage state; its :pass likewise requires the candidate to lie inside that ball. The uniform and componentwise polydisc searches retain the largest feasible radius found on their deterministic scan, because containment is the useful claim. Their invariance bound is componentwise (b_i ≤ radius_i), whereas the Euclidean and candidate-local regions use an offset-plus-Lipschitz bound (offset + q·radius ≤ radius). The reported margins are therefore comparable within a geometry family, not interchangeable across geometries. The selected region's condition_margin is intentionally paired with max_condition_margin: the former describes the largest-radius containment member, while the latter is the best 1-q observed over the finite scan and retains a meaningful conditioning margin instead of a bisection-boundary artifact.
Equations and interpretation
Static equilibrium and terminal coordinates
For the implemented frozen-dispatch closure, write the rectangular static network residual as
\[F(z,\lambda;m)=0,\]
where $z$ contains the free conductor-voltage components, $\lambda$ is the declared load-scale parameter and $m$ records load laws and connections. Optimized independent setpoints are held fixed. An operational closure with endogenous droop, PV or controller states needs additional residual equations and is not implemented by this checker. The OPF KKT matrix is not this power-flow Jacobian.
Let a real incidence matrix $C$ map conductor potentials to oriented device voltages. Its rows form phase-to-neutral voltages for wye branches and line-to-line voltages for delta branches:
\[u=Cv,\qquad i_{\mathrm{node}}=C^{\mathsf T}i_{\mathrm{branch}}(u).\]
With $C_R=\operatorname{diag}(C,C)$, the rectangular device tangent is
\[J_{\mathrm{device}}=C_R^{\mathsf T}J_{\mathrm{branch}}C_R.\]
This preserves delta cross-phase coupling and free-neutral displacement. The derivative must follow the declared load law: constant-P/I/Z, ZIP and supported exponential loads can have different incremental responses at the same power and voltage. The analytic validation options check this native static assembly against the finite-difference calculation.
Directional sensitivities and conditioning
At a regular equilibrium, $J=F_z$ and the tangent for a declared stress path satisfies
\[J\frac{dz}{d\lambda}=-F_\lambda,\qquad \frac{dg}{d\lambda}=g_z\frac{dz}{d\lambda}+g_\lambda.\]
The same construction applies to named P/Q perturbations. A sensitivity is conditional on that model, equilibrium and direction. A reported $dP/dV$ is a path-qualified ratio of tangents; a near-zero voltage tangent makes the quotient singular or inconclusive. Local nonsingularity alone does not distinguish the high- and low-voltage branches.
Use the audited solve's scaling policy for residual and state coordinates before interpreting singular values, rank tolerances or mode participation. Singular values and raw vector components depend on those coordinates. A determinant or a reduced Q–V approximation is not a substitute for the full rectangular four-wire evidence.
Continuation, margins and certificates
Natural-parameter continuation follows a specified load-scale path. Near a fold, the voltage Jacobian becomes singular and natural-parameter sensitivities can grow without bound. Pseudo-arclength continuation augments the equations to follow the curve; the optional bordered localizer refines a fold candidate via $F=0$, $Jr=0$ and $\lVert r\rVert_2=1$. These are local numerical results for the declared path and initial state.
An operational voltage boundary can precede a fold. Report which boundary was observed, the path parameter and the reference point. A missing boundary is :not_observed, not an unlimited margin. HELM agreement, a continuation trace, local regularity and a sufficient fixed-point certificate establish different claims. The candidate-centered certificate can establish local uniqueness without no-load reachability; failure of a sufficient contraction bound remains inconclusive.
These snapshot and path diagnostics do not allocate a DOE or certify every utilization/scenario combination. A study that invokes them for selected DOE snapshots must retain that finite scope.
Computational scaling and size guidance
There is no single network-size cutoff: runtime depends on the number of non-source nodes, load connections, requested sensitivity directions, and whether the opt-in continuation, HELM, validation, or fixed-point checks are enabled. The result records diagnostic size indicators in report.branch_evidence["complexity"] so a study can retain the cost context with its scientific evidence.
The table-ready operability_snapshot_row(report) projection carries the same review context in compact form: jacobian_spectrum_mode, jacobian_storage_mode, jacobian_nonzero_count, jacobian_storage_bytes_estimate, zbus_storage_mode, fixed_point_condition_margin (the best finite-scan robustness margin), fixed_point_radius_condition_margin (the selected-radius containment margin), scope_status, closure, control_closure, source-topology readiness, and the explicit statuses of endpoint, Jacobian regularity, voltage bounds, sequence unbalance, and sensitivity checks. It also retains the exact unsupported_reasons list, not just its count. The row carries schema_version and an explicit claim_scope="one_solved_equilibrium_only"; this is deliberately distinct from future contingency or operating-envelope schemas. It also carries the upstream adapter version, deterministic adapter fingerprint, and public equilibrium seam used to produce the row. The fingerprint changes if the pinned upstream version or isolated private import list changes. The upstream audit also verifies that every adapter import is bound in PowerOptLab and is the same binding exported by BMOPFTools, making drift in the isolated seam explicit rather than silently trusting the import list. The row also includes check_count and per-status check counts, making it possible to distinguish a clean pass from a result with requested checks that were inconclusive or not applicable without reimplementing aggregation. The primary_check_* fields repeat those counts after excluding the complementary candidate-local fixed-point region, matching the rule that this evidence does not downgrade the aggregate snapshot verdict. Validation status fields are paired with relative-error summaries for the finite-difference step check, analytic Jacobian and load-scale checks, and re-solved sensitivity validations; unrequested or unavailable validations are reported as missing rather than being interpreted as zero error. Snapshot rows use missing uniformly for unavailable optional scalar metrics; raw diagnostic arrays may retain NaN where their numerical shape is part of the algorithmic evidence. The row also carries the declared endpoint residual, terminal-voltage, and sequence-unbalance limits next to the corresponding measurements and statuses. check_messages preserves the deterministic explanation for each status, including unsupported-scope, not-requested, and inconclusive outcomes. claim_statuses provides section-level aggregation for endpoint, voltage-quality, local-regularity, sensitivities, reachability, and certificates; each section uses fail-over-inconclusive-over-pass precedence and is :not_applicable when none of its checks were available. The legacy-compatible fixed_point_max_condition_margin field aliases the robustness margin; the unqualified fixed_point_condition_margin now answers the same practical question, while the radius-boundary artifact is explicit in fixed_point_radius_condition_margin. The candidate-local and Euclidean regions follow the same convention, so fixed_point_local_condition_margin, fixed_point_euclidean_condition_margin, and fixed_point_condition_margin are directly comparable, with each region's radius-boundary value in the matching *_radius_condition_margin field. When HELM is requested, helm_endpoint_mismatch, helm_endpoint_limit, and helm_common_node_count expose the numerical agreement behind helm_reachability_status; otherwise they are missing. Sparse reports also retain the finite-difference row/column pattern in complexity["jacobian_pattern"]; this is an operating-point diagnostic, not a topology-invariant symbolic sparsity pattern. Set record_jacobian_pattern=true to retain those arrays when provenance is needed; the default false omits them while retaining the nnz and byte summaries. A row therefore remains interpretable when reports from different storage/spectrum policies are combined, while not_requested distinguishes an intentionally disabled certificate from an unsupported claim.
Set compute_jacobian_validation=true to compare the scaled finite-difference Jacobian with the same residual map evaluated at one-tenth the configured step. The resulting jacobian_step_validation check and snapshot-row status are numerical step-stability evidence only; they are not a substitute for an analytic or automatic-differentiation cross-check.
For a network with $n_f$ free complex nodes (real state dimension $n=2n_f$) and $m$ load connections, the current implementation has these dominant terms:
| Component | Current scaling / practical implication |
|---|---|
| Residual evaluation | approximately $O(nnz(Y)+m)$ when the upstream Ybus is sparse |
| finite-difference Jacobian | $O(n)$ residual evaluations, then a dense $n×n$ matrix |
| singular values and dense linear solves | $O(n^3)$ worst-case time and $O(n^2)$ memory |
| named P/Q sensitivities | one perturbed Ybus and right-hand side per requested direction (up to $1+2m$); the dense Jacobian factorization is reused when regular |
| fixed-point certificate | one Ybus factorization plus four deterministic coarse-grid/bisection geometry searches (33 coarse points + 12 refinements each); dense factorization storage is $O(n_f^2)$, while sparse input uses sparse LU with topology-dependent fill-in |
| continuation / stress campaigns | multiply snapshot cost by accepted steps or finite $(direction, λ)$ rows; independent validation adds two nonlinear re-solves per validated direction |
As a practical policy, run the default single-snapshot checks freely on small and medium feeders, but be deliberate for large meshed systems. For roughly $n_f$ in the low hundreds, retain the dense Jacobian evidence but consider disabling compute_fixed_point_certificate, compute_helm, and compute_sensitivity_validation unless they are needed for the study claim. Above roughly $n_f=500$ the dense SVD/Jacobian and explicit Zbus allocation should be treated as a scaling risk rather than an automatic rejection; use a smaller diagnostic subset or a redesigned sparse/iterative backend. The reported byte estimates are warnings, not hard safety limits, and hardware, sparsity, and requested campaign size must be measured for the target study. As an intermediate option, jacobian_spectrum=:extremes avoids the full SVD and retains only iterative estimates of the largest and smallest singular values. Its Lanczos budget scales with state dimension up to a bounded cap; if the dense reduced estimator still fails to converge, the implementation falls back to the reference dense SVD and records jacobian_spectrum_effective_mode="full_fallback". Sparse mode does not silently densify: an estimator failure remains an honest inconclusive regularity result with a specific non-convergence message. The reduced path still constructs one finite-difference Jacobian, so it reduces spectral work but is not automatically a sparse-memory backend; critical singular-vector participation is omitted unless a dense fallback is used. For a sparse-memory Jacobian path, pair jacobian_storage=:sparse with jacobian_spectrum=:extremes. This stores the finite-difference matrix in compressed sparse form and uses sparse LU right-hand-side solves, but it still requires one residual pair per state coordinate. The fixed-point certificate also reuses a Ybus factorization rather than explicitly materializing an inverse; sparse LU fill-in remains network-dependent and should be measured.
using SparseArrays
complexity = report.branch_evidence["complexity"]
complexity["real_state_dimension"]
complexity["jacobian_storage_bytes_dense"]
complexity["zbus_storage_bytes_dense"]
reduced = check_opf_operability(net, pf;
spec = OperabilitySpec(scaling_policy = SIUnitsScaling(),
jacobian_spectrum = :extremes))
reduced.singular_values # [σmax, σmin] estimates
reduced.branch_evidence["critical_mode"] # explicitly not applicable
sparse_reduced = check_opf_operability(net, pf;
spec = OperabilitySpec(scaling_policy = SIUnitsScaling(),
jacobian_spectrum = :extremes,
jacobian_storage = :sparse))
issparse(sparse_reduced.jacobian)For local size evidence, run the generated radial-feeder benchmark:
julia --project=. scripts/benchmark_post_opf_operability_scaling.jl 8 16 32 64It emits CSV-style timing, allocation, state-dimension, nonzero-count, actual Jacobian-storage, dense-equivalent-storage, and non-pass-check rows for dense/full, dense/reduced, and sparse/reduced modes. The first case in each mode is warmed up to remove most compilation cost from the reported timings. The benchmark is a reproducibility aid for choosing study settings on the target machine, not a universal performance claim; a fail row is retained with its failing check names rather than being silently discarded.
using BMOPFTools
# BMOPFTools does not export the OPF scaling-policy types, so name the
# one matching the audited solve explicitly.
using BMOPFTools: SIUnitsScaling
using PowerOptLab
pf = solve_pf(net; per_unit=false)
report = check_opf_operability(net, pf;
spec = OperabilitySpec(
scaling_policy = SIUnitsScaling(),
voltage_min = 0.95 * vbase,
voltage_max = 1.05 * vbase,
vuf_max = 0.02,
compute_helm = true,
compute_fixed_point_certificate = true,
))
report.status # :pass, :fail, :inconclusive, or :not_applicable
report.checks["jacobian_regular"]
report.sensitivities["load_scale"]
report.sensitivities["directions"]["P"]
report.branch_evidence["critical_mode"]
report.branch_evidence["dP_dV"]
report.branch_evidence["sequence_sensitivity"]
report.branch_evidence["complexity"]
report.branch_evidence["reachability"]
report.branch_evidence["fixed_point_certificate"]
report.checks["fixed_point_local_region"]
report.checks["fixed_point_euclidean_region"]
# Includes `connection_law_terms`, the certified radius, lower connection
# voltage, contraction factor, finite-difference `law_bound_validation`, and
# the independent Z-bus oracle summary.
report.provenance["operability"]["model_inventory"]
Each load-connection record under the uniform-load sensitivity retains both
`path_dP_dV` and the complementary `path_dQ_dV`, plus the signed
`path_dP_dlambda`/`path_dQ_dlambda` terms and a `path_dP_dV_status`. These are
path-qualified derivatives in the declared uniform-load direction; a
near-zero voltage tangent is reported as `:near_zero_voltage_tangent` rather
than being divided into an unstable slope. The sign is therefore a branch
indicator for that path, not a universal voltage-stability certificate.
The aggregate `branch_evidence["dP_dV"]` record retains status counts and
`near_zero_voltage_tangent_count`, so a pooled row can distinguish missing
sensitivity evidence from a deliberately withheld slope at a turning tangent.
Snapshot rows also retain a sequence-sensitivity status and maxima of the
absolute positive-sequence, negative-sequence, and VUF derivatives. These are
summary fields only; the per-bus phasors and phase-level records remain the
authoritative evidence.
Each terminal record also retains its voltage angle in radians and its
angle derivative for the declared perturbation. The snapshot projection keeps
the maximum absolute terminal angle derivative as a compact screening field;
the signed per-terminal value is required when interpreting phase rotation.
trace = continue_opf_operability(net, pf;
spec = OperabilitySpec(scaling_policy = SIUnitsScaling()),
continuation = OperabilityContinuationSpec(initial_step = 0.1))
trace.status
trace.events
All three continuation entry points and the bordered fold localizer run the
same `operability_scope_audit` preflight as the snapshot checker. Missing or
invalid source topology therefore returns `:not_applicable` with the audit
record, rather than entering a singular bordered solve.
pseudo = continue_opf_operability_pseudo_arclength(net, pf;
spec = OperabilitySpec(scaling_policy = SIUnitsScaling()),
continuation = OperabilityPseudoArclengthSpec(initial_step = 0.05))
pseudo.status
pseudo.provenance["continuation"]["pseudo_arclength"]
pseudo.provenance["continuation"]["arclength_state_scale"]
pseudo.provenance["continuation"]["curvature_history"]
pseudo.provenance["continuation"]["jacobian_method"]
pseudo.provenance["continuation"]["lambda_forcing_method"]
pseudo.provenance["continuation"]["analytic_jacobian_validation"]
pseudo.provenance["continuation"]["analytic_load_scale_validation"]
# To continue the declared stress path beyond the audited endpoint:
stress = continue_opf_operability_pseudo_arclength(net, pf;
spec = OperabilitySpec(scaling_policy = SIUnitsScaling()),
continuation = OperabilityPseudoArclengthSpec(max_steps = 200),
stop_at_target = false)
stress.events
stress.provenance["continuation"]["lambda_min"]
# Optionally terminate when a declared terminal-voltage limit is first crossed:
limited = continue_opf_operability_pseudo_arclength(net, pf;
spec = OperabilitySpec(scaling_policy = SIUnitsScaling(), voltage_min = 0.95vbase),
continuation = OperabilityPseudoArclengthSpec(),
stop_on_voltage_limit = true)
limited.status
limited.events
limited.provenance["continuation"]["margin"]
rows = operability_continuation_rows(pseudo)
rows[1].lambda
rows[end].event_kinds
rows[1].jacobian_method
rows[1].lambda_forcing_method
rows[1].analytic_jacobian_validation_status
rows[1].analytic_load_scale_validation_status
directions = [
OperabilityStressDirection(:uniform),
OperabilityStressDirection(:reactive_removed; p_scale=1.0, q_scale=0.0),
]
stress_rows = operability_stress_rows(net, pf;
spec = OperabilitySpec(scaling_policy = SIUnitsScaling(),
compute_fixed_point_certificate = true),
directions = directions,
lambdas = [0.0, 0.5, 1.0],
solve = network -> solve_pf(network; per_unit=false))
stress_rows
operability_stress_summary(stress_rows)
operability_stress_ensemble_rows(Dict("base" => stress_rows))
operability_snapshot_row(report; snapshot_id = "base")
validated = check_opf_operability(net, pf;
spec = OperabilitySpec(
scaling_policy = SIUnitsScaling(),
compute_sensitivity_validation = true))
validated.checks["load_scale_sensitivity_validation"]
validated.checks["directional_sensitivity_validation"]
validated.sensitivities["validation"]["load_scale"]
validated.sensitivities["validation"]["directions"]
operability_snapshot_rows(Dict("base" => report, "validated" => validated))
# Starting from a voltage/state near a suspected nose, solve the bordered
# equations F=0, J*v=0, ||v||₂=1 at a declared load scale.
fold = locate_opf_operability_fold(net, approximate_fold_solution;
lambda = 1.04,
spec = OperabilitySpec(scaling_policy = SIUnitsScaling()))
fold.status
fold.lambda
fold.critical_modeThis is a local post-solve screen, not a proof of global solvability or dynamic voltage stability. HELM agreement is path-qualified evidence for its energized no-load homotopy; HELM non-convergence is inconclusive, not a non-existence certificate. The current pseudo-arclength implementation is a first static slice with opt-in bordered-equation fold refinement. It does not provide deflation/global branch discovery, controller closures, or fuller generator/IBR equilibrium seams. A low-voltage equilibrium can still pass the local endpoint residual check while failing the no-load-connected target comparison; that distinction is deliberate branch evidence, not a claim that the low branch is infeasible. locate_opf_operability_fold is likewise local: convergence establishes a bordered-equation fold candidate for the declared static model and initial guess, not uniqueness or global reachability.
API reference
The operability API lists snapshot checks, continuation, fold refinement, finite stress-study adapters and their result types.
Transformer support is limited to complete finite-admittance primitives accepted by the pinned BMOPFTools public API. Ideal, near-zero and singular leakage that requires augmented current states returns :not_applicable in the scope audit, snapshot checker and continuation entry points. HELM supports a broader domain.