Generic Control Framework
Purpose
The inner numerical solver remains runpf!. The generic orchestration layer is run_control!, which runs controller-driven outer iterations around repeated PF solves.
run_acpflow automatically dispatches through run_control! when collect_outer_controllers(net) returns at least one controller.
Architecture
run_acpflow (public entry)
|
v
collect_outer_controllers(net)
|
v
run_control!
|
+--> runpf!
+--> control_evaluate!
+--> control_propose_update!
+--> control_apply_update!
+--> runpf! again
|
v
ControlRunResult stored on net.control_resultPreferred public entries:
run_acpflow(; net = net, ...)
run_acpflow(; casefile = "case14.m", path = "...", ...)run_acpflow is the public high-level ACP runner for both in-memory and file-based workflows.
Hook interface
AbstractOuterControllerAbstractControlStateAbstractControlUpdatecontrol_initialize!control_evaluate!control_propose_update!control_apply_update!control_is_convergedcontrol_is_blockedcontrol_statuscontrol_report_rowscontrol_trace_rowscontrol_max_outer_iterations
control_max_outer_iterations provides controller-specific outer-loop limits. The global outer-loop budget is control.max_outer_iterations and is combined with controller limits.
control_max_outer_iterations is currently treated as an internal extension hook (not exported). External custom controllers can still extend it via Sparlectra.control_max_outer_iterations(::MyController).
Result model
ControlRunResult contains:
statusconvergedouter_iterationspowerflow_solveslast_pf_iterationslast_pf_statuscontrollerstrace
Terminal statuses:
:no_controllers:disabled:no_active_controllers:pf_failed:converged:blocked:max_outer_iterations
Legacy status boundary (erg)
At the legacy API boundary, erg reflects inner numerical PF success/failure only.
:pf_failedmaps to failure (erg = 1).- Control-loop outcomes such as
:blockedor:max_outer_iterationsare not inner numerical PF failures.
Inspect control-loop outcome via latest_control_result(net) or net.control_result.
Latest-result access
Use:
latest_control_result(net)
net.control_resultThese expose the latest control run associated with the Net instance.
Trace rows (transformer control)
Minimal row schema:
outer_iterationcontroller_namecontroller_typetransformer_idmodestatusconvergedat_limitachieved_vm_putarget_vm_puachieved_p_mwtarget_p_mwtap_ratiophase_shift_deg