Post-OPF operability API

The operability guide gives the supported network models, scaling conventions, sensitivity equations and sufficient conditions. The worked study shows how to check an operating point, vary loading and report the resulting voltage margins.

PowerOptLab.OperabilitySpec — Type
OperabilitySpec(; scaling_policy, ...)

Configuration for check_opf_operability. The scaling policy is required because the checker must use the coordinate contract of the audited OPF, rather than silently choosing its own per-unit convention. A staged BMOPFTools context can be supplied to check_opf_operability to obtain the policy, coordinate bases, and research provenance automatically.

The first implementation supports native static loads represented by ybus_linearized: constant-P, constant-I, constant-Z, ZIP, and exponential loads, including wye, single-phase, and delta connections. Generator, IBR, and endogenous-control equations are reported as outside this scope until a public equilibrium seam is available. The current closure is frozen-dispatch native static equilibrium and is recorded in result provenance.

Set compute_helm=true to request an independent no-load-connected HELM cross-check on its narrower constant-power/constant-impedance scope. A HELM failure is retained as :inconclusive; unsupported physics is :not_applicable. Set compute_sensitivity_validation=true to re-solve small uniform-load and named P/Q perturbations and compare the implicit derivatives with independent finite differences. Set compute_fixed_point_certificate=true to evaluate a conservative Bernstein-style Z-bus contraction condition. The certificate covers the native constant-P, constant-I, ZIP, exponential, and constant-Z load laws when their declared voltage-domain parameters are finite; a failed sufficient condition is :inconclusive, never a collapse or multiplicity claim. The same report includes fixed_point_local_region, a separate candidate-centered contraction result for local uniqueness evidence; it does not establish reachability from the energized no-load germ and does not downgrade the aggregate snapshot status. fixed_point_euclidean_region provides an alternative no-load-connected sufficient condition using a conservative Euclidean ball in the complex free-voltage state. For large snapshots, jacobian_spectrum=:extremes estimates only the largest and smallest singular values with deterministic iterative solves; the default :full mode retains the complete SVD and critical-mode participation. Set jacobian_storage=:sparse together with jacobian_spectrum=:extremes to retain the finite-difference Jacobian as a sparse matrix and use sparse LU right-hand-side solves; this reduced path omits the full SVD by design. Set record_jacobian_pattern=true when sparse row/column provenance is needed; the default false avoids retaining two explicit integer arrays in the sparse large-network path. Set compute_jacobian_validation=true to compare the retained finite-difference Jacobian with a second evaluation at one-tenth the configured step. This is a numerical step-stability diagnostic, not an analytic-derivative validation. Set compute_analytic_jacobian_validation=true to compare the full residual Jacobian with the analytic native static load-law assembly. Unsupported zero-magnitude operating points are reported as :not_applicable. Set compute_analytic_sensitivity_validation=true to cross-check the analytic uniform-load $F_λ$ contribution against a central finite difference.

source
PowerOptLab.OperabilityResult — Type
OperabilityResult

Structured first-slice post-OPF operability evidence. jacobian is the coordinate-scaled rectangular current-balance Jacobian. The state and voltage maps retain explicit node ordering so critical singular vectors and sensitivities can be attributed back to terminals.

source
PowerOptLab.check_opf_operability — Function
check_opf_operability(net, solution; spec, context=nothing)

Audit a solved static OPF point in the native load-flow scope. solution is the SI-valued result dictionary returned by BMOPFTools. Pass the staged OPF context when available so the effective scaling policy, coordinate bases, and research provenance are inherited; otherwise construct OperabilitySpec with an explicit scaling_policy (and scaling_bases for non-SI policies).

source
PowerOptLab.operability_scope_audit — Function
operability_scope_audit(net)

Return a serialisable preflight record for the native frozen-dispatch operability checker. This audit does not inspect a solved voltage state and does not claim that an out-of-scope network is infeasible; it identifies the exact model seam that would need to be extended before a snapshot can be checked. Scope-audit status deliberately uses its own two-value readiness vocabulary, :supported or :not_applicable; it is not an OperabilityCheck verdict.

source
PowerOptLab.operability_upstream_audit — Function
operability_upstream_audit()

Return the compatibility boundary used by the native operability and HELM implementations. The record is intentionally explicit: the pinned upstream release provides the public ybus_linearized equilibrium seam, while the connection-aware load decomposition remains private and is isolated here. The record is provenance, not a claim that generator, IBR, or controller equations are included in the native static closure.

source
PowerOptLab.OperabilityContinuationSpec — Type

Validated options for a static operability continuation trace.

fold_sigma_tol is a relative smallest-to-largest singular-value ratio threshold, so the criterion is invariant to a uniform residual scaling.

source
PowerOptLab.continue_opf_operability — Function
continue_opf_operability(net, solution; spec, continuation, context=nothing)

Trace the static native-load equilibrium from the energized no-load state (λ=0) toward the supplied solution (λ=1) by scaling load nameplates and using damped Newton correctors. The result records every accepted point, residual, smallest singular value, corrector iteration count, and explicit corrector/near-singular/voltage-limit events.

This is a natural-parameter predictor-corrector trace. It is useful branch evidence and a high-voltage preflight, but it does not cross folds and is not a pseudo-arclength reachability certificate. Pass stop_on_voltage_limit=true to terminate with :fail at the first declared terminal-voltage violation; the default keeps collecting the trace through such events.

source
PowerOptLab.OperabilityPseudoArclengthSpec — Type

Validated options for the pseudo-arclength operability trace.

fold_sigma_tol is a relative smallest-to-largest singular-value ratio threshold. lambda_min is the lower domain boundary for stress continuation; crossing it produces a model-domain event after fixed-λ boundary refinement.

source
PowerOptLab.continue_opf_operability_pseudo_arclength — Function
continue_opf_operability_pseudo_arclength(net, solution; spec,
    continuation=OperabilityPseudoArclengthSpec(), context=nothing)

Trace the same static load-scale equilibrium with a pseudo-arclength predictor/corrector. The path may continue through a fold because λ is treated as an unknown; fold candidates are recorded when the tangent reverses λ direction or the scaled Jacobian becomes nearly singular, with critical left/right singular-mode participation attached to those events. Endpoint crossings are reported with their bracketing λ values and refined at fixed λ when the crossing step does not land within target_lambda_tol. The result retains the separate voltage-normalized arclength metric alongside the audited scaling provenance, accepted arclength steps, and tangent-turning curvature history. The step controller reduces the next step when curvature exceeds continuation.curvature_high; when the corrector is cheap it uses faster growth below curvature_low and conservative growth otherwise. Pass stop_at_target=false to continue the stress path after λ=1; the default remains endpoint matching. Pass stop_on_voltage_limit=true to terminate with :fail at the first declared terminal-voltage violation.

source
PowerOptLab.locate_opf_operability_fold — Function
locate_opf_operability_fold(net, solution; spec, lambda=1.0,
    max_iterations=30, tol=1e-8, jacobian_step=1e-6, context=nothing)

Refine a supplied fold candidate with the bordered equations $F=0$, $Jv=0$, and $‖v‖₂=1$. solution supplies the initial voltage state and lambda specifies the load-scale at that candidate. This is a local diagnostic localization, not a global fold or branch-discovery certificate.

source
PowerOptLab.operability_continuation_margin — Function
operability_continuation_margin(result; reference_lambda=1.0)

Summarize the first declared path boundary observed in a continuation result. The summary considers voltage-limit, model-domain, and fold-candidate events; a localized bordered fold uses its refined λ when available. The first event in recorded trace order is selected, rather than the smallest λ, because a pseudo-arclength path can reverse direction. The returned margin is relative to reference_lambda (normally the audited endpoint λ=1), so it is a path-specific diagnostic rather than a global transfer-capacity certificate. If the trace ended before observing one of these mechanisms, the result has status == :not_observed rather than implying unlimited margin.

source
PowerOptLab.operability_continuation_rows — Function
operability_continuation_rows(result)

Return deterministic, one-row-per-accepted-point records for a continuation trace. Each row preserves the index into result.lambdas, result.states, and result.node_voltages, and includes residual, conditioning, corrector, and curvature evidence plus event kinds observed at that λ. It also retains the Jacobian and load-scale forcing methods from continuation provenance, together with the endpoint analytic-versus-finite-difference validation statuses and relative errors. These trace-level validation fields are repeated on each row so table consumers do not need a second provenance join. Curvature and arclength are NaN for the no-load base and any fixed-λ endpoint refinement that has no predictor tangent.

source
PowerOptLab.operability_stress_network — Function
operability_stress_network(net, lambda, direction)

Return a copied native-load network with a named finite stress direction applied. Every nameplate P/Q term is zero at lambda=0; at other values it is multiplied by the direction's P/Q scale, optional load weight, and optional connection weight. This builder does not solve the network or claim that the resulting endpoint is the audited OPF point.

source
PowerOptLab.operability_stress_rows — Function
operability_stress_rows(net, solution; spec, directions, lambdas, solve)

Run a bounded, deterministic campaign of named native-static stress snapshots. solve is an explicit caller-supplied callback accepting either (network, previous_solution, direction, lambda), (network, previous_solution, direction), (network, previous_solution), or (network), and must return an SI-valued solution dictionary. Set solve_arity to 1, 2, 3, or 4 when the callback is variadic or its intended arity cannot be inferred safely. Each row retains the stress name, lambda, endpoint residual, certificate status, region margin, and any solver/checking error. These rows are finite study evidence; they do not establish a global operating envelope or a continuation branch.

source
PowerOptLab.operability_stress_summary — Function
operability_stress_summary(rows; reference_lambda=1.0)

Aggregate one finite stress campaign into deterministic direction-level rows. Status precedence is :fail > :inconclusive > :pass > :not_applicable. The first failing or inconclusive row in ascending lambda order is a path-specific observed boundary; absence of one is reported as :not_observed, never as unlimited margin.

source
PowerOptLab.operability_stress_ensemble_rows — Function
operability_stress_ensemble_rows(campaigns; reference_lambda=1.0)

Summarize multiple finite stress campaigns, supplied as a dictionary or iterable of (model_id, rows) pairs. The returned rows retain the model label and direction-level path margins; differences are campaign comparisons, not a robustness guarantee over an uncertainty set.

source
PowerOptLab.operability_snapshot_row — Function
operability_snapshot_row(result; snapshot_id=nothing)

Return one compact, table-ready row for a single OperabilityResult. The row preserves the snapshot label, endpoint/regularity evidence, voltage and VUF extrema, branch-indicator counts, no-load and candidate-local certificate/HELM statuses, scaling/storage metadata, and the number of unsupported-scope reasons. It also retains scope status, closure/control closure, and source-topology readiness so pooled rows cannot hide an out-of-scope snapshot; the original unsupported-reason list is retained alongside its count. Every *_condition_margin field reports the best margin found over its geometry family, and the paired *_radius_condition_margin field reports the margin at that region's selected (largest certified) radius; the latter is pinned near zero by the radius search and is retained only as scan provenance. Per-check status counts are included so a study table can distinguish a clean pass from a result with requested claims that were inconclusive or not applicable without reimplementing aggregation. It also reports the same counts after excluding the explicitly complementary fixed_point_local_region check, which is not allowed to downgrade the primary verdict. The upstream adapter version and public equilibrium seam and deterministic adapter fingerprint are retained for reproducibility. It is a reporting projection of one snapshot, not a contingency or operating-envelope assessment. Unavailable optional scalar metrics use missing consistently; raw diagnostic arrays may retain NaN when their numerical shape is part of the algorithmic evidence.

source
PowerOptLab.operability_snapshot_rows — Function
operability_snapshot_rows(results)

Project a dictionary or iterable of (snapshot_id, result) pairs into a deterministically ordered vector of table-ready snapshot rows. Ordering is lexicographic on String(snapshot_id), so callers using numeric labels should zero-pad them when numeric order matters. This adapter is intentionally limited to already-solved single snapshots; it does not infer contingency, temporal, or operating-envelope semantics.

source