kicad2ems.fem.palace.config

The Palace config of a model (model.Model): a driven (frequency-domain) run over
the band, every port excited in turn, Palace's adaptive frequency sweep (a
reduced-order model fitted to a few full solves) over the run's points.

    cfg = config(mdl, freq, order=2, tol=1e-3)  # dict, written as JSON
    cfg = config(mdl, ffr, tol=0, excite=[0], farfield=angles, out='postpro_ff')
        # an antenna's far field
    cfg = config(mdl, freq, box='pec')  # the board in a metal can: the air
                                        # box's faces PEC
    cfg = eigen(mdl, n=4, target=4e9, box='pec')  # its resonances above 4 GHz,
                                                  # each one's Q (R-E19)

The model's lumped parts are Palace lumped ports that are never excited: a
boundary with the part's R, L or C. In an eigenmode run the ports are their
resistors too, so each mode's Q is the loaded one (the ports' share in
port-Q.csv), with the dielectric's tan d, the copper's loss (loss=True) and, in
an open box, what radiates.
kicad2ems.fem.palace.config.config(mdl, freq, order=2, tol=0.001, out='postpro', verbose=2, max_samples=40, loss=False, sigma=58000000.0, plating=0.025, excite=None, farfield=None, amr=0, amr_tol=0.01, box='absorbing', amr_max=0, abc=1)[source]
loss: the copper as Palace's finite-thickness conductivity boundary (each
layer's sheets their thickness, two-sided; the via walls one-sided, the
plating thick; the drawn metal's faces one-sided, the surface impedance)
instead of PEC. Against FastHenry's volume filaments on a 20
x 10 mm strip loop this gave R within 1% at 1 MHz, 5% at 10 MHz and 30% high
at 100 MHz (a zero-thickness sheet's edge current is singular; its loss
grows with the mesh): fine below ~10 MHz, and for L throughout.

excite: the ports driven (0-based, board order), each in its own solve;
default all, the whole S matrix. farfield: (n, 2) angles (theta, phi in
degrees) at which Palace writes the far field r E of each solve, from the
fields on the air box's faces (farfield-rE.csv). amr: passes of Palace's
adaptive mesh refinement (its Model.Refinement: the cells where its error
estimate is largest split, until the estimate is below amr_tol; 0: none;
R-E3: it had never been used); amr_max: the unknowns past which it refines
no further (0: no limit). box: the air box's faces, 'absorbing' (the board
in free space) or 'pec' (a closed metal can, the model's margin its distance
from the board on every side). abc: the absorbing boundary's order, 1 or 2
(R-E20: the second takes the curvature of the field on the faces too).
kicad2ems.fem.palace.config.eigen(mdl, n, target, order=2, out='postpro_eig', verbose=2, loss=False, sigma=58000000.0, plating=0.025, box='pec', tol=1e-06, amr=0, amr_tol=0.01, amr_max=0)[source]
The Palace config of an eigenmode run (R-E19): the model's n resonances
above `target` Hz, each one's complex frequency and Q (eig.csv) and the
ports' share of its loss (port-Q.csv, the ports as their resistors). box as
config's: 'pec' a can's cavity modes, 'absorbing' the open board's (its
radiation then in Q; the boundary first order). amr, amr_tol, amr_max as
config's: the mesh refined on the modes' error.