pcbqs.mqs - the magneto-quasistatic currents of a board's copper (the board much
smaller than a wavelength: a DC-DC converter's 0.1-30 MHz): where an AC current
flows (its return pulled under its path as the frequency rises, or around a
slot), the loop's R and L, and the near magnetic field it makes (Biot-Savart:
pcbqs.biot).
q = MQS(board, nets={'VIN', 'GND', 'SW'},
terminals={'U1.VIN': [('F.Cu', pad)], ...}, region=box(...),
dmax=0.5)
q.source('hot', 'U1.VIN', 'U1.PGND', part_h=0.5)
# a current source in the part between its pads
q.element('C1', 'C1.1', 'C1.2', C=10e-6, ESR=3e-3, ESL=0.4e-9)
r = q.solve([1e6, 3e6]) # per frequency: currents, the sources'
# Z = R + j w L
H = q.h_field(r, 0, pts) # (n, 3) A/m at points (m) for 1 A in the sources
The copper of the nets on every layer (cropped to `region`, mm) is meshed by
pcbqs's mesher (pdn.mesh, the pads' outlines as mesh edges; `fine`, a shapely
region in mm, meshed at dmax_fine: the loop's own area) and carries RWG
currents; a via is a filament between the layers it joins; a part (a source, a
capacitor) a branch between its terminals, drawn for the field as a filament
`part_h` above its pads. The unknowns are the loop currents of the branch graph
(a spanning tree's cotree: Kirchhoff's current law holds by construction, no
node potentials), so a sweep is one small solve per frequency:
Z_loops = C^T (R + j w L) C, R: the sheets' Gram matrix / (sigma t) and
the barrels', L: mu0 / 4 pi of
int int f_m . f_n / R (pcbqs's 1/R moments, analytic inner integral, between
layers at their offset), the vias'
partial inductances (parallel filaments), and the parts' series R, L, C.
Horizontal and vertical currents do not couple (orthogonal); the parts' own
fields count, their mutual inductance to the copper does not (a part's body: a
short filament well above it).
With capacitance=True, a homogeneous-dielectric surface-charge PEEC model
replaces the closed-loop constraint by charge continuity (pcbqs.peec).
It also provides Maxwell capacitance and Coulomb E; see docs/quasistatic.md.