kicad2ems.mom25d.farfield

mom25d.farfield - the far field of the surface currents of a solve: patterns,
directivity, gain, efficiency.

    ff = far_field(sim, I, f, theta, phi)  # r E_theta, r E_phi (V) on a theta x
                                           # phi grid (degrees)
    U, prad = radiated(Eth, Eph, theta, phi)  # radiation intensity and radiated
                                              # power

Every metal interface radiates into the half-space above the stack (the top
medium, top_er): its current J(x, y), Fourier transformed at k_rho = k_top
sin(theta), gives the tangential E on the top interface through the stack's TM /
TE transmission-line voltages (LayerStack.voltage; Michalski: E_u = -V^e J_u,
E_v = -V^h J_v, u along k_rho), and that E the far field (exact for the
half-space above a plane, by stationary phase):

    r E_theta = j k_top / (2 pi) E_u,  r E_phi = j k_top cos(theta) / (2 pi) E_v
                                       (e^{-j k r} dropped)

Vertical currents (the via chains: one unknown each, a +z current through its
layers) radiate through the TM network too: a unit current through layer j gives
E_t = grad_t S on interface o, S~ = sum_j [V(z_j | z_o) - V(z_{j-1} | z_o)] /
kz_j^2 (mom25d.via), so E_u = -j k_rho S~ e^{j k.rho_via} and nothing in E_v.

The openings of a PEC plane in the stack (slots.py) radiate their field E~ on
the plane, carried to the top (or bottom) interface by the network driven there
(LayerStack.transfer): E_u = T^e E~_u, E_v = T^h E~_v.

Over the PEC ground nothing radiates below it (theta > 90 deg: zero). A whole
stack (LayerStack bottom='open':
no infinite ground, the planes meshed) radiates below as well: mirrored in z,
the lower half-space's far field comes from the tangential E on interface 0,
k_bot the half-space's wavenumber (cos(theta) < 0):

    r E_theta = -j k_bot / (2 pi) E_u,  r E_phi = -j k_bot cos(theta) / (2 pi)
                                        E_v

What the substrate guides away (surface waves) and its loss are not radiated, so
efficiency = P_rad / P_accepted counts both as loss.
kicad2ems.mom25d.farfield.current_on_grid(sim, I, x, y, k)[source]
The surface current J (A/m) of interface k on the grid x, y (m): the RWG
basis functions evaluated at each point (linear in each triangle: J = a r +
b, continuous normal component across edges), 0 off the copper. Returns Jx,
Jy ((nx, ny) complex) and the triangle of each point (-1 off the copper).
kicad2ems.mom25d.farfield.far_field(sim, I, f, theta, phi)[source]
r E_theta, r E_phi (V, complex, shape (len(phi), len(theta))) of the
currents I (one excitation column) at f (Hz), the surface currents and the
vias'; theta from the board normal (0..180 deg: above the board to 90, below
it beyond; zero below the PEC ground), phi from +x (degrees). I: N x k for k
excitations at once:
(k, nphi, ntheta) each, the phases shared (an array's ports: one pass, not
one each).
kicad2ems.mom25d.farfield.far_field_dirs(sim, I, f, theta, phi)[source]
far_field in the directions (theta[i], phi[i]) (degrees, paired: not a
grid): r E_theta, r E_phi, each (ndir,) for one excitation column, (k, ndir)
for I N x k.
kicad2ems.mom25d.farfield.near_field(sim, layers_J, x, y, f, height, pad=2)[source]
E (V/m, (nx, ny, 3) complex) on the plane `height` (m) above the top of
the stack (near_fields' E at one height).
kicad2ems.mom25d.farfield.near_fields(sim, layers_J, x, y, f, heights, pad=2)[source]
E (V/m) and H (A/m), each (nx, ny, nh, 3) complex, on the planes
`heights` (m) above the top of the stack, from the surface currents of each
layer sampled on the grid x, y (m, uniform): layers_J = {interface: (Jx,
Jy)}, each (nx, ny) (A/m; current_deposit). The FFT is periodic: the
currents are zero-padded to `pad` x the grid (a port's strong field
otherwise reappeared on the far side of a 10 mm margin) and the result
cropped back. One spectrum serves every height: a volume costs an inverse
FFT per height and component.

E: the plane-wave spectrum of the currents through the stack's TM / TE line
voltages to the top surface (as far_field), up by e^{-j kz h}; E_z from the
divergence. H: magnetostatic, each layer's current at its height and, over
the PEC ground, its image below it: A = mu0 J~ (e^{-k (z - z_k)} - e^{-k (z
+ z_k)}) / 2k, H = curl A / mu0. Exact for the near field (h well under
lambda / 2 pi; the dielectric does not change H there). H from E by
Faraday's law through the stack's spectral voltages was 15% low at 3 mm over
rf_gcpw at 0.1 to 5 GHz (Hy; Hz agreed), against Biot-Savart of the same
currents and their images (emsdev.numerics.biot), which this matches.
kicad2ems.mom25d.farfield.radiated(Eth, Eph, theta, phi, eta=np.float64(376.73031346177066))[source]
Radiation intensity U (W/sr, (nphi, ntheta)) and its integral over the
grid (the upper hemisphere when theta spans 0..90 and phi 0..360 deg).