kicad2ems.core.viamodel - a physics-based model of a group of vias between
reference planes (segment.py's via models without a mesh; prototype,
2026-11-20).
The planes are the circuit's ground. Each signal via is a chain of nodes, one
at every plane it passes through and every signal layer it has a pad on:
- at each node a capacitance to the planes (the barrel, its pads and the
antipads: an axisymmetric electrostatic solve per via, `capacitances`), each
plane's share at the node of the via nearest it;
- between two nodes inside a cavity (two adjacent planes, height d) a series
element whose voltage is the cavity's: the parallel-plate (TEM) Green's
function w u d/4 H0^(2)(k rho) couples every via crossing the cavity, a
segment of height h weighted h/d (a signal layer inside the cavity splits
the via there: stripline);
- between an outer pad and the plane under it, the barrel's inductance;
- a ground via joining the two planes of a cavity shorts it there (its
voltage 0): the return current;
- each port (a trace cut at segment.py's circle) at its layer's node, through
its stub (the trace from the cut to the pad) as a transmission line.
The planes are infinite (no edge, no cavity resonance of a finite board), a
cavity carries its TEM mode alone (thin against the wavelength), losses are the
dielectric's and, with solve's sigma, the planes' copper (their surface
impedance (1 + j) Rs: k^2 (1 + (1 - j) delta / d), Q_c = d / delta; with rough,
Hammerstad's factor on delta). The stubs' copper is lossless (a millimetre or
so). Unknowns: the vias' nodes and segments, a few hundred at most.
A cavity named in build's `cavities` (a pair of plane layers: segment.py's
--cavities, the board's plane pair solved whole by core.cavities) is the
model's no longer: each of its segments a port instead (its + at the upper
node, the voltage across it the cavity's at the via, its current the barrel's
from the upper plane to the lower), and the box's ground vias in it not
modelled (the board's cavity holds every one). The join then puts the board's
cavity there: its resonances, its coupling to every other via model's vias.