pub fn transformer_seq_params(
y_series: Complex<f64>,
y_shunt: Complex<f64>,
tap: Complex<f64>,
from_status: u8,
to_status: u8,
winding_from: u8,
winding_to: u8,
sn: f64,
uk: f64,
s_base_va: f64,
clock: i32,
) -> ([Complex<f64>; 4], [Complex<f64>; 4], [Complex<f64>; 4])Expand description
Computes sequence-domain (y0, y1, y2) branch admittance parameters
(each [yff, yft, ytf, ytt]) for a two-winding transformer, needed for
asymmetric (3-phase) power flow and for short-circuit calculation.
Positive/negative sequence reuse branch_calc_param with the tap rotated
by ±clock (mirrors PGM’s asym_calc_param).
Zero sequence follows PGM’s own general algorithm
(component/transformer.hpp, the sc_calc_param/calc_param_asym zero-
sequence block) rather than enumerating winding pairs. Four cases, in
PGM’s own order — the first three are mutually exclusive, the zigzag pair
is additive on top:
- YNyn — the full two-port zero-sequence branch,
z0_series = 1/y_series + 3·(z_grounding_to + z_grounding_from/k²), with the tap’s phase picking up a 180° flip for clock ∈ {2, 6, 10} (reverse-connected variants). - YN* (from side wye_n, in service) — a ground path via the
magnetizing branch, plus a path via the series impedance when the other
side is delta; a one-port term on
yff, scaled by1/k². - *yn (to side wye_n, in service) — the mirror, a one-port term on
ytt. Dyn is this case, and was the only form of it gridoxide previously implemented. - ZN*/*zn — a zigzag_n winding’s zero-sequence impedance is taken as 10% of its positive-sequence value.
Then every side without a zero-sequence path of its own
(zero_seq_available, private) and in service picks up
−j·1e-8·sn/s_base/uk.
§Two modelling substitutions
gridoxide has no i0_zero_sequence/p0_zero_sequence fields on
PgmTransformer, so the zero-sequence magnetizing admittance is taken as
the positive-sequence one, y0_shunt = y_shunt. That is not an
approximation this crate invents: it is exactly what PGM computes when
those two fields are left unset, since it defaults i0_zero_sequence to
i0 and p0_zero_sequence to p0 in that case.
Likewise there are no grounding-impedance fields, so z_grounding_from = z_grounding_to = 0 throughout (PGM defaults them to zero too). That is
what collapses YNyn’s z0_series to 1/y_series — i.e. y0_series = y_series — and drops the 3·z_grounding term from the one-port cases,
where it would otherwise sit in series with 1/y0.