kicad2ems.mom25d.frill

mom25d.frill - a via through a hole (antipad) in a PEC plane inside the stack

The plane (LayerStack.pec) is not meshed: it shorts the stack's network, and
what is above it does not see what is below. A signal via through one of its
holes joins the two: its current runs on through the hole (one chain, as through
any interface it does not touch), and the hole carries one more unknown, the
voltage V across it.

Model ----- The field in the hole is the coaxial one, E_rho = V / (rho ln(b /
a)) for a < rho < b (a: the via's radius, b: the hole's), V the via's potential
over the plane's. Closing the hole with PEC and putting that field on both faces
of the plane (a magnetic frill each side) leaves two problems, each with the
plane as its ground or cover, and the field of the hole in each is TM and
axisymmetric. In the spectral transmission-line network (multilayer.py) it is
the network driven at the plane by the voltage

    e(kr) V,  e(kr) = (J0(kr a) - J0(kr b)) / (kr ln(b / a))          (the
              order-1 transform of E_rho)

in place of its short (the field in a hole of a thin plane is not quite the
coaxial one: `profile` has the shapes used, a first one like it and others that
redistribute the field across the hole, each with its own unknown; what follows
holds for each): T_k(kr) = LayerStack.transfer is the voltage it leaves at
interface k. With the exp(+jwt), J0 conventions of via.py:

  on interface k          E_t = -grad_t Psi_k,    Psi_k(rho) = int e T_k J0(kr
                          rho) dkr (the potential of the hole on that interface:
                          V at the via, 0 far away; exact, not only statically,
                          the field being TM)
  along a via in layer j  int E_z dz = int kr (T_j - T_{j-1}) e / kz_j^2  J0(kr
                          rho) kr dkr = -(Psi_j - Psi_{j-1}) - int (T_j -
                          T_{j-1}) e k_j^2 / (kr^2 - k_j^2) J0(kr rho) dkr
  at the hole             H_phi(+) - H_phi(-) = int (Yu + Yd) e V J1(kr rho) kr
                          dkr     (Yu, Yd: the network's admittances up and down
                          from the plane)

The unknown V takes one equation, H_phi continuous across the hole, tested with
the hole's own profile. By reciprocity the row is the transpose of the column
the hole's field makes in the other equations, so the system stays symmetric:

    [ Z    c ] [I]   [E]
    [ c^T -Y ] [V] = [0]

    c_m = -<f_m, E of the hole at 1 V>  = -int div f_m Psi   (an edge; a
          chain's ends on pads the same, by their fans' charge), plus the
          chains' remainder
    Y_fg = 2 pi int (Yu + Yd) e_f e_g J0(kr d_fg) kr dkr     (holes of one
          plane)

A chain's potential terms at the plane itself cancel between its two sides (a
via through the hole). A via onto the plane, outside every hole, is at zero
potential there from the axisymmetric shapes (their TE part is none), but not
from a first-order shape: it leaves -e1(0) cos(phi) / rho on the plane outside
the hole (a 2D dipole: the field is inside the hole), whose gradient its TE part
cancels, and the chain is charged it at that end (sim._frill_blocks; since
2026-11-15, found with the slot planes, slots.py). Its ends on pads and the
remainder count as well. Statically this is the hole's capacitance into both
sides, charged by what the pads' charges induce where the hole is: the current
through the hole alone makes no voltage across it.

The first azimuthal order (Frill.dipoles)
----------------------------------------- A trace that crosses the hole's rim is
not axisymmetric: its return current on the plane has to go round the hole, and
its charge finds no plane under it there. The field this puts in the hole is, to
first order, one that goes as cos(phi) and sin(phi) about the via:

    E = rho^ R(rho) cos(phi) + phi^ F(rho) sin(phi)
        ("c"; "s" is the same turned a quarter turn)

with F = 0 at the via and at the rim (the field along a conductor's edge), R
free there (`dipole_shapes`: the shapes of the hole of a thin plane with no via,
Bouwkamp's, and the via's own effect on them). Such a field is not a gradient:
its spectrum has a part along k (TM, the network's 'e' mode, as the axisymmetric
field's) and a part across it (TE, the 'h' mode):

    E~(k) = 2 pi [ e1(kr) cos(al) k^  -  h1(kr) sin(al) (z x k^) ]
                                      (al: the direction of k)
    e1 = int [R J1'(kr rho) - F J1(kr rho) / (kr rho)] rho drho,
        h1 = int [R J1 / (kr rho) - F J1'] rho drho

  on interface k  the TM part is a potential again, Psi_k = cos(phi) psi_k(rho),
                  psi_k = -int T_k e1 J1(kr rho) dkr (tested with the edges'
                  divergence, the chains' ends and remainder as above, J0 ->
                  J1); the TE part is a field with no potential, tested on the
                  edges themselves: E = (U0 + U2 cos 2phi, U2 sin 2phi),  U_n =
                  1/2 int Th_k h1 J_n(kr rho) kr dkr (Th: the transfer of the
                  'h' network); a vertical via does not see it
  at the hole     Y_cc = pi int [(Yu + Yd)_e e1 e1' + (Yu + Yd)_h h1 h1'] kr dkr
                  for two shapes of one hole (c and s do not couple there, nor
                  either with the axisymmetric shapes); between holes, `Y`.
class kicad2ems.mom25d.frill.Frill(via, k, b, modes=None, a=None, dipoles=None)[source]
A hole of radius b in the PEC plane on interface k, around the via `via`
at its axis. a: the inner radius of the gap (default the via's; its pad's
where the via has one in the hole). modes: how many axisymmetric field
shapes the hole carries (profile's m = 0..modes - 1), each with its own
unknown. dipoles: how many shapes of the first azimuthal order
(dipole_shapes' j = 0..dipoles - 1), each two unknowns (cos, sin): what a
trace crossing the rim adds.
property kinds[source]
The hole's unknowns: m (an axisymmetric shape), then ('c', j) and
('s', j) of each dipole shape.
class kicad2ems.mom25d.frill.FrillKernels(f, stack, frills, interfaces, rho_max, nrho=200)[source]
Per-frequency kernels of the holes `frills` (Frill) of a stack's internal
PEC planes. A hole's unknowns are its field shapes' amplitudes; `unknowns`
lists them, (frill, m), in the order of the system's columns.
  psi[(shape, k)]        : Table1D of Psi_k(rho), the shape's potential on
                         the metal interface k
  rem(shape, span, rho)  : the remainder of a chain through the layers of
                         `span` (k_bot, k_top) at rho
  Y(u, v)                : the admittance between two unknowns (of one hole,
                         or of two holes of one plane)
shape = (plane, a, b, m): holes alike share their kernels.
Y(u, v)[source]
The admittance between two unknowns (frill, m): 0 for holes of
different planes. With i = u, j = v, d and be the distance and direction
from v's hole to u's, and the angular integrals of exp(j kr d cos(al -
be)):

    axisymmetric, both       2 pi int Ye e e' J0 kr dkr
    axisymmetric i, c (s) j  -2 pi cos(be) (sin) int Ye e e1' J1 kr dkr
                             (the other way: +)
    c, c (s, s)              pi int [Ye e1 e1' (J0 -+ J2 cos 2be) + Yh
                             h1 h1' (J0 +- J2 cos 2be)] kr dkr
    c, s                     pi sin 2be int [-Ye e1 e1' + Yh h1 h1'] J2
                             kr dkr
rem(shape, span, rho)[source]
-int_chain E_z dz less its potential part, for a chain through
`span`'s layers at distance(s) rho from the hole's axis: sum over its
layers of int (T_j - T_{j-1}) e k_j^2 / (kr^2 - k_j^2) J0(kr rho)
dkr.
static shape(fr, m=0)[source]
What a hole's unknown shares with the like unknowns of holes alike:
(plane, a, b, m) of an axisymmetric shape, (plane, a, b, ('d', j)) of a
dipole shape (its cos and its sin: one set of kernels).
kicad2ems.mom25d.frill.bessel_int(n, spec, kr, dk, rho, J=None)[source]
int spec(kr) J_n(kr rho) dkr on the contour, for an array of rho:
(len(rho),), or (nspec, len(rho)). J: bessel_matrices of rho and kr, where a
caller has them.
kicad2ems.mom25d.frill.bessel_matrices(rho, kr, orders=(0, 1, 2))[source]
{n: J_n(rho x kr)}, (len(rho), len(kr)): the complex Bessel functions
only on the lifted part of the contour, the fast real J0 and J1 (and J2 from
them) on the rest.
kicad2ems.mom25d.frill.dipole_shapes(kr, a, b, j, J=None)[source]
(e1, h1)(kr) of the hole's j-th shape of the first azimuthal order, E =
(rho^ R cos(phi) + phi^ F sin(phi)) / b for a < rho < b (DIPOLE_SHAPES; 1 /
b: an amplitude in volts):

    e1 = int [R J1'(kr rho) - F J1(kr rho) / (kr rho)] rho drho
        (its part along k: TM)
    h1 = int [R J1(kr rho) / (kr rho) - F J1'(kr rho)] rho drho
        (its part across k: TE)

(Gauss-Legendre in t, rho = b sin t: the rim's 1 / sqrt is the Jacobian's.)
J: as profile's.
kicad2ems.mom25d.frill.profile(kr, a, b, m=0, J=None)[source]
e_m(kr) of a hole: the order-1 Hankel transform of its m-th field shape
g_m(rho), a < rho < b:

    g_m = cos(m pi u) / (rho sqrt(1 - rho^2 / b^2)) / arccosh(b / a),
        rho = b sin t,  u = (t - t0) / (pi/2 - t0)

(t0 = asin(a / b)). m = 0 is the coaxial field at the via, 1 / rho, with the
1 / sqrt(distance) of a thin sheet's edge at the hole's rim, and 1 V across
the hole; the others redistribute the field across it. e_m = b / arccosh(b /
a) int_t0^{pi/2} cos(m pi u) J1(kr b sin t) dt (Gauss-Legendre). J:
bessel_matrices of the hole's nodes (b sin t) and kr, where a caller has
them.