kicad2ems.core.solvers.lines.fastsolve

Fast S-parameters from the transmission-line sections (tlines.LineModel): the
sections become a circuit - lines, via barrels, lumped parts, ports at the port
nodes, open ends left open - solved in milliseconds by scikit-rf (in-process) or
qucsator (Qucs-S's simulator, run as a separate program).

Each backend uses its own models where it has them: scikit-rf MLine
(Hammerstad-Jensen with Kirschning-Jansen dispersion) and CPW, qucsator MLIN and
CLIN; every other section (stripline, offset stripline, embedded microstrip, via
barrels, and any section the field solver solved: Element.field) is a line of
the section's Z0 and effective permittivity. By default the copper is
zero-thickness, as openEMS models it (conducting sheets), so the result is
comparable with openEMS; sheet=False uses the stackup's copper thickness.

    S, names = solve(line_model, model.ports, freq, backend='skrf')
        # S (nf, n, n), single-ended

A ballpark: no coupling between sections, no radiation, no plane resonances,
quasi-static impedances.

With --sigma, each trace section's and coupled section's conductor loss comes
from its own cross-section (field_losses: lines.mqs, a 2D eddy-current solve,
R(f) and the internal inductance with the skin and proximity effect), each
distinct cross-section solved once at a few frequencies across the band and
interpolated, when the model has at most FIELD_LOSS_MAX of them; with more, or
FIELD_LOSS off, the formulas' (microstrip and grounded CPW by scikit-rf's
media, Hammerstad and Jensen's; the rest 2 Rs / w). qucsator keeps its own
microstrip models' (MLIN, MCOUPLED, CLIN), the rest at the band centre.
kicad2ems.core.solvers.lines.fastsolve.bend_reach(j)[source]
How far a corner's square reaches along each of its two arms (mm): half
the other arm's width (a 90 deg corner, qucsator's MCORN); a bend of another
angle none (its capacitance alone, at the vertex).
kicad2ems.core.solvers.lines.fastsolve.conductor_r(w_mm, t_mm, f, sigma)[source]
A line's series resistance per metre at f: the strip's surface resistance
over its width (its DC sheet resistance where the skin is deeper than the
copper) and its return's, about as much (2 Rs / w, as dfsynth's
multiconductor model has it). A first cut: --sigma had reached only
microstrip sections, and a stripline, a field-solved section or a coupled
one was lossless whatever it said.
kicad2ems.core.solvers.lines.fastsolve.discontinuity_c(j, sheet=True)[source]
The excess capacitance (F) a line-model junction j adds at its node, for
the backends without models of their own: a microstrip's open end
(Kirschning, Jansen and Koster's length extension), a width step (Edwards'),
a corner or another bend (Gupta, Garg and Bahl's, scaled by the corner's
area): its extension's length of line capacitance, C' = sqrt(eeff) / (c Z0).
None for any other junction, or one off a microstrip.
kicad2ems.core.solvers.lines.fastsolve.field_losses(lm, freq, sigma, info=None)[source]
{id(element) or ('g', group index): (R, L_int)}, each (nf, N, N) at
freq (ohm/m, H/m): the trace sections' and coupled sections' resistance
and internal inductance from their cross-sections (lines.mqs.rlgc; the
board's cut where the line model took one, else as classified), each
distinct one solved once (cached across calls) at loss_frequencies and
interpolated. {} without sigma, with FIELD_LOSS off or more than
FIELD_LOSS_MAX distinct cross-sections; info['loss'] says which.
kicad2ems.core.solvers.lines.fastsolve.find_qucsator(path=None)[source]
The qucsator executable: the given path, else the one the installer
recorded (sitecfg), else qucsator_rf (Qucs-S) or qucsator on PATH, else
(Windows) the one in Qucs-S's install folder.
kicad2ems.core.solvers.lines.fastsolve.group_s(g, freq, sigma=None, loss=None)[source]
S-parameters (nf, 2N, 2N) of a coupled section of the line model
(coupled.py); sigma: its copper's loss, as 2 Rs / w on each line; loss:
(R, L_int) (nf, N, N) of its cross-section (field_losses) in its place,
every line's on every other's.
kicad2ems.core.solvers.lines.fastsolve.junction_cuts(j)[source]
How far each arm of a junction of three or more arms (a tee, a cross,
five or more) starts from its node (mm), for the backends without a model of
it: the widest straight run through it (two arms facing each other) runs on
uncut, its centre line the junction's; every other arm starts at that run's
edge, half its width out (its centre line had reached the node across the
run's copper). With no straight run, each arm starts at the widest arm
across it, half that width out. [cut per arm, in j['arms']'s order].
kicad2ems.core.solvers.lines.fastsolve.loss_frequencies(freq)[source]
DC and LOSS_PER_DECADE points a decade from the band's lowest
frequency (at least its top / LOSS_SPAN) to its top: where field_losses
solves a cross-section (between them it interpolates, R as log-log).
kicad2ems.core.solvers.lines.fastsolve.mode_tand(e)[source]
The loss tangent of a section's mode, for a model of it as one effective
medium (eeff, Z0): the field solver's (G / w C) where it solved it, else the
substrate's scaled by its filling factor on a microstrip-like section (the
substrate's own, taken whole, had been ~15 % high on a plain microstrip).
kicad2ems.core.solvers.lines.fastsolve.part_impedance(part, w)[source]
Impedance of a lumped part over angular frequencies w: R + jwL + 1/(jwC)
of the values it has (series R-L-C; a single R, L or C alone).
kicad2ems.core.solvers.lines.fastsolve.qucs_netlist(lm, ports, freq, sheet=True, sigma=None, workdir=None, loss=None)[source]
The line model as a qucsator netlist (S-parameter sweep over freq).
Microstrip lines, corners, steps, tees, crosses, open ends, end gaps and
vias to ground use qucsator's microstrip models (MLIN, MCORN, MSTEP, MTEE,
MCROSS, MOPEN, MGAP, MVIA; a radial stub MRSTUB), grounded CPW its coplanar
ones (CLIN, CSTEP, COPEN, CGAP), a coupled microstrip pair MCOUPLED; three
or more coupled lines, a pair of unequal widths or coupled striplines are a
multiconductor block (coupled.py) written to `workdir` as Touchstone and
read with SPfile.
kicad2ems.core.solvers.lines.fastsolve.read_qucs_dataset(text, n)[source]
S (nf, n, n) from a qucsator dataset.
kicad2ems.core.solvers.lines.fastsolve.resolve_backend(backend='auto', qucsator=None)[source]
(backend, what runs it) for a line-model solve: 'auto' is qucsator when
it is installed (its coupled-line and discontinuity models), else scikit-rf.
ValueError, saying how to fix it, when the backend cannot run.
kicad2ems.core.solvers.lines.fastsolve.solve(lm, ports, freq, backend='skrf', sheet=True, sigma=None, qucsator=None, wideband=None, info=None)[source]
S-parameters (nf, n, n) over `ports` (model.ports order; NaN for ports
without a line model) and the backend's run time in seconds. backend 'auto':
see resolve_backend. wideband: the frequency (Hz) the stackup's er and tan d
hold at for the Djordjevic-Sarkar dielectric (a named laminate's layer at
its own), or None (constant er and tan d); the solves at the materials'
frequencies go in info['held'] (Hz), when given.