Excitations and input impedance#
Draft Written from harmolab/utils/ports/enhanced_gap.py, harmolab/utils/ports/core.py, harmolab/rwg/rwg4.py, harmolab/rwg/rwg3.py and harmolab/utils/mesh/gmsh_function.py at commit 72fb8c6. Awaiting review.
The right-hand side \(V\) of \(Z\,I = V\) is the incident field tested by the RWG functions, \(V_m = \int_S \mathbf f_m\cdot\mathbf E^i\,dS\) (Eq. (14)). This page describes the field model of the enhanced gap source, how the input impedance and power of a port are read from the solution, the incident plane wave, and lumped loads that modify \(Z\). The ports themselves (the three port models and their common framework) are on Ports.
The idea#
A real antenna is fed by a transmission line connected across a small gap. The MoM model replaces the line by a voltage imposed across that gap: a strong field confined to a narrow band of the surface. Everything that follows (input impedance, reflection, efficiency) depends on how that band is modelled, so the feed model matters as much as the impedance matrix for port quantities, while the radiation pattern is much less sensitive to it [1].
The gap source#
Model#
The solver implements the enhanced gap source of Ding et al.[1]. Instead of a delta function on a single “feeding edge” (the model of Makarov[2], which ignores the gap width and makes the result depend on which edge is chosen), the impressed field is uniform over a gap of width \(W\) along the feed direction \(\hat{\mathbf e}\):
and every RWG function with a triangle in the gap is fed, not only one. Testing Eq. (21) with \(\mathbf f_m\) and one point per triangle (the centroid) gives eq. (7) of the paper:
where \(\chi_m^\pm = 1\) if the centroid of \(T_m^\pm\) is in the gap and 0 otherwise, and \(\boldsymbol\rho_m^{c\pm}\) are the centroid vectors of RWG basis functions. Several ports can be fed together, each with its own complex voltage: their contributions to \(V\) add up (Ports).
Triangles cut by the gap: exact integration#
Eq. (22) counts a triangle entirely or not at all, according to where its centroid falls. That is exact when the edges of the gap are lines of the mesh, as on the meshes of the paper, where the gap is meshed on purpose. A mesher such as gmsh usually lets the gap edges cut through triangles; each of them is then fed in full or not at all, and the voltage actually applied jumps from one mesh to the next.
The solver integrates Eq. (21) exactly instead. \(\mathbf f_m\) is linear on a triangle and \(\mathbf E^i\) is constant in the gap, so the integral over the part of \(T_m^\pm\) inside the gap, of area \(A_m^{\pm,\mathrm{in}}\) and centroid \(\mathbf r_m^{\pm,\mathrm{in}}\), is exact with that one point:
The 0-or-1 of \(\chi_m^\pm\) becomes the fraction of the triangle that lies in the gap, and \(\boldsymbol\rho\) is taken at the centroid of that fraction. For a triangle entirely in the gap the fraction is 1 and the two centroids coincide: this is exactly Eq. (22).
What it changes, in short: the voltage applied by the gap no longer depends on where the mesh happens to cut the gap. When every triangle of the gap lies wholly inside the window (gap edges on mesh lines, and a window that spans the conductor across) nothing changes; otherwise the input impedance stops jumping from one mesh to the next and converges as the mesh is refined (a gmsh dipole whose gap edges cut through triangles gave 80, 182, 77 and 63 Ω at λ/20, λ/30, λ/60 and λ/120 with the former rule; it gives 71.4, 71.8, 72.7 and 73.0 Ω, against 71.6, 71.9, 72.7 and 73.0 Ω with the gap drawn as its own surface, see Choosing the mesh size).
The enhanced gap of the solver (EnhancedGap, placed by ports.enhanced_gap_port) always uses
Eq. (23), since commit 52b5eb6. The one-point rule Eq. (22) was removed with
multiple_gap_sources; the documentation notebooks re-implement it only to show the difference.
test/test_gap_source_partial.py checks Eq. (23) against an independent Monte-Carlo
integration of Eq. (21).
The window: a cube, not a band#
In the paper, “in the gap” means a band \(|z - z_\mathrm{feed}| \le W/2\) along the feed direction, across the whole conductor. The solver uses a cube of side \(W\) centred on the feed point: the part of a triangle that is in the gap is the part within \(W/2\) of the feed point on all three coordinates.
This was a deliberate change, documented in the code and pinned by test/test_gap_source.py. At a
junction between surfaces, such as a monopole standing on a ground plate, the band also catches distant
triangles that merely share the feed coordinate: on one monopole mesh it excited 198 of 296 edges,
most of the ground plate. The cube keeps the feed local.
The price is the opposite case: on a conductor wider than \(W\), the cube covers only the middle of
the gap (Figure 7), and only that part is fed. Cells near the edges of the conductor
are not fed at all, and a cell that spans the whole width is fed in proportion to its part inside the
cube. Either way the applied voltage, and the input impedance, are wrong: on a 40 mm strip with a
30 mm gap, the input resistance goes from 140 Ω to 1.2 Ω as the strip is divided into 1 to 8 cells
across (Choosing the mesh size, Figure 10). enhanced_gap_port emits a
GapSourceWarning in that case: a triangle of the gap that reaches beyond the cube across the
conductor, on a surface containing the feed direction, next to a fed triangle. Surfaces perpendicular
to the feed direction, such as the ground plate under a monopole, are not flagged. GapSourceError
is raised only when no part of any triangle is in the cube.
Figure 7 The gap of a 5 cm strip, \(W\) = 25 mm, with one cell across the width (44 triangles). Light band: the
gap as defined by Ding et al.; dashed square: the window of the solver, half as wide as the strip;
shaded: the part of the triangles inside it, the only part that is fed. The five RWG edges of the gap
get \(V_m\) = +4.6, −3.5, +9.1, −3.5, +4.6 mV for \(V\) = 1 V (the sign of the diagonals follows their
orientation), and GapSourceWarning is emitted. The
two long diagonals marked +0.0 belong to triangles that only touch the window (a rounding-size
fraction, see Ports).
Generated by documentation/figure_notebooks/theory_excitations.ipynb on solver commit 72fb8c6. Click to enlarge.#
Choosing the gap width#
gmsh_function.mesh_and_gap_parameters(frequency, resolution=20, gap_fraction=0.15, n_edges_min=3)
proposes a mesh size and a gap width together: \(W\) = gap_fraction × λ, a cell size of λ/resolution,
reduced if needed so that at least n_edges_min cells fit in the gap. Its docstring gives the
reasoning: keeping \(W\) a fixed fraction of the wavelength, rather than tying it to the mesh, lets the
input impedance converge as the mesh is refined. It warns when the cell falls below λ/100 or when
\(W\) exceeds 0.2 λ.
Input impedance and power of a port#
The complex power delivered by a gap, summed over the fed edges of its port, defines an input impedance:
This is the impedance that, driven by \(V\), absorbs the same complex power; it was the definition of
the former rwg4.compute_port_results. The solver now computes, for every port model,
\(Z_\mathrm{in} = v/i\) with the port current \(i = \mathbf b^\mathsf T I\) (ports.port_results), and
the two are the same number, because the excitation of a port is a real vector times its voltage
(Ports, Eq. (26)). Both are consistent with the energy balance
\(P_\mathrm{in} = \tfrac12\mathrm{Re}\{V^\mathsf T I^*\}\) used for the efficiency.
The paper defines it differently, from the current across one edge of the gap: \(Z = V/(I_m\ell_m)\), its eq. (9). The two coincide when the gap model is admissible in the sense of the paper: the same current crosses every edge of the gap. On the validation case below, with the gap at least as wide as the strip, the current varies by 1.5 % to 2 % across the gap and the two definitions differ by less than 1 Ω.
The multi-port excitation (several gaps fed together) has a known open issue: the radiated power does not balance the input power (see Feature status). The paper treats a single gap; whether the gaps involved satisfy the admissible condition is one of the things to check.
Validation: the thin strip of Ding et al.#
Ding et al.[1] give the input impedance of a centre-fed strip (75 MHz, 2 m × 5 cm) for five gap widths and four or five mesh densities (their Table I). The solver was run on the same case with a structured mesh built to match their description: one cell across the width, the gap meshed with the 5 RWG edges of their Fig. 1, identical segments elsewhere, the same triangle counts.
Figure 8 Input impedance of the strip against the number of triangles. Solid lines: solver,
\(Z_\mathrm{in} = v/\mathbf b^\mathsf T I\) as radiation_algorithm gives it (equal to
Eq. (24)); dashed: the same solution read with the paper’s eq. (9); open squares: Ding et
al., Table I, new model. On the finest mesh (164 triangles) the solver gives 89.3 + 48.3j and
90.4 + 47.3j Ω for \(W\) = 100 and 50 mm, against 90 + 48j and 92 + 47j Ω. On the coarsest mesh the
reactance is 5 to 6 Ω above the published values. For \(W\) = 25, 12.5 and 6.25 mm, narrower than the
strip, the solver warns (GapSourceWarning) and its values are far off this scale (see below): only
the publication’s squares are drawn.
Generated by documentation/figure_notebooks/theory_excitations.ipynb on solver commit 72fb8c6; all values in excitations.json. Click to enlarge.#
The meshes are of the same kind but not identical (the paper does not give them in full), so an agreement within 1–2 Ω on the fine meshes is what can be expected.
Gaps narrower than the strip. With one cell across the 5 cm strip, the triangles of the gap span
its whole width, and the cube of side \(W < 5\) cm holds only the fraction \(W/w\) of each of them. The
excitation is reduced in that proportion, the current too, and \(Z_\mathrm{in} = v/\mathbf b^\mathsf T I\)
grows as \((w/W)^2\): on 164 triangles, 365.4 + 186.6j, 1474.0 + 736.8j and 5935.4 + 2916.6j Ω for
\(W\) = 25, 12.5 and 6.25 mm, about 4, 16 and 64 times the published values (eq. (9) grows as \(w/W\)).
Before the exact integration (commit 52b5eb6), the one-point rule fed these triangles entirely when
their centroids, at \(|y|\) = 8.3 mm, were inside the cube: the 25 mm gap then gave 91.4 + 46.6j Ω, an
agreement due to the coarse rule, and the narrower gaps raised GapSourceError. The paper’s window is
a band across the conductor, which the solver’s cube reproduces only when \(W\) is at least the width of
the conductor (Feature status).
Plane-wave excitation#
For scattering, rwg4.calculate_current_scattering uses the incident plane wave
\(\mathbf E^i = \mathbf E_0\,e^{-jk\hat{\mathbf k}\cdot\mathbf r}\) with the centroid rule
Eq. (16). wave_incident_direction is \(\hat{\mathbf k}\) and polarization is
\(\mathbf E_0\) (its magnitude is the amplitude in V/m). Neither is normalised by the code: pass a unit
direction and a polarisation perpendicular to it.
Lumped loads#
rwg3.calculate_z_matrice_lumped_elements(..., LoadPoint, LoadValue, LoadDir) places series R, L, C
loads. For each load:
the impedance is \(\Delta Z = j\omega L + 1/(j\omega C) + R\) (
compute_lumped_impedance). A valueNoneor 0 for \(L\) or \(R\) means absent;Nonefor \(C\) means no capacitor (it is replaced by \(10^{64}\) F, a short circuit); \(C = 0\) is refused;the loaded edge is the edge closest to
LoadPointwhose direction is perpendicular toLoadDir(tolerance \(10^{-3}\) on \(|\hat{\mathbf u}_\mathrm{edge}\cdot\hat{\mathbf d}|\)), so that the load current flows alongLoadDir;the load is added to the diagonal: \(Z_{mm} \leftarrow Z_{mm} + \ell_m^2\,\Delta Z\).
A load therefore sits on one RWG edge, the edge a DeltaGapEdge port given the same point and
direction would feed. On a conductor several cells wide, a load across the whole width needs one load
per edge, or a port across the whole cut (DeltaGapCut, the model of the reduced multiport, see
Ports and Reduced multiport model and load optimisation).
In this solver#
Theory vs. implementation
Where each excitation lives, and its parameters.
Function |
Role |
|---|---|
|
the specification of an enhanced gap, placed on the mesh by the solvers |
|
Eq. (23) for \(V = 1\): the vector \(\mathbf b\) of the port; raises |
|
\(V = Bv\); per port \(i = \mathbf b^\mathsf T I\), \(Z_\mathrm{in} = v/i\), \(P\), \(Q\) (equal to Eq. (24)) |
|
plane-wave right-hand side and solve |
|
lumped R, L, C loads |
|
choice of mesh size and gap width, plausibility check of \(Z_\mathrm{in}\) |
radiation_algorithm and frequency_sweep take a list of port specifications and one complex
voltage per port (ports, voltages); gap_width is given for each EnhancedGap and has no default
(Ports: feeding an antenna). In a sweep, \(V\) does not depend on frequency and is built once. The
reflection coefficient of each port is computed from its \(Z_\mathrm{in}\) against Z0, with all ports
driven together (an active value, not an entry of the scattering matrix).
Tests. test/test_gap_source.py (window localisation at a junction, several ports, error when
nothing is fed), test/test_gap_source_partial.py (exact integration against a Monte-Carlo
integration, continuity in \(W\), the warning), test/test_ports_unified.py (Ports),
test/test_frequency_sweep.py (the sweep reproduces radiation_algorithm frequency by frequency,
with and without losses).
Assumptions and limits#
The field of the gap is uniform, \(V/W\) along \(\hat{\mathbf e}\), and integrated exactly over the part of each triangle inside the window; the plane wave is sampled at the centroids.
The cube window: on a conductor wider than \(W\), only the part of the gap inside the cube is fed, and the input impedance is wrong (
GapSourceWarning); nothing is fed, andGapSourceErroris raised, if no part of a triangle is in the cube. Use a gap at least as wide as the conductor.The excitation axis is one of
'x','y','z': a feed along an oblique direction is not supported by the enhanced gap (the delta gaps of Ports take any direction).\(Z_\mathrm{in} = v/\mathbf b^\mathsf T I\) equals the complex-power definition Eq. (24); it equals the paper’s edge-current definition only when the gap is admissible.
Lumped loads act on a single edge.
Continue#
Real metals through a surface impedance
Feeding an antenna with radiation_algorithm
Known issue of the multi-port power budget