pub fn calc_stated_state_mismatch(
net: &BalancedNetwork,
opts: &StatedStateOptions,
) -> Result<StatedStateMismatch>Expand description
Calculate the AC bus balance at the voltages net stores, with every
device at its stated output.
A case saved from a converged power flow stores bus voltage magnitudes and angles that balance the network’s injections. Evaluating every bus balance at those stored voltages measures how faithfully the case was read: a bus whose equipment PowerIO reads the way the solving program read it closes to the precision of the stored values, and a residual points at the equipment read differently.
A bus mismatch is the power the network draws from the bus at the stored
voltages minus the power the bus’s devices state they inject,
S_calc - S_stated, the mismatch MATPOWER’s newtonpf drives to zero. An
extra injection equal to the mismatch closes the bus
(StatedStateMismatch::closure_injections).
The network side is every in service branch and three winding
transformer winding at its stated tap and shift, plus every in service
fixed and switched shunt at its stated admittance, through the branch
admittances calc_admittance_matrix
uses. The device side is every in service generator at its stated pg
and qg, every in service load at the stored voltage through its voltage
model, every in service static VAR compensator and storage unit at its
stated terminal power, and every HVDC line under
StatedStateOptions::hvdc_treatment, with an LCC converter’s reactive
demand from StatedStateOptions::lcc_reactive_power.
Closed switches are refused rather than modeled. The balance stamps branches only, while the island labels join the buses a closed switch connects, so an unmerged switch carrying power would show as two equal and opposite residuals at its ends instead of a flow.
§Errors
Error::UnmergedZeroImpedance for an in service branch or winding with
zero series impedance: the stored voltages do not determine its flow, so
merge the buses it joins first
(BalancedNetwork::merge_buses, or --merge-buses on the command
line). powerio_tx::Error::ClosedSwitch (BUILD.SWITCH.CLOSED), as
IndexedNetwork::check_closed_switches raises it, for a closed switch
joining two buses; a rule that selects closed switches
(BusMergeRule::closed_switches,
--merge-buses switches) merges them first. An element naming an
undeclared bus, a non-finite admittance, or an unusable tap or base fail
as the admittance builders do.