Reduced multiport model and load optimisation#
Draft Written from harmolab/optim/ (ports.py, reduced_model.py, farfield.py, objectives.py, inner.py, outer.py, loss_model.py, components.py, matching.py) and harmolab/optim/README.md at commit 5e8d892; the ports, moved from harmolab/optim/ports.py to harmolab/utils/ports/, updated at commit 72fb8c6. Awaiting review.
When the geometry is fixed and only the loads change (parasitic elements closed on capacitors, inductors, PIN diodes or varactors), the full MoM system does not need to be solved again for each choice of loads. It can be reduced exactly to its ports, after which every new set of loads costs a few operations on matrices of the size of the number of ports.
The idea#
A MoM solve costs \(O(N^2)\) to fill \(Z\) and \(O(N^3)\) to factorise it, with \(N\) in the hundreds or thousands. A load connected across a small gap only touches the few edges of that gap. If the response of the structure to a unit voltage at each gap is computed once, the response to any combination of generators and loads at those gaps follows from circuit theory on a \(P\)-port, with \(P\) of the order of ten. Nothing is approximated: the reduced model gives the same currents as the full solve.
Ports as cuts#
A port \(p\) is a cut across a conductor: a set \(S_p\) of RWG edges lying on one line across a strip, and a unit vector \(\mathbf u_p\) giving the positive direction of the current across the cut. Its incidence vector \(\mathbf a_p \in \mathbb R^N\) is
An RWG function carries the current \(\ell_n I_n\) across its edge, from \(T_n^+\) to \(T_n^-\) (RWG basis functions), so the current across the cut is \(i_p = \mathbf a_p^\mathsf T I\). A delta-gap voltage \(v_p\) across the cut, tested with \(\mathbf f_m\), gives \(V_m = s_m\ell_m v_p\), the gap source of Makarov[1] extended to several edges and either orientation. With the \(P\) ports side by side in \(A = [\mathbf a_1 \cdots \mathbf a_P]\) (\(N\times P\)):
These ports use this delta gap on a line of edges (the DeltaGapCut model of Ports, where
\(\mathbf a_p\) is written \(\mathbf b_p\)), not the enhanced gap source of Excitations and input impedance.
Exact reduction#
With the conductor loss of Lossy conductors included, the system matrix is \(Z_t = Z + \alpha Z_s\mathsf G\). One LU factorisation of \(Z_t\) and \(P\) solves give
\(B\) (\(N\times P\)) holds the edge currents for 1 V at each port, the others short-circuited; \(Y\) (\(P\times P\)) is the port admittance matrix. It is symmetric because \(Z_t\) is.
Terminations. Each port is closed on a Thévenin source of emf \(e_p\) and internal impedance \(Z_{D,p}\); a passive load is \(e_p = 0\), \(Z_{D,p} = Z_{L,p}\). With \(Z_D = \mathrm{diag}(Z_{D,p})\), \(v = e - Z_D\,i\), and eliminating \(v\) without inverting \(Y\):
This is algebraically the same as solving the full system \((Z_t + A Z_D A^\mathsf T)\,I = A e\). A short circuit (\(Z_{D,p} = 0\)) is exact and equivalent to not declaring the port: an undeclared cut is continuous metal. An open circuit (\(i_p = 0\)) cannot be written in this form.
Powers, gain and their balance#
All the powers are quadratic forms in the port voltages, with \(P\times P\) matrices computed once:
\(P_\mathrm{rad}\) is Eq. (34) and \(P_\mathrm{cond}\) the loss of Eq. (31), both computed from the currents, not from a field integration. The power entering the driven ports must equal what is radiated, dissipated in the metal and dissipated in the loads:
Far field. A quantity linear in the currents, \(q = \mathbf c^\mathsf T I\), becomes \(q = \mathbf h^\mathsf T v\) with \(\mathbf h = B^\mathsf T\mathbf c\). One far-field component \(N_\phi(\theta, \phi)\) of Eq. (32) is such a quantity, so the intensity \(U\) in a given direction also costs \(O(P)\) per set of loads. Then, with the definitions of Radiated fields, directivity and gain:
the last form for a single driven port with a real generator impedance. \(G\) is the gain behind an ideal, lossless matching network; \(G_\mathrm r\) the realised gain on the bare generator.
A bound for the geometry. With reactive loads, \(P_\mathrm{in} = P_\mathrm{rad} + P_\mathrm{cond} = I^\mathsf H M I\) with \(M = \tfrac12\big(R + \mathrm{Re}(\alpha Z_s)\mathsf G\big)\), and \(U = \frac{k^2\eta_0}{32\pi^2}|\mathbf a^\mathsf H I|^2\) for the far-field vector \(\mathbf a\) of the chosen direction and component. The Cauchy–Schwarz inequality in the \(M\) inner product then bounds the gain of any current the geometry can carry, whatever feeds and loads produce it:
\(M\) is positive definite only with conductor loss. Without it, \(M = R/2\) is close to singular for a small antenna and the bound is not meaningful.
In this solver#
Theory vs. implementation
Everything on this page is in harmolab/optim/, except the ports, which come from harmolab.utils.ports
and are the same as those of radiation_algorithm (Ports). The rest is separate from the
radiation_algorithm path: its own reduction, exact powers.
Module, object |
Role |
|---|---|
|
Eq. (46): a port from all the edges on a segment, or from one edge (the edge
|
|
Eq. (48): assembles \(Z\) (and \(\mathsf G\), \(Z_s\) if a |
|
Eq. (49) and Eq. (50): |
|
\(\mathbf h = B^\mathsf T\mathbf c\) for a far-field component |
|
|
|
best reactances \(jX_p\) of the loaded ports for \(G\) or \(G_\mathrm r\) in one direction: Latin hypercube starts, then L-BFGS-B on \(-\log G\), one BLAS thread |
|
geometry optimisation by Gaussian-process regression and expected improvement, with a reparametrisation of \(K\)-strip arrays that makes every point of the box a valid geometry |
|
an empirical \(\alpha\) for one meshing rule (see below) |
|
catalogue capacitors and inductors with their parasitics, snapping of the optimal reactances to catalogue parts, and lumped matching networks evaluated over the part tolerances |
|
structured meshes built without Gmsh (strip dipole, square loop, parallel strips, \(K\)-strip arrays) on which every grid line is a line of edges, so port cuts fall on RWG edges |
The factor \(\alpha\) (zs_scale, default 1.0) is the open question of Lossy conductors.
loss_model provides an empirical value for one meshing rule (4 cells across each strip, cosine
grading towards the edges): \(\alpha\) calibrated against CST on a tuned loop, from 0.71 to 1.09 for
strip widths of 1 to 4 mm, copper 35 µm thick, about 0.9 GHz, with an uncertainty of ±15 %. Its
docstring explains why no mesh-independent value exists: on a zero-thickness sheet the current is
singular at the strip edges and the computed loss keeps growing as the edge cells shrink. Outside
that domain alpha_calibrated raises an error rather than extrapolate.
Dependencies. outer.BayesianOptimizer imports scikit-learn (listed in requirements.txt); the
rest of harmolab/optim/ needs only NumPy and SciPy (threadpoolctl is optional).
A check: one parasite, one load#
Two parallel copper strips, 140 mm × 2 mm, 30 mm apart, at 1 GHz (396 RWG edges): one fed by a 1 V, 50 Ω generator, the other closed on a reactance \(jX\). The reduced model sweeps \(X\); nine full solves of \((Z_t + A Z_D A^\mathsf T) I = A e\), read with the exact far field, check it.
Figure 14 (a) Gain \(G_\phi\) towards the parasite (\(+y\)) and towards the fed strip (\(-y\)) against the load
reactance, from 801 solves of the reduced model; circles: full MoM solves; star: optimum found by
optimize_loads for \(+y\), \(X\) = −11.5 Ω (13.84 pF), \(G\) = 7.09 dBi; dashed: bound \(G_\mathrm{max}\) =
8.21 dBi of Eq. (53). (b) Relative difference between the reduced model and the full solve
(gains, and \(P_\mathrm{rad}\) from \(v^\mathsf H M_\mathrm{rad} v\) against the far-field sphere
integral), and residual of the power balance Eq. (51).
Generated by documentation/figure_notebooks/theory_reduced_multiport.ipynb on solver commit 5e8d892; all values in reduced_multiport.json. Click to enlarge.#
The reduction is exact: gains differ from the full solve by at most \(1.1\times10^{-13}\), and the radiated power of the reduced model (\(v^\mathsf H M_\mathrm{rad} v\), from \(\mathrm{Re}\,Z\)) matches the far-field sphere integral of the full-solve currents to \(4\times10^{-14}\).
The balance closes: Eq. (51) holds to \(1.1\times10^{-14}\) of \(P_\mathrm{in}\) for every load.
The cost: on the machine used, the \(Z\) fill took 12 s (GPU) and the LU 0.18 s, once. After that, one load value took 69 µs on the reduced model, against 117 ms for a full solve with the same far-field evaluation, about 1700 times more.
The optimum: with \(X\) = −11.5 Ω the parasite acts as a director (the beam points towards it). \(G\) = 7.09 dBi with \(\eta_\mathrm{rad}\) = 0.963, a front-to-back ratio of 7.3 dB, and \(Z_\mathrm{in}\) = 14.2 − 20.6j Ω. On the bare 50 Ω generator the realised gain is 5.05 dBi. The search took 135 evaluations; \(G/G_\mathrm{max}\) = 0.77: with one parasite and one load, the geometry is not used to its bound.
Assumptions and limits#
These are stated in harmolab/optim/README.md and the module docstrings:
No open circuit at a port. To model an open gap, cut it in the mesh, or use a large finite impedance.
\(\alpha\) is not settled in general; the calibrated value applies only to its meshing rule and its domain.
Free space only: no substrate, no ground plane unless meshed.
One frequency per instance. The constructor takes assembled matrices so that a sweep can build one instance per frequency from
calculate_z_matrice_sweep; no such sweep class exists yet.\(Y\) is exactly symmetric because \(Z\) is assembled with
fill_mode="full_sym"; the reciprocity error of the underlying integrals, measured with a full unsymmetrised fill, is about \(10^{-4}\) (test_admittance_symmetry).
Tests: python -m pytest test/optim -v -s. The meshes are built inside the tests, with neither
.mat files nor Gmsh. The comparisons with CST are scripts and notebooks in
harmolab/antenna_simulation/euraap_challenge/.
Continue#
\(P_\mathrm{rad}\), directivity and gain
Accuracy, mesh density, conditioning
What is validated, and how