kicad2ems.pcbqs.mqs_ports

Passive terminal reduction of MQS copper for circuit simulation and field
inference.

Each current-source port joins two terminals on the *same connected net*. The
reported current enters copper at its first terminal. Artificial port filaments
are excluded from field responses. No lumped parts are allowed in this
reduction.
class kicad2ems.pcbqs.mqs_ports.PortResponse(frequencies: numpy.ndarray, names: list, impedance: numpy.ndarray, currents: numpy.ndarray)[source]
drive(amplitudes)[source]
Branch currents for complex Fourier coefficients entering each copper
port.
kicad2ems.pcbqs.mqs_ports.direct_ports(q, C, Rl, Ll, sc, frequencies, log=None, note=None)[source]
Port impedances (F, P, P) and branch currents (F, nb, P) from the dense
loop matrices Rl, Ll of the loop basis C, the ports' loops the columns sc:
the other loops eliminated by a direct solve at each frequency.
kicad2ems.pcbqs.mqs_ports.foster_equivalent(response, poles_Hz=None, iterations=1800)[source]
Fit a positive-real matrix Foster RL impedance by convex PSD-constrained
LS.

Z(s)=Rdc+s*Linf+sum(s/(s+p)*Rmode); every matrix is PSD. This is a passive
circuit, unlike an unconstrained interpolated impedance table. Residues are
fit jointly across all ports using scaled ADMM projections. Accuracy is
reported at each supplied frequency and must be independently checked.
kicad2ems.pcbqs.mqs_ports.rl_equivalent(response, index=-1, tolerance=1e-07)[source]
Single-frequency passive R/L approximation; error must be checked over
use band.

An RL copper network's terminal R and Im(Z)/omega are positive semidefinite.
Tiny numerical negative eigenvalues are projected out; material violations
fail.