kicad2ems.fem.palace.pdn

A rail's PDN in Palace (R-E22): the rail pcbqs's PDN run found (its nets,
ground, decoupling capacitors, regulator and loads), solved again in 3D, its
impedance at each load beside pcbqs's.

    python -m kicad2ems.pcbqs.pdn board.kicad_pcb --rail +3V3 ... \
        --ports-touchstone --out pdn_3v3
    python -m kicad2ems.fem.palace.pdn --pdn pdn_3v3 --out pdn_3v3_palace

Every part on the rail is a lumped port across the gap between its closest rail
pad and ground pad (a series part's: between its two pads), and Palace solves
the bare copper between them: the rail's and the ground's copper and vias as PEC
sheets and barrels, the dielectric between. Its port matrix (Z = R (I + S)(I -
S)^-1, the ports' R near the rail's impedances) is then closed by the parts, as
kicad2ems closes part ports (embed.close): each series part, the decaps (C, ESR,
ESL, or their vendor file) and the regulator (R + L, or its file) by its own
impedance, the loads left open, which is what each load sees. Palace's ports
stand at the parts' pads, so the copper from the pads to the planes (pcbqs's
mount inductance) is Palace's own here.

Writes <out>/pdn_palace.json: the frequencies, the bare port matrix's diagonal,
each load's |Z| and phase, pcbqs's beside them (its z and, where the run wrote
--ports-touchstone, its bare port matrix), the differences, the model's counts;
<out>/pdn_palace_ports.zNp the bare port matrix. Palace's driven solver is
full-wave: below a few MHz its system is poorly conditioned, so the band starts
at --fmin (default 1 MHz); pcbqs's PDN is the low-frequency answer.
kicad2ems.fem.palace.pdn.close(Z, keep, loads)[source]
Z (nf, n, n) with the ports not in `keep` closed by loads {index: z
(nf,)}: Z_kk - Z_kp (Z_pp + z)^-1 Z_pk.
kicad2ems.fem.palace.pdn.element_z(el, f, files=None)[source]
A part's own impedance at f (its element in pdn.json: C, ESR, ESL; R, L;
or its file, read again from the run's settings), without its mount
(Palace's copper has that).
kicad2ems.fem.palace.pdn.gap_port(b, name, g, z0)[source]
The kicad2ems gap Port of pad_gap's gap g on board b (model coordinates:
y up).
kicad2ems.fem.palace.pdn.pad_gap(raw, ref, nets_a, nets_b, ground_copper=None)[source]
The copper gap a port of part `ref` spans (KiCad mm): on the line between
its closest pads of nets_a and nets_b (on one copper layer, apart along x or
y), from the edge of the copper its nets_a pad is in (a pour, a trace) to
the edge of the copper of its nets_b pad, as wide as those pads face each
other: where a lumped element joining the two would be. A part with no pad
of nets_b: its nets_a pad against the nearest copper of ground_copper
{layer: geometry} (a regulator's output). None where no such gap is clear of
other copper. dict(layer, axis, lo, hi, c0, c1).