kicad2ems.core.lines.mqs¶
The per-unit-length R(f), L(f), G(f) and C(f) of an N-conductor cross-section
(xsection.CrossSection): the series impedance from a 2D magnetoquasistatic
(eddy-current) solve with the copper meshed inside, so R and L have the skin
effect, the proximity effect between neighbours and the return current's own
crowding in the planes and the coplanar ground; G and C from xsection's
electrostatic solve.
xs = X.coupled_microstrip(0.15, 0.15, 0.2, 4.3, t=0.035)
r = rlgc(xs, [0, 1e6, 1e8, 1e9, 1e10]) # RLGC: f, R, L, G, C (per metre)
r.R[-1] # (N, N) ohm/m at 10 GHz
r.L_inf # mu0 eps0 C_air^-1, H/m
The field is A_z(x, z), the magnetic vector potential along the lines:
-div(grad A / mu0) = J, J = sigma (E_g - j w A) in conductor g
E_g, the field along conductor g (its voltage drop per metre), is one number
per conductor: each signal conductor's own, and one for all the ground copper
together (the planes, coplanar ground, other layers' copper: one net, joined at
the line's ends). Each conductor's total current is imposed, I_g = int sigma
(E_g - j w A) dS: the solve gives E for given I (the current-driven form), and
Z, the N x N series impedance with the ground as the return, is
-dV_k/dl = E_k - E_ground = sum_j Z_kj I_j, Z = R + j w L.
Bilinear rectangles (xsection's elements and hanging-node reduction) on a mesh
of its own: every face of the copper is a key line, and cells inside the
copper are halved across a face until they are SKIN_CELL skin depths thick at
it (at the highest frequency asked), growing by SKIN_GROW per unit of distance
from it, along the face as across it (a face's current changes along it on the
scale of the distance to the nearest edge); in the air, cells grow from the
copper's corners as xsection's do. One mesh for every frequency: K + j w M
factored at each (complex symmetric with a positive definite real part, so no
pivoting; the frequencies on THREADS threads), the conductors' constraint
closed in an (N+1) x (N+1) system. At DC the current is uniform in each
conductor: R from the areas, L from one magnetostatic solve.
rlgc()'s L is xsection's L_inf (mu0 eps0 C_air^-1, extrapolated from two meshes
as its C is) plus the internal inductance, this solve's L(f) less its own
perfect-conductor limit on the same mesh (pec_inductance): the two share their
air mesh's error, so the difference converges on a mesh that is coarse in the
air, and the lossless line's Z0 and delay are the field solver's.
The geometry: a plane of the CrossSection (a full-width sheet at a height,
its face to the lines) is copper `plane_t` mm thick behind that face, across
the box; a conductor of zero thickness (another layer's copper as a sheet, a
strip given as a sheet) gets `sheet_t` mm, grown away from the signal strips.
Copper beyond the nearest plane below and above the signal strips is left out
(the planes shield it from the lines at any frequency where their thickness is
a few skin depths; below that, its share of the return is that of its
resistance, and the planes' own resistance across the box's width is already
small). The box reaches REACH x the copper's size beyond it on every side, A =
0 on its walls; a plane's current spreads over the box's width at DC, so the
lowest frequencies' L (below where the return gathers under the line, about
R / (2 pi L) of the plane: kHz on 35 um copper) is that of a plane as wide as
the box. mu = mu0 everywhere (no magnetic material).
Roughness (rough, um RMS): the conductivity at each frequency is sigma / K(f)^2
(core.roughness: Hammerstad's factor on the skin-effect loss), so the internal
inductance grows with the loss as a causal rough-surface model has it.
Units: mm for the geometry, SI for the results (per metre).
- class kicad2ems.core.lines.mqs.Copper(rects: ~numpy.ndarray, group: ~numpy.ndarray, box: tuple, notes: list = <factory>)[source]¶
The copper of an MQS solve: rectangles (n, 4: x0, x1, z0, z1, mm), the group of each (0 ground, k signal conductor k - 1, as the CrossSection numbers them), the box (xl, xr, zb, zt).
- class kicad2ems.core.lines.mqs.RLGC(f: ~numpy.ndarray, R: ~numpy.ndarray, L: ~numpy.ndarray, G: ~numpy.ndarray, C: ~numpy.ndarray, L_inf: ~numpy.ndarray, C_air: ~numpy.ndarray, nodes: int = 0, notes: list = <factory>)[source]¶
Per-unit-length matrices of N lines over frequency f (nf,): R, L, G, C (nf, N, N; ohm/m, H/m, S/m, F/m); L_inf = mu0 eps0 C_air^-1 (H/m, the external inductance the field solve gives); C_air; the MQS mesh's nodes.
- at(f)[source]¶
The RLGC interpolated to frequencies f: R and the internal inductance L - L_inf as log-log in f above the lowest nonzero frequency (R ~ sqrt(f) in the skin regime is a straight line there), linear below it; G linear in f, C linear (C(f) is constant unless a wideband dielectric made it otherwise).
- class kicad2ems.core.lines.mqs.System(K: object, M: object, B: ~numpy.ndarray, area: ~numpy.ndarray, free: ~numpy.ndarray, nodes: int, cells: int, Mg: list = <factory>, on: ~numpy.ndarray = None)[source]¶
The assembled MQS system on the independent nodes: K (stiffness / mu0), M (sigma-weighted mass, per S/m of sigma), B (n, G + 1: each group's int N_i dS, m^2), area (G + 1, m^2), the free nodes (not on the box).
- kicad2ems.core.lines.mqs.coax_copper(a, b, c, n=16, reach=0.25)[source]¶
The Copper of a coax (mm: the inner conductor's radius a, the outer's inner and outer radii b and c; c a multiple of a / n) as staircases of slabs a / n high, in a box reach x c beyond the tube (no field reaches it).
- kicad2ems.core.lines.mqs.geometry(xs, plane_t=0.035, sheet_t=0.035)[source]¶
The Copper of a CrossSection: its signal and ground conductors, its planes as copper plane_t thick behind their faces, zero-thickness conductors sheet_t thick (grown away from the signal strips), clipped to the box; copper beyond the planes nearest the signal strips left out. plane_t, sheet_t: mm, or {height: mm} (each plane's or sheet's layer, by the height the CrossSection has it at; 'default' for the rest).
- kicad2ems.core.lines.mqs.impedance(cu, f, sigma=58000000.0, rough=None, mesh_f=None, losses=False)[source]¶
(Z (nf, N, N) ohm/m, the mesh's free nodes) of Copper cu at frequencies f (Hz; at 0 its imaginary part is the DC inductance, H/m), on a mesh that resolves the skin at mesh_f (default: the highest of f); losses: ((Z, P), nodes), P each group's loss (series_z).
- kicad2ems.core.lines.mqs.mesh(cu, fmax, sigma=58000000.0, skin_cell=None, skin_grow=None, air_fine=None, air_grow=None)[source]¶
The cells (n, 4: x0, x1, z0, z1, mm) of an MQS solve to fmax (Hz; 0: DC alone) and the group of each (-1 air).
- kicad2ems.core.lines.mqs.mirrored(xs)[source]¶
xs mirrored in x (each conductor kept in its place in the list, so a line is the same line): its RLGC is xs's, exactly (the mesh mirrors too).
- kicad2ems.core.lines.mqs.pec_inductance(sysm)[source]¶
The N x N inductance (H/m) of the System's copper as perfect conductors (A one value over each, the field in the air alone), on its mesh: the high-frequency limit its eddy-current solve tends to, whose own discretisation error in the air the internal inductance L(f) - this leaves out.
- kicad2ems.core.lines.mqs.rlgc(xs, f, sigma=58000000.0, plane_t=0.035, sheet_t=0.035, rough=None, wideband=None, mesh_f=None, es=None)[source]¶
The RLGC of a CrossSection at frequencies f (Hz, 0 for DC). sigma: the copper's conductivity (S/m); plane_t, sheet_t: the planes' and sheets' copper (mm); rough: um RMS (core.roughness); wideband: fref (Hz) for each dielectric's Djordjevic-Sarkar curve through its er and tan d there (C and G solved at each frequency's materials), None: constant er and tan d; mesh_f: the frequency the mesh resolves the skin at (default: the highest asked); es: xsection's Result of xs, where already solved. L is xsection's L_inf = mu0 eps0 C_air^-1 (extrapolated from two meshes, as its C is: the lossless line's Z0 and delay are the field solver's) plus the internal inductance, the eddy-current solve's L(f) less its own perfect-conductor limit on the same mesh (pec_inductance): their air meshes' error cancels, so it needs no fine air mesh.
- kicad2ems.core.lines.mqs.section_key(xs, *extra)[source]¶
A key for an RLGC solve of xs (and its settings, extra) that it and its mirror image share.
- kicad2ems.core.lines.mqs.section_of(e)[source]¶
(CrossSection, copper thickness mm) of a line model's section (an Element): its board's cut where the line model took one, the grounded CPW it was classified as, else its classification over ideal planes; None where it has none (no reference copper).
- kicad2ems.core.lines.mqs.series_z(sysm, f, sigma=58000000.0, rough=None, losses=False)[source]¶
Z (nf, N, N), ohm/m, of the assembled System at frequencies f (Hz; 0: DC: its real part the DC resistance, its imaginary part the DC inductance, H/m). losses: also P (nf, N, G), the loss per metre in each group (ground first) with 1 A in signal conductor j and its return in the ground (W/m, peak phasors: sum_g P[:, j, g] = R_jj). Each frequency is a factorisation of its own, on threads (threads(): SuperLU lets go of the interpreter).
- kicad2ems.core.lines.mqs.skin_depth(f, sigma=58000000.0)[source]¶
The skin depth (m) at f (Hz) in copper of conductivity sigma.
- kicad2ems.core.lines.mqs.staircase(r_in, r_out, h)[source]¶
A round conductor (r_in 0) or a tube between radii r_in and r_out (mm), centred at the origin, as rectangles in slabs h high (r_out a multiple of h, so that shapes of one h share their slabs' lines), each as much copper as the shape has in its slab: [(x0, x1, z0, z1)] (the MQS solve's Copper takes touching rectangles of one group; xsection's electrostatic solve does not).
- kicad2ems.core.lines.mqs.threads(n)[source]¶
The threads a sweep of n frequencies is solved on: THREADS, else one per performance core (emsdev.cpu.core_threads), at most n.
- kicad2ems.core.lines.mqs.tube_internal_z(f, b, c, sigma=58000000.0)[source]¶
The internal impedance per metre of a coax's outer conductor, a tube of inner radius b and outer c (m), carrying the return with the field inside it: (k / (2 pi b sigma)) (I0(kb) K1(kc) + K0(kb) I1(kc)) / (I1(kc) K1(kb) - I1(kb) K1(kc)); its DC limit 1 / (pi (c^2 - b^2) sigma).