Reference
Palace calculates solutions of Maxwell's equation for six different "Problem Types":
- Electrostatics: time-independent voltage sources,
- Magnetostatics: time-independent current sources,
- Driven: monochromatic excitations $\bm{U}^{inc}(f)$,
- Eigenmode: resonances of the system,
- Transient: time-dependent excitations $\bm{U}^{inc}(t)$,
- Boundary mode: guided modes on a waveguide cross section.
Here, we will summarize the mathematics of each, provide a description of boundary conditions, and specify convention choices. This should be read in conjunction with the User Guide and Configuration File documentation.
Mathematical background
The solver computes a finite element approximation to the three-dimensional, time-harmonic Maxwell's equations in second-order form. The nondimensionalized, source-free, boundary value problem for $\bm{E}(\bm{x})\in\mathbb{C}^3$, $\bm{x}\in\Omega$, $\partial\Omega = \Gamma$, where $\bm{\mathscr{E}}(\bm{x},t) = \text{Re}\{\bm{E}(\bm{x})e^{i\omega t}\}$ denotes the electric field, is written as
\[\begin{aligned} \nabla\times\mu_r^{-1}\nabla\times\bm{E} + i\omega\sigma\bm{E} - \omega^2\varepsilon_r\bm{E} &= 0 \,,\; \bm{x}\in\Omega \\ \bm{n}\times\bm{E} &= 0 \,,\; \bm{x}\in\Gamma_{PEC} \\ \bm{n}\times(\mu_r^{-1}\nabla\times\bm{E}) &= 0 \,,\; \bm{x}\in\Gamma_{PMC} \\ \bm{n}\times(\mu_r^{-1}\nabla\times\bm{E}) + \gamma\bm{n}\times(\bm{n}\times\bm{E}) &= \bm{U}^{inc} \,,\; \bm{x}\in\Gamma_{Z} \end{aligned}\]
where the nondimensionalization has been performed with respect to a characteristic length $L_0$, time $L_0/c_0$, magnetic field strength $H_0$, and electric field strength $Z_0 H_0$. Here, $c_0$ and $Z_0$ are the speed of light and impedance of free space, respectively. This nondimensionalization will be used throughout this entire reference. For more details, see [1] and [2].
Given the electric field solution, the time-harmonic magnetic flux density can be calculated as
\[\bm{B} = -\frac{1}{i\omega}\nabla\times\bm{E} \,.\]
The flux density is related to the magnetic field, $\bm{H}$, by the standard linear constitutive relationship $\bm{H} = \mu_r^{-1}\bm{B}$.
In general, the material property coefficients may be scalar- or matrix-valued. In the matrix-valued (anisotropic) case, the material property coefficients should still always be symmetric.
For a general isotropic lossy dielectric, the relative permittivity $\varepsilon_r$ is a complex-valued quantity:
\[\varepsilon_r = \varepsilon_r' (1-i\tan{\delta})\]
where $\varepsilon_r'$ is the real relative permittivity and $\tan{\delta}$ is the loss tangent. Alternatively, conductor loss is modeled by Ohm's law $\bm{J} = \sigma\bm{E}$ with electrical conductivity $\sigma > 0.0$. For a superconducting domain, the constitive current-field relationship given by Ohm's law is replaced by that given by the London equations:
\[\frac{\partial \bm{J}}{\partial t} = \frac{1}{\mu_r\lambda_L^2}\bm{E}\]
where $\lambda_L = \sqrt{m/\mu n_s e^2}/L_0$ is the nondimensionalized London penetration depth. In this case, the term $+i\omega\sigma \bm{E}$ arising for a normal conductor in the time-harmonic Maxwell's equations becomes $+(\mu_r \lambda_L^2)^{-1}\bm{E}$.
The domain boundary $\Gamma = \Gamma_{PEC}\cup\Gamma_{PMC}\cup\Gamma_{Z}$, is separated into perfect electric conductor (PEC), perfect magnetic conductor (PMC), and impedance boundaries, respectively. The PEC boundary condition is a homogeneous Dirichlet condition, while the PMC boundary condition is the natural boundary condition for the problem and is satisfied at all exterior boundaries by the finite element formulation. Impedance boundaries are modeled using a Robin boundary condition with $\gamma = i\omega/Z_s$, in which $Z_s$ the surface impedance of the boundary, with units of impedance per square.
Floquet periodic boundary conditions
When applying Floquet periodic boundary conditions, the phase delay is incorporated into the time-harmonic Maxwell equations and exact periodic boundary conditions are applied. The modified Maxwell equations are obtained by substituting $\bm{E}(\bm{x}) = \bm{E}_p(\bm{x})e^{-i \bm{k}_p \cdot \bm{x}}$, where $\bm{E}_p$ is the periodic electric field and $\bm{k}_p$ is the user-specified Bloch wavevector. The resulting equation is
\[\begin{aligned} \nabla\times\mu_r^{-1}\nabla\times\bm{E}_p - i\bm{k}_p\times\mu_r^{-1}\nabla\times\bm{E}_p - i\nabla\times(\mu_r^{-1}\bm{k}_p\times\bm{E}_p) & \\ - \bm{k}_p\times\mu_r^{-1}\bm{k}_p\times\bm{E}_p + i\omega\sigma\bm{E}_p - \omega^2\varepsilon_r\bm{E}_p &= 0 \,,\; \bm{x}\in\Omega \end{aligned}\]
and given the electric field solution, the time-harmonic magnetic flux density can be calculated as
\[\bm{B}_p = -\frac{1}{i\omega}\nabla\times\bm{E}_p + \frac{1}{\omega} \bm{k}_p \times \bm{E}_p \,.\]
Likewise, boundary conditions involving the curl of the electric field on the boundary, like the second-order absorbing boundary condition, apply to the full field $\bm{E}$, whose surface curl is given in terms of the periodic field by
\[\bm{n}\cdot\nabla\times\bm{E} = e^{-i \bm{k}_p \cdot \bm{x}} \, \bm{n}\cdot(\nabla\times\bm{E}_p - i\bm{k}_p\times\bm{E}_p) \,.\]
For example, for a plane wave incident on a boundary of the periodic cell, the periodic field is uniform on the boundary and the surface curl is given entirely by the second term. The second-order absorbing boundary condition is then not passive for TE fields when the part of $\bm{k}_p$ tangential to the boundary exceeds $\sqrt{2}$ times the wavenumber in the material at the boundary (see Other boundary conditions).
Time domain formulation
A time-dependent formulation is also available to compute the electric field response $\bm{E}(\bm{x},t)$ for a given time-dependent source excitation $\bm{U}^{inc}(\bm{x},t)$. The governing equations in this case are
\[\nabla\times\mu_r^{-1}\nabla\times\bm{E} + \sigma\frac{\partial\bm{E}}{\partial t} + \varepsilon_r\frac{\partial^2\bm{E}}{\partial t^2} = 0 \,,\; \bm{x}\in\Omega\]
subject to the same boundary conditions as the frequency-dependent case except for the Robin boundary condition which is written for a lumped resistive port boundary, for example, as
\[\bm{n}\times(\mu_r^{-1}\nabla\times\bm{E}) + Z_s^{-1}\bm{n}\times\left(\bm{n}\times\frac{\partial\bm{E}}{\partial t}\right) = \bm{U}^{inc} \,,\; \bm{x}\in\Gamma_{Z} \,.\]
The second-order electric field differential equation is transformed into a first-order ODE system which is solved along with the equation for the magnetic flux density
\[\left(\begin{matrix} \varepsilon_r & 0 & 0 \\ 0 & I & 0 \\ 0 & 0 & I\end{matrix}\right) \left(\begin{matrix} \ddot{\bm{E}} \\ \dot{\bm{E}} \\ \dot{\bm{B}}\end{matrix} \right) = \left(\begin{matrix} -\sigma & -\nabla\times\mu_r^{-1}\nabla\times & 0\\ I & 0 & 0 \\ 0 & -\nabla\times & 0\end{matrix}\right) \left(\begin{matrix}\dot{\bm{E}}\\ \bm{E} \\ \bm{B} \end{matrix}\right) \,.\]
The first-order ODE system formulation is chosen to take advantage of implicit adaptive time-stepping integration schemes. The $3 \times 3$ system can be block-eliminated to avoid an expensive coupled block system solve. It offers the additional benefit of sharing many similarities in the spatial discretization as the frequency domain formulation outlined above.
Eigenmode calculations
For eigenmode problems, the source term is zero and a quadratic eigenvalue problem for the eigenvalues $\omega$ is solved:
\[(\bm{K}+i\omega\bm{C}-\omega^2\bm{M})\bm{x} = 0\]
where the matrix $\bm{K}$ represents the discretized curl-curl operator, $\bm{M}$ the mass term, and $\bm{C}$ the port impedance boundary conditions. The damped frequency $\omega_d$ and quality factor $Q$ are postprocessed from each of the resulting eigenvalues as
\[\omega_d = \text{Re}\{\omega\} \,, \qquad Q = \frac{|\omega|}{2|\text{Im}\{\omega\}|} \,.\]
When wave port, surface conductivity, or second-order absorbing boundary conditions are used, a nonlinear eigenvalue problem is solved:
\[(\bm{K}+i\omega\bm{C}-\omega^2\bm{M}+\bm{A}_2(\omega))\bm{x} = 0\]
where the matrix $\bm{A}_2$ represents the nonlinear frequency-dependent boundary conditions.
The eigenmodes are normalized such that they have unit norm and their mean phase is a positive real number.
Lumped ports and wave ports
Ports have two effects. First, they impose a boundary condition that relates the electric and magnetic fields on the surface. Second, for the driven and transient solver, they can excite the system with an incident field.
For lumped ports, the boundary condition is an impedance condition as described above — tangential fields satisfy $\bm{E}_t = Z_s \bm{H}_t \times \bm{n}$. Here $Z_s$ is the physical surface impedance (per square) and $\bm{n}$ the port normal. The excitation modes $\bm{E}^{inc}$ are analytically specified.
For wave ports, a solver performs eigenmode simulations on the boundary to find supported modes of a transmission line with the wave-port cross section. The boundary modes will be used to relate $\bm{E}$ and $\bm{H}$, which will only be impedance-like for TEM, TE or TM modes. Additionally, users can choose which of the found modes to excite.
We normalize port fields so the time-averaged incident power is $\vert P^{inc} \vert = 1~\mathrm{W}$, where
\[P^{inc} = \frac{1}{2} V^{inc} [I^{inc}]^* = \frac{1}{2} \sum_e \int_{\Gamma_e} dS_e \, \bm{n}_e \cdot (\bm{E}_e^{inc} \times [\bm{H}_e^{inc}]^*).\]
Palace uses peak phasors for frequency domain fields, voltages, and currents, so the factor of $1/2$ converts the product of the phasors to the time average over one period. The same normalization applies to lumped ports, wave ports, and Floquet ports, so that mixed-port S-parameters need no additional scaling. For a lumped port with reference resistance $R = 50~\Omega$, the incident wave has $V^{inc} = 10~\mathrm{V}$ and $I^{inc} = 0.2~\mathrm{A}$ (peak). In the time domain, the excitation carries unit instantaneous incident power at unit pulse amplitude. When a wave port's cross section contains lossy material, the mode power is complex and this normalization fixes its magnitude, so the transported (real) incident power is exact only to first order in the loss tangent. The S-parameters of such a port are not affected: they are obtained from the unconjugated reaction with the port mode, as described for wave ports.
Here we have allowed for the possibility that a port can be made of disjoint surface elements $e$, which separately contribute to the Poynting vector.
Comparing with other tools. With these conventions, each excited port of a driven Palace simulation carries 1 W of time-averaged incident power ($A^2$ W with an excitation amplitude $A$). This is the default port excitation of HFSS (driven modal) and of a COMSOL port (an input power of 1 W), and that of a COMSOL lumped port with a power source of 1 W or an incident voltage $V_0 = \sqrt{2R \cdot 1~\mathrm{W}}$ (10 V for 50 Ω, where the default of COMSOL is 1 V). Palace, HFSS, and COMSOL all use peak phasors with the time dependence $e^{i\omega t}$ and time-averaged powers, so fields, voltages, power fluxes, and S-parameters compare directly.
$E_{elec}$ and $E_{mag}$ are time averages, and their sum is the time-averaged energy stored in the fields. The HFSS field calculator recipe for the peak electric energy, $\frac{1}{2}\int \varepsilon |\bm{E}|^2\,dV$, which equals the time-averaged stored energy of a closed resonator at resonance, gives twice $E_{elec}$.
Some outputs need a factor. In the time domain, a lumped port excitation of unit amplitude has $1/\sqrt{2}$ of the frequency domain amplitude, and an "ExcitationAmplitude" of $\sqrt{2}$ gives the same drive. A surface current source drives $1/\sqrt{Z_0} \approx 51.5$ mA, which is reported in surface-I.csv. Eigenmodes are normalized to unit norm, so their fields, voltages, and energies have an arbitrary scale and only the frequencies and ratios (quality factors, coupling rates, participation ratios) compare. COMSOL's quality factor uses $\text{Re}\{\omega\}$ in place of $|\omega|$, which makes it smaller by a relative $1/(8Q^2)$.
There is an additional normalization related to voltages and currents. For AC simulations of microwave networks, circuit $V$ and $I$ are not generally well defined and have to be fixed by convention [11, 12]. This is tantamount to relating the circuit characteristic impedance
\[Z = \frac{V^{inc}}{I^{inc}} = \frac{\vert V^{inc} \vert^2}{2[P^{inc}]^*},\]
to the physical surface (wave) impedance $Z_s$. We discuss this for each port type below.
Lumped Ports
Lumped ports in Palace can be composed of two types of elements:
Rectangular: The incident field is $\bm{E}^{inc} = E_0 \, \hat{\bm{l}}$. Here $E_0$ is a normalization constant and $\hat{\bm{l}}$ is the user-defined polarization direction, which should point between two conductors. We denote the length of the port along the polarization as $l$ and the perpendicular width as $w$. The port must be a strip along $\hat{\bm{l}}$, which may be folded or bent about $\hat{\bm{l}}$: $w$ is the length of its cross-section normal to $\hat{\bm{l}}$ (for a flat port, to its principal axis closest to $\hat{\bm{l}}$) half way along it, and $l$ is its area divided by $w$.
Coaxial: $\bm{E}^{inc} = {E_0 r_0} \hat{\bm{r}} / {r}$, where $E_0 r_0$ is a normalization constant, $r$ is the distance from the port center, and $\hat{\bm{r}}$ is the unit radial vector. We denote the inner and outer radii as $a$ and $b$.
We define the voltage across each element as averages over the area, rather than line integrals. For an electric field $\bm{E}$, the voltage across element $e$ is:
Rectangular: $V_{e} = \int_{\Gamma_e}dS\, \bm{E} \cdot\hat{\bm{l}}_e / w_e$,
Coaxial: $V_{e} = \int_{\Gamma_e}dS\, \bm{E} \cdot\hat{\bm{r}}_e / (2 \pi r)$.
This is a convention choice. For electrostatics or for TEM and TM transmission lines, the voltage in the port plane is path-independent between different conductors; in general, it is not.
The power normalization and voltage convention now fix the coefficients $E_0, r_0$ in the port definition and relate the physical surface impedance to the circuit impedance. For each element:
Rectangular: $Z = Z_s l / w$,
Coaxial: $Z = Z_s \ln(b/a) / (2\pi)$,
which we also write as $Z = Z_s / \alpha$ where $\alpha = w/l$ or $\alpha = 2\pi / \ln(b/a)$ respectively. If $Z$ is a combination of LRC responses, these add in parallel
\[\frac{1}{Z} = \frac{1}{R}+\frac{1}{i\omega L}+i\omega C.\]
Specifically, $R_s = \alpha R$, $L_s = \alpha L$, and $C_s = C/\alpha$.
In the configuration file, a user specifies either $L$, $R$, $C$, corresponding to $Z$, or $L_s$, $R_s$, $C_s$ corresponding to $Z_s$. For a single-element port, these will just be converted using the single scale factor $\alpha$. For a multi-element port, we require impedances to add in parallel ${1}/{Z} = \sum_e {1}/{Z_e}$, so that each element sees the same voltage. Specifying a lumped $Z$ in the config means that each element $e$ can have a different physical surface impedance depending on their shape $\alpha_e$:
\[Z_{s, e} = n_\mathrm{elem} \alpha_{e} Z.\]
Conversely, specifying $Z_s$ means elements of different shape will have different $Z_e$.
The source term $\bm{U}^{inc}$ in a driven frequency-response problem is related to the tangential component of the incident field at an excited port boundary by
\[\bm{U}^{inc} = -2a\gamma_{exc}(\bm{n}\times\bm{E}^{inc})\times\bm{n} \,, \qquad \gamma_{exc} = \frac{i\omega}{R_{ref}}\]
where $(\bm{n}\times\bm{E}^{inc})\times\bm{n}$ is just the projection of the excitation field onto the port surface, and $R_{ref}$ is the real reference resistance of the excited port: the port resistance $R$ when $R > 0$, or the impedance of free space $Z_0$ for a purely reactive port with $R = 0$ (see the discussion of reactive port excitation below). The excitation coefficient $\gamma_{exc}$ is in general distinct from the termination coefficient $\gamma = i\omega/Z_s$ appearing in the Robin boundary condition, and the two coincide for a purely resistive port. The field $\bm{E}^{inc}$ is the unit-power mode normalized as described above, $1~\mathrm{W}$, and $a = A e^{i\varphi}$ is the complex excitation weight of the port, set by the port's "ExcitationAmplitude" $A$ and "ExcitationPhase" $\varphi$ ($a = 1$ by default). The weight scales the source term $\bm{U}^{inc}$ by $a$, so the incident power of the excited port is $A^2$ times that of the unit-power excitation.
In the time-domain formulation, the source term $\bm{U}^{inc}$ appears as
\[\bm{U}^{inc} = -2 A R_{ref}^{-1}\left(\bm{n}\times\frac{\partial\bm{E}^{inc}}{\partial t}\right) \times\bm{n} \,.\]
where the source is scaled by the amplitude $A$. The time-domain excitation is real, so the weight must be real in that case ($\varphi$ a multiple of 180 degrees); for $\varphi = 180$ degrees, $A$ is replaced by $-A$.
The incident field $\bm{E}^{inc}(\bm{x},t)$ is
\[\bm{E}^{inc}(\bm{x},t) = p(t)\bm{E}^{inc}(\bm{x})\]
where $\bm{E}^{inc}(\bm{x})$ has the spatial form of the frequency domain excitation with $1/\sqrt{2}$ of its amplitude (unit instantaneous incident power at $p = 1$), and $p(t)$ describes the temporal shape of the excitation. Possible options for config["Solver"]["Transient"]["Excitation"] include a sinusoidal, Gaussian, modulated Gaussian, or step excitation.
For AC simulations, a surface-current source and a resistive lumped port with the same geometry produce right-hand-side source terms with the same spatial form, up to an overall normalization. A surface-current source is normalized to a current of $1/\sqrt{Z_0} \approx 51.5$ mA, the unit of current of Palace's nondimensionalization, and only drives the right-hand side: it prescribes no boundary condition and provides no termination or dissipation. A lumped port is normalized to the unit incident power described above and also imposes its impedance (Robin) boundary condition, so a nonzero resistance allows energy to leave the model through the port. Thus, surface current should be used for an ideal nondissipative drive and a lumped port when a terminating impedance is part of the physical model.
Wave ports
Numeric wave ports assume a field with known normal-direction dependence $\bm{E}(\bm{x}) = \bm{e}(\bm{x}_t)e^{-ik_n x_n}$ where $k_n$ is the propagation constant. For each operating frequency $\omega$, a two-dimensional eigenvalue problem is solved on the port yielding the mode shapes $\bm{e}_m$ and associated propagation constants $k_{n,m}$. These are used in the full 3D model where the Robin port boundary condition has coefficient $\gamma = i k_{n,m}/\mu_r$ and the computed mode is used to compute the incident field in the source term $\bm{U}^{inc}$ at excited ports. When the port cross-section is lossy, for example with "Conductivity" or "Impedance" boundaries or lossy dielectrics on the port boundary, the propagation constant $k_{n,m}$ is complex, and its imaginary part (the attenuation of the port mode) is kept in the boundary condition and in the incident field, so that the port is matched to its own mode.
The modes of a lossy cross-section are orthogonal under the unconjugated (reciprocity) pairing $\int_\Gamma (\bm{E}_m\times\bm{H}_k)\cdot\bm{n}\,dS$, and not under the power pairing $\int_\Gamma (\bm{E}_m\times\bm{H}_k^*)\cdot\bm{n}\,dS$ [11]. The incident wave of a wave port carries unit time-averaged power, $\vert P^{inc} \vert = 1~\mathrm{W}$ as above, with the phase of the mode chosen such that its reaction
\[R^{inc} = \frac{1}{2}\int_\Gamma (\bm{E}^{inc}\times\bm{H}^{inc})\cdot\bm{n}\,dS\]
is real and positive. For a lossless propagating mode, $R^{inc} = P^{inc} = 1~\mathrm{W}$. For a lossy mode, the complex power $P^{inc}$ has a phase, and $R^{inc}$ is close to, but not exactly, unity.
For more information on the implementation of numeric wave ports, see [3].
For a general waveguide mode, the circuit quantities $V$, $I$, and $Z$ are not uniquely determined by the electromagnetic fields and must be fixed by convention [11, 12]. In contrast to lumped ports, where the voltage is defined as an area-averaged integral with a specific analytic form, wave port $V$ and $I$ are obtained from line integrals on the port cross-section. The wave port configuration uses "VoltagePath" for $V$ and mode polarity, while boundary-mode impedance postprocessing can additionally define a current path for $I$.
Voltage. The mode voltage is defined as a path integral of the electric field:
\[V = \int_\mathcal{C} \bm{E} \cdot d\bm{l}\]
where $\mathcal{C}$ is a user-specified path between two conductors on the port cross-section. For TEM and TM modes, this integral depends only on the endpoints and not on the path between them; for TE and hybrid modes, it is path-dependent [11].
Current. The mode current is defined as a closed-loop path integral of the in-plane magnetic field:
\[I = \oint_\mathcal{L} \bm{H}_t \cdot d\bm{l}\]
where $\mathcal{L}$ is a user-specified closed contour encircling one conductor. The in-plane magnetic field $\bm{H}_t = \mu_r^{-1}\bm{B}_t$ is obtained from the mode fields via
\[\bm{B}_t = -\frac{k_n}{\omega}(\hat{\bm{n}}\times\bm{E}_t) + \frac{1}{i\omega}(\nabla_t E_n \times\hat{\bm{n}})\]
where $\hat{\bm{n}}$ is the port normal (propagation direction), $k_n$ is the propagation constant, $\bm{E}_t$ the transverse electric field, and $E_n$ the normal (longitudinal) electric field component on the port.
Impedance. The power-voltage characteristic impedance is defined as
\[Z_{PV} = \frac{|V|^2}{2P^*}\]
where $P = \frac{1}{2}\int_\Gamma(\bm{E}\times\bm{H}^*)\cdot\hat{\bm{n}}\,dS$ is the complex time-averaged power flux of the mode through the cross-section for the peak-phasor fields. It is real for a lossless propagating mode, and complex for a lossy one. For a TEM mode with a voltage path between the two conductors, $P = \frac{1}{2} V I^*$ and $Z_{PV} = V / I$ is the conventional complex characteristic impedance of the line, which has the phase of $k_n$ for a quasi-TEM mode on a line with a lossless dielectric. Wave ports report $Z_{PV}$ when "VoltagePath" is specified, consistent with the total-field impedance $|V|^2 / (2P^*)$ of the port, and boundary-mode solves with impedance postprocessing.
As a diagnostic, boundary-mode impedance postprocessing also reports the complex voltage-current impedance when a current path is specified:
\[Z_{VI} = V / I\]
where $V$ and $I$ are computed independently from different paths. Its sign is chosen such that $\text{Re}\{V I^* / P\} > 0$, as for a TEM mode, so that it does not depend on the directions of the voltage path and of the current loop. Note that independently specifying both voltage and current does not in general define a valid characteristic impedance [11]. For TEM modes $Z_{VI} = Z_{PV}$; for other modes they will generally differ.
The normal convention $+\hat{\bm{n}}$ is the outward mesh normal. For a passive port cross-section, the propagation constant has $\text{Re}\{k_n\}\ge 0$, corresponding to forward propagation in the $+\hat{\bm{n}}$ direction, and $\text{Im}\{k_n\}\le 0$, for which the mode decays in that direction. In particular, below cutoff, where $k_n = -i\alpha$ is imaginary for a lossless cross-section, the port boundary condition is matched to the evanescent mode which decays away from the model. De-embedding $\tilde{S}_{ij} = S_{ij}e^{ik_{n,i}d_i}e^{ik_{n,j}d_j}$ uses positive $d$ to shift the reference plane toward the device (removing waveguide), consistent with [12].
Scattering Parameters
In the frequency domain, the scattering parameters can be postprocessed from the computed electric field for each lumped port with boundary $\Gamma_i$ as
\[S_{ij} = \frac{\displaystyle\int_{\Gamma_i}\bm{E}\cdot\bm{E}^{inc}_i\,dS} {\displaystyle\int_{\Gamma_i}\bm{E}^{inc}_i\cdot\bm{E}^{inc}_i\,dS} - \delta_{ij} \,.\]
For a resistive excited port, the incident field $\bm{E}^{inc}$ is normalized so that the time-averaged incident power integrated over the port boundary is unity, referenced to the port resistance $R = R_{ref}$, and the excitation and termination coefficients coincide. A lumped port with nonzero inductance and/or capacitance may also be excited. In that case the port's full $R$, $L$, and $C$ still enter the system matrix as a physical parallel termination through $\gamma = i\omega/Z_s$ with the complex $Z_s(\omega)$, while the source term is assembled with the real $\gamma_{exc} = i\omega/R_{ref}$ defined above ($R_{ref} = Z_0 \approx 376.7~\Omega$ for a purely reactive port with $R = 0$); the port reactance therefore acts on the solution through the termination, not through the drive normalization. The scattering parameters at resistive ports (observation or drive) retain their standard power-wave interpretation. For a purely reactive drive port ($R = 0$), the reported $S_{ii}$ is related to the loaded port impedance by
\[S_{ii} + 1 = \frac{2\,Z_{\text{loaded}}}{Z_0}\]
where $Z_{\text{loaded}} = Z_p \parallel Z_{\text{struct}}$ is the parallel combination of the port impedance $Z_p = (1/R + 1/(i\omega L) + i\omega C)^{-1}$ (zero-valued branches are omitted from the sum: the $1/R$ term is dropped when $R = 0$, and likewise for $L$ and $C$) and the structure's input impedance at the port plane. This is a reciprocal, frequency-dependent quantity — but it is not bounded by unity and should not be interpreted as a power reflection coefficient. Transmission parameters $S_{ji}$ ($j \ne i$) between a reactive drive and a resistive observation port are real-reference-normalized transmission amplitudes: each side is normalized to its own real reference ($Z_0$ at the reactive drive, $R_j$ at the resistive observation port), so a fixed $\sqrt{R_j/Z_0}$ conversion factor separates them from a voltage-transfer ratio. They satisfy reciprocity ($S_{ji} = S_{ij}$). The same unit-reference projection applies to passive purely reactive lumped ports ($R = 0$ with $L$ and/or $C$) appearing as observation ports: their S-parameter rows are finite and referenced to $Z_0$, rather than identically zero. Likewise, the incident voltage and current columns of the port postprocessing output ($V^{inc}$, $I^{inc}$) at a purely reactive excited port are finite and referenced to $Z_0$ — like the S-parameter row, they are bookkeeping quantities consistent with the assembled drive normalization, not physical incident waves (an $R = 0$ port supports no incident traveling wave).
In the time domain, the time histories of the port voltages can be Fourier-transformed to get their frequency domain representation for scattering parameter calculation.
For wave ports, the scattering parameters are the modal amplitudes of the computed field at each port, obtained from its reaction with the port mode, normalized as described in Wave ports:
\[S_{ij} = \frac{\displaystyle\int_{\Gamma_i}(\bm{E}\times\bm{H}^{inc}_i)\cdot\bm{n}\,dS} {\displaystyle\int_{\Gamma_i}(\bm{E}^{inc}_i\times\bm{H}^{inc}_i)\cdot\bm{n}\,dS} - \delta_{ij} \,.\]
For a lossless propagating port mode, this is the projection $\frac{1}{2}\int_{\Gamma_i}(\bm{E}\times[\bm{H}^{inc}_i]^*)\cdot\bm{n}\,dS$ onto the unit-power incident wave, and the scattering parameters have the standard power-wave interpretation. For a lossy port mode, the unconjugated reaction separates the incident and reflected modal amplitudes, also from those of other modes of the port cross-section, and the scattering parameters are those of the pseudo-waves of the port modes [11]. A uniform line between two ports with the same cross-section has $S_{11} = S_{22} = 0$ and $S_{21} = S_{12} = e^{-ik_n L}$, and the scattering matrix of a reciprocal structure is symmetric, up to the small differences in $R^{inc}$ between lossy ports of different cross-sections.
For wave ports, since the propagation constants are known, we allow additional de-embedding by specifying an offset distance $d$ for each wave port:
\[\tilde{S}_{ij} = S_{ij}e^{ik_{n,i}d_i}e^{ik_{n,j}d_j} \,.\]
Adaptive driven solver and reduced-order modeling
The driven solver assembles a frequency-dependent linear system of the form
\[\bm{A}(\omega)\bm{x} = \left[\bm{K} + i\omega\bm{C} - \omega^2\bm{M} + \bm{A}_2(\omega)\right]\bm{x} = i\omega\bm{b} + \bm{b}_2(\omega),\]
where $\bm{x}$ contains the finite-element electric-field degrees of freedom. The matrices $\bm{K}$, $\bm{M}$, and $\bm{C}$ represent the discretized curl-curl, displacement, and dissipative terms, respectively. The additional terms $\bm{A}_2(\omega)$ and $\bm{b}_2(\omega)$ account for boundary conditions that are not quadratic in frequency, such as numeric wave ports or far-field boundaries.
The adaptive driven solver constructs a projection-based reduced-order model (PROM) for this system. It seeks a real basis $\bm{Q}\in\mathbb{R}^{N\times n}$, with $n \ll N$, and projects the high-dimensional system onto that basis:
\[\left[\bm{K}_r + i\omega\bm{C}_r - \omega^2\bm{M}_r\right]\bm{x}_r = i\omega\bm{b}_r,\]
with, for example, $\bm{K}_r = \bm{Q}^T\bm{K}\bm{Q}$ and $\bm{b}_r = \bm{Q}^T\bm{b}$. Once the reduced system is solved, the high-dimensional field is recovered as $\bm{x}\approx\bm{Q}\bm{x}_r$. The expensive part is the offline construction of $\bm{Q}$; the online evaluation of the reduced system is cheap for many output frequencies. This follows the standard projection-based model-order-reduction framework [7], [8].
The PROM basis is built from full high-dimensional model (HDM) solutions at selected internal sample frequencies. For each complex HDM solution $\bm{x}^*$, Palace adds the orthogonalized real and imaginary components, $\mathrm{Re}(\bm{x}^*)$ and $\mathrm{Im}(\bm{x}^*)$, as separate real basis vectors. The Gram-Schmidt orthogonalization variant is controlled by config["Solver"]["Driven"]["AdaptiveGSOrthogonalization"], though most users should not need to change it. "MGS" is applied as "CGS2", classical Gram-Schmidt with reorthogonalization, which is as stable with three reductions per vector (one per pass and one for the norm) instead of one per basis vector.
An HDM solution is only as accurate as its linear solve: config["Solver"]["Linear"]["Tol"] bounds a residual (for GMRES, that of the preconditioned system), not the error, which can be much larger, and for an ill-conditioned system the factorization of a direct solver can be inaccurate as well. Late in the sampling, the new direction which the real or the imaginary part of a sample adds to the basis can be as small as this error, and then consists largely of it. The Galerkin projection can amplify the error carried by such a direction, so that the PROM with it is farther from the sample, and from the exact solution, than without it. With an accurate sample in its basis, the Galerkin PROM reproduces the sample, so after adding a sample, Palace evaluates the error $\varepsilon$ defined below at this sample, with the sample in the basis. If it is not below config["Solver"]["Driven"]["AdaptiveTol"], the sample is removed, refined and added again, up to four times: a step of iterative refinement adds to it a correction for its true residual, solved with the same linear solver to a relative tolerance of 1e-2 (or config["Solver"]["Linear"]["Tol"], if looser). A part of a sample in the span of the basis, to the orthogonalization tolerance, carries no new information and adds no direction. If the sampling of an excitation reaches config["Solver"]["Driven"]["AdaptiveMaxSamples"] before converging, Palace warns. It also warns if the PROM does not reproduce some of the samples even after their refinement: "AdaptiveTol" is then likely below the accuracy which the HDM solutions can reach, for example because of the conditioning of the system, which refinement does not improve, and has to be looser.
Internal sample selection
The remaining question is how to choose the internal sample frequencies. Palace uses a greedy sampling strategy based on minimal rational interpolation, following Pradovera [9], [10]. For a linearized state $\bm{u}(\omega)$, the interpolation has the barycentric form
\[\bm{u}(\omega) = \frac{\sum_i w_i \bm{u}(\omega_i) / (\omega - \omega_i)} {\sum_i w_i / (\omega - \omega_i)},\]
where $\omega_i$ are already-sampled frequencies and $w_i$ are fitted weights. For the quadratic $KCM$ part of the driven system, Palace uses the linearized state $\bm{u}^T = (\bm{x}^T, i\omega\bm{x}^T)$. This is analogous to rewriting a second-order time system as a first-order system with twice as many state variables.
Each excitation pattern gets its own rational interpolation for selecting future samples. The initial samples are the frequency-domain endpoints and any user-requested samples with "AddToPROM": true. After that, the interpolation suggests the next sample from an error indicator that can be evaluated without another HDM solve. The selected HDM solution is then added to the shared PROM basis.
HDM solutions are solved from zero. When config["Solver"]["Linear"]["InitialGuess"] is enabled (the default), the sample which would complete the convergence memory (see below) is solved from the PROM solution there instead, to certify the PROM: if the linear solver converges, to the tighter of its tolerance and "AdaptiveTol", and changes the PROM solution by less than "AdaptiveTol", the sweep of this excitation has converged, and this solution is added to the basis as the last sample, unless it is already in the span of the basis to round-off (for example when the PROM solution already meets this tolerance, so that the solve takes no iteration). Otherwise, the solve is stopped as soon as the change exceeds "AdaptiveTol" (with GMRES and left preconditioning, the defaults; FGMRES or right preconditioning solve to convergence), and the sample is solved again from zero, reusing the assembled operators and preconditioner. The other samples are not started from the PROM solution: the linear solver controls the residual of the preconditioned system, and while the PROM is still inaccurate, a solution started from it can keep errors of the PROM which barely affect this residual, for example in weakly excited, high-Q modes, and which would then degrade the PROM.
Convergence criterion
At a proposed sample frequency $f^*$, Palace compares the HDM solution against the PROM solution using
\[\varepsilon = \frac{\|\bm{x}_\mathrm{HDM}(f^*) - \bm{x}_\mathrm{ROM}(f^*)\|} {\|\bm{x}_\mathrm{HDM}(f^*)\|}.\]
Convergence is declared when this quantity is below config["Solver"]["Driven"]["AdaptiveTol"] for config["Solver"]["Driven"]["AdaptiveConvergenceMemory"] consecutive samples. Since $\varepsilon$ is measured against HDM solutions, it is in general not smaller than their error: if they are less accurate than "AdaptiveTol", even after their refinement, the sampling may not converge. The norm here is the finite-element coefficient-space L2 norm. It is related to, but not the same as, a physical energy norm such as $\int \bm{E}^*(\bm{r})\cdot\bm{E}(\bm{r})\,d^3r$. Consequently, the adaptive tolerance is not a strict relative-error bound for every derived quantity, such as S-parameters or domain energies.
The tolerance of the linear solver (config["Solver"]["Linear"]["Tol"]) bounds the relative residual of the preconditioned system (with the default left preconditioning), not the error of the HDM solution, which can be much larger. Near the accuracy of the HDM solves, $\varepsilon$ no longer measures the PROM error alone, and an "AdaptiveTol" tighter than this accuracy may not be reached before "AdaptiveMaxSamples".
The indicator is also not a mathematical certificate of the maximum error over the entire frequency interval. The convergence memory mitigates accidental early termination when one suggested sample happens to fall below tolerance before the broader approximation has fully settled.
Multi-excitation simulations
For multi-excitation driven simulations, Palace constructs a separate rational interpolation for each excitation, but the PROM basis $\bm{Q}$ is shared across all excitations. Samples selected for earlier excitations can therefore improve the basis used for later excitations. "AdaptiveMaxSamples" is interpreted per excitation.
Non-quadratic boundary terms
When non-quadratic frequency terms $\bm{A}_2(\omega)$ are present, the HDM samples still include the full operator and the projected reduced problem includes the projected $\bm{A}_{2,r}(\omega)$ during online evaluation. For boundary conditions whose frequency dependence factors as a scalar times a frequency-independent boundary operator (the second-order absorbing boundary, surface conductivity, rational surface impedance, and Floquet port Robin terms), the boundary operator is projected onto $\bm{Q}$ once and only the scalar is re-evaluated at each output frequency, so the online cost matches the purely quadratic case. Wave ports have the same structure, $\bm{A}_{2,r}(\omega) = i\,k_n(\omega)\,\bm{Q}^T\bm{M}_p\bm{Q}$, but the propagation constant $k_n(\omega)$ and the port mode field used for excitation and S-parameter postprocessing come from a two-dimensional boundary eigenvalue problem that depends on frequency.
Rather than solving that eigenvalue problem exactly at every output frequency, Palace builds a per-port reduced model during the offline phase: each exact port mode computed for an HDM sample is added to a complex basis of port eigenvectors. Online, the boundary eigenvalue problem is projected onto this basis and solved densely (a Rayleigh-Ritz procedure); the mode is selected in the same way as the exact solver. The reduced eigenpair $(\lambda, \bm{x})$ is accepted only if its full-space backward residual
\[\eta = \frac{\|\bm{B}\bm{x} - \lambda\bm{A}(\omega)\bm{x}\|} {\|\bm{B}\bm{x}\| + |\lambda|\,\|\bm{A}(\omega)\bm{x}\|}\]
is below a tolerance derived from the port eigensolver tolerance and "AdaptiveTol". Otherwise, or whenever the reduced problem does not yield the requested number of well-separated modes, the exact eigenvalue problem is solved instead and its eigenvector enriches the basis, up to a fixed capacity above the offline rank. The dense reduced problem on a basis of $n$ vectors costs $\mathcal{O}(n^3)$, and an exact solve of the sparse cross-section problem with $N$ unknowns roughly $\mathcal{O}(N^{3/2})$: the reduced model is only used with a basis of at most $2\sqrt{N}$ vectors, a limit which also caps its enrichment, and otherwise all port modes are solved exactly. A basis above the limit occurs for a small port cross-section with a port mode whose shape changes with frequency, as for a lossy line, where every exact solve adds a basis vector. The port mode reconstructed from an accepted reduced eigenvector feeds the excitation, the modal correction, and the S-parameter postprocessing exactly as an exact mode would. Complex-frequency queries (from the eigenmode solver) and the cross-section samples taken for circuit synthesis always use the exact solver. At the end of the sweep, Palace prints per-port statistics: the basis size and capacity, the numbers of reduced and exact solves, the number of fallbacks, the worst accepted residual, and whether the basis is above the size limit.
The sample-selection interpolation is based on the quadratic linearization and does not fully represent arbitrary non-quadratic frequency dependence. If the non-quadratic contribution is large compared with the $KCM$ part of the operator, the selected samples can be less effective and the adaptive solve may require tighter tolerances, more samples, or additional validation against a uniform sweep.
Finite-precision effects
The rational interpolation assumes that the sampled HDM solutions are accurate. In practice, they inherit the error of the linear solver. If config["Solver"]["Linear"]["Tol"] is too close to "AdaptiveTol", the interpolation can become ill-conditioned and Palace may warn about rank-deficient minimal rational interpolation matrices. In that case, tighten the linear solver tolerance, loosen the adaptive tolerance, or validate with a uniform solve.
Other boundary conditions
The first-order absorbing boundary condition, also referred to as a scattering boundary condition, is a special case of the general impedance boundary condition described above:
\[\bm{n}\times(\mu_r^{-1}\nabla\times\bm{E}) + i\omega\sqrt{\mu_r^{-1}\varepsilon_r}\bm{n}\times(\bm{n}\times\bm{E}) = 0 \,.\]
This is also known as the Sommerfeld radiation condition, and one can recognize the dependence on the impedance of free space $Z_0^{-1} = \sqrt{\mu_r^{-1}\varepsilon_r}$. The second-order absorbing boundary condition is
\[\bm{n}\times(\mu_r^{-1}\nabla\times\bm{E}) + i\omega\sqrt{\mu_r^{-1}\varepsilon_r}\bm{n}\times(\bm{n}\times\bm{E}) - \beta\nabla\times[(\nabla\times\bm{E})_n\bm{n}] = 0\]
where assuming an infinite radius of curvature $\beta = \mu_r^{-1}c_0/(2i\omega)$, and the contribution depending on $(\nabla\cdot\bm{E}_t)$ has been neglected.
The remaining second-order term only acts on fields whose curl has a normal component on the boundary. For a plane wave, it improves on the first-order condition for TE polarization, with the electric field tangential to the boundary, while for TM polarization the condition is the first-order one: the neglected term would have improved it. For a TE plane wave with the tangential wavenumber $k_t$, the condition imposes the normal wavenumber $k - k_t^2/(2k)$ instead of $\sqrt{k^2 - k_t^2}$, where $k = \omega\sqrt{\mu_r\varepsilon_r}$ is the wavenumber in the material at the boundary. For $k_t > \sqrt{2}k$, this normal wavenumber is negative: the second-order condition is not passive and injects energy into the field. This can happen for evanescent fields at the boundary, like guided modes below the light line or evanescent diffraction orders of a periodic structure, and in particular when the part of a Floquet wave vector tangential to the boundary exceeds $\sqrt{2}k$, for which Palace prints a warning. The first-order condition is passive.
Additionally, while metals with finite conductivity can be modeled using an impedance boundary condition with constant impedance $Z_s$, a more accurate model taking into account the frequency dependence of the skin depth is
\[Z_s = \frac{1+i}{\delta\sigma}\]
where $\delta = \sqrt{2/\mu_r\sigma\omega}$ is the skin depth and $\sigma$ is the conductivity of the metal. Another model, which takes into account finite thickness effects, is given by
\[Z_s = \frac{1}{\delta\sigma}\left(\frac{\sinh{\nu}+\sin{\nu}}{\cosh{\nu}-\cos{\nu}} + i\frac{\sinh{\nu}-\sin{\nu}}{\cosh{\nu}-\cos{\nu}}\right)\]
where $\nu = h/\delta$ and $h$ is the layer thickness. This model correctly produces the DC limit when $h\ll\delta$.
Energy-participation ratios
The energy-participation ratio (EPR) for lumped inductive elements is computed from the electric and magnetic fields corresponding to eigenmode $m$, $\bm{E}_m$ and $\bm{H}_m$, using the formula
\[p_{mj} = \frac{1}{\mathcal{E}^{elec}_m} \, \frac{1}{4} \, L_j |I_{mj}|^2\]
where $p_{mj}\in[-1,1]$ denotes the signed participation ratio for junction $j$ in mode $m$, $L_j$ is the provided junction circuit inductance, $I_ {mj}$ is the peak junction current for mode $m$, and $\mathcal{E}^{elec}_m$ is the time-averaged electric energy in mode $m$ (the numerator is likewise the time-averaged energy stored in the inductor). The junction current is computed using the mean voltage across the port, $\overline{V}_{mj}$, as $I_{mj} = \overline{V}_{mj}/Z_{mj}$, where $Z_{mj} = i\omega_m L_j$ is the impedance of the inductive branch of the lumped circuit. The mean port voltage depends on the computed electric field mode and the shape of the port:
Rectangular ports: $\overline{V}_{mj} = \frac{1}{w_j}\int_{\Gamma_j}\bm{E}_m\cdot\hat{\bm{l}}_j\,dS$.
Coaxial ports: $\overline{V}_{mj} = \frac{1}{2\pi}\int_{\Gamma_j}\frac{\bm{E}_m}{r}\cdot\hat{\bm{r}}_j\,dS$.
Finally, the total time-averaged electric energy in mode $m$ is
\[\mathcal{E}^{elec}_m = \frac{1}{4} \, \text{Re}\left\{\int_\Omega\bm{D}_m^*\cdot\bm{E}_m\,dV\right\} + \sum_j \frac{1}{4} \, C_j|V_{mj}|^2\]
where $\bm{D}_m = \varepsilon_r\bm{E}_m$ is the electric flux density for mode $m$ and the second term on the right-hand side accounts for any lumped capacitive boundaries with nonzero circuit capacitance $C_j$. For a lossless mode with nondispersive storage, equipartition gives the total energy $\mathcal{E}_m = 2\mathcal{E}^{elec}_m$, and the port-Q estimate below uses it. This holds for weak loss. It can fail for strongly damped, open or dispersive modes, and when the port field is not uniform, since the lumped L/C energy then differs from the energy stored in the boundary sheet.
The EPR can also be used to estimate mode quality factors due to input-output (I-O) line coupling. The mode coupling quality factor due to the $j$-th I-O port is given by
\[Q_{mj} = \frac{\text{Re}\{\omega_m\}}{|\kappa_{mj}|}\]
The magnitude of the port coupling rate $\kappa_{mj}$ is the time-averaged power dissipated in the resistive boundary of port $j$ divided by the total stored energy $\mathcal{E}_m$ of mode $m$, and its sign is the sign of the real part of the port current $I_{mj} = \overline{V}_{mj}/R_j$:
\[\kappa_{mj} = \text{sign}(\text{Re}\{I_{mj}\}) \, \frac{1}{\mathcal{E}_m} \, \frac{1}{2} \sum_e \int_{\Gamma_e} \frac{|\bm{E}_{m,t}|^2}{R_{s,e}} \, dS = \text{sign}(\text{Re}\{I_{mj}\}) \, \frac{1}{2\mathcal{E}^{elec}_m} \, \frac{1}{2} \sum_e \int_{\Gamma_e} \frac{|\bm{E}_{m,t}|^2}{R_{s,e}} \, dS \,,\]
where $\bm{E}_{m,t}$ is the tangential electric field of mode $m$ on element $e$ of the port and $R_{s,e}$ is the sheet resistance of that element.
When the active resistive ports are the only loss, $\sum_j |\kappa_{mj}| = 2\,\text{Im}\{\omega_m\}$, so $\sum_j 1/Q_{mj}$ is $|\omega_m|/\text{Re}\{\omega_m\}$ times the $1/Q$ of the eigenvalue above, and close to it only when $Q \gg 1$.
Bulk and interface dielectric loss
The quality factor due to bulk dielectric loss resulting from an electric field $\bm{E}$ present in domain $j$ with associated loss tangent $\tan{\delta}_j$ is given by
\[\frac{1}{Q_j} = p_j \tan{\delta}_j = \frac{1}{\mathcal{E}^{elec}} \, \frac{1}{4} \, \tan{\delta}_j \, \text{Re}\left\{\int_{\Omega_j}\bm{D}^*\cdot\bm{E}\,dV\right\}\]
where, as above, $\mathcal{E}^{elec}$ is the total time-averaged electric field energy in the domain, including the contributions due to capacitive lumped elements.
Likewise, the quality factor due to surface interface dielectric loss for interface $j$ is given by
\[\frac{1}{Q_j} = p_j \tan{\delta}_j = \frac{1}{\mathcal{E}^{elec}} \, \frac{1}{4} \, t_j\tan{\delta}_j \, \text{Re}\left\{\int_{\Gamma_j}\bm{D}^*\cdot\bm{E}\,dS\right\}\]
where $t_j$ is the thickness of the layer and $\bm{D} = \varepsilon_{r,j}\bm{E}$ is the electric displacement field in the layer evaluated using the relative permittivity of the interface $\varepsilon_{r,j}$. On an interior boundary, where $\bm{E}$ can be discontinuous, the integrand uses the average of the fields on the two sides, except on an uncracked sheet with a boundary condition, such as a metal sheet, where the contributions of the two faces of the sheet are summed as on a cracked mesh (see Interior boundaries).
The above formula for interface dielectric loss can be specialized for the case of a metal-air, metal-substrate, or substrate-air interface [4]. In each case, the quality factor for interface $j$ is given by
- Metal-air:
\[\frac{1}{Q^{MA}_j} = \frac{1}{\mathcal{E}^{elec}} \, \frac{1}{4} \, \frac{t_j\tan{\delta}_j}{\varepsilon_{r,j}^{MA}} \, \text{Re}\left\{\int_{\Gamma_j}\bm{E}_n^*\cdot\bm{E}_n\,dS\right\}\]
- Metal-substrate:
\[\frac{1}{Q^{MS}_j} = \frac{1}{\mathcal{E}^{elec}} \, \frac{1}{4} \, \frac{t_j\tan{\delta}_j(\varepsilon_{r,j}^{S})^2}{\varepsilon_{r,j}^{MS}} \, \text{Re}\left\{\int_{\Gamma_j}\bm{E}_n^*\cdot\bm{E}_n\,dS\right\}\]
- Substrate-air:
\[\frac{1}{Q^{SA}_j} = \frac{1}{\mathcal{E}^{elec}} \, \frac{1}{4} \, t_j\tan{\delta}_j\left(\varepsilon_{r,j}^{SA} \, \text{Re}\left\{\int_{\Gamma_j}\bm{E}_t^*\cdot\bm{E}_t\,dS\right\} + \frac{1}{\varepsilon_{r,j}^{SA}} \, \text{Re}\left\{\int_{\Gamma_j}\bm{E}_n^*\cdot\bm{E}_n\,dS\right\}\right)\]
where $\bm{E}_n$ denotes the normal field to the interface and $\bm{E}_t = \bm{E}-\bm{E}_n$ denotes the tangential field.
Electrostatic Simulations
For electrostatic simulations, the Maxwell capacitance matrix is computed in the following manner. First, the Laplace equation subject to Dirichlet boundary conditions is solved for each terminal with boundary $\Gamma_i$ in the model, yielding an associated voltage field $V_i(\bm{x})$:
\[\begin{aligned} \nabla\cdot(\varepsilon_r\nabla V_i) &= 0 \,,\; \bm{x}\in\Omega \\ V_i &= 1 \,,\; \bm{x}\in\Gamma_i \\ V_i &= 0 \,,\; \bm{x}\in\Gamma_j \,,\; j\neq i \,. \end{aligned}\]
The energy of the electric field associated with any solution is
\[\mathcal{E}(V_i) = \frac{1}{2}\int_\Omega\varepsilon_r\bm{E}_i\cdot\bm{E}_i\,dV\]
where $\bm{E}_i=-\nabla V_i$ is the electric field. Then, the entries of the Maxwell capacitance matrix, $\bm{C}$, are given by
\[\bm{C}_{ij} = \mathcal{E}(V_i+V_j)-\frac{1}{2}(\bm{C}_{ii}+\bm{C}_{jj}) \,.\]
Magnetostatic Simulations
Magnetostatic problems for inductance matrix extraction are based on the magnetic vector potential formulation:
\[\begin{aligned} \nabla\times(\mu_r^{-1}\nabla\times\bm{A}_i) &= 0 \,,\; \bm{x}\in\Omega \\ \bm{n}\times(\mu_r^{-1}\nabla\times\bm{A}_i) = \bm{n}\times\bm{H}_i &= \bm{J}_s^{inc} \,,\; \bm{x}\in\Gamma_i \\ \bm{n}\times(\mu_r^{-1}\nabla\times\bm{A}_i) &= 0 \,,\; \bm{x}\in\Gamma_j \,,\; j\neq i \,. \end{aligned}\]
For each port with boundary $\Gamma_i$, a unit source surface current $\bm{J}_s^{inc}$ is applied, yielding an associated vector potential solution $\bm{A}_i(\bm{x})$. Homogeneous Dirichlet boundary conditions $\bm{n}\times\bm{A}_i=0$ are also imposed on specified surfaces of the model. The magnetic field energy associated with any solution is
\[\mathcal{E}(\bm{A}_i) = \frac{1}{2}\int_\Omega\mu_r^{-1}\bm{B}_i\cdot\bm{B}_i\,dV\]
where $\bm{B}_i = \nabla\times\bm{A}_i$ is the magnetic flux density.
In a superconducting domain $\Omega_L$, with London penetration depth $\lambda_L$, the static London equations relate the supercurrent to the vector potential, in the London gauge, as $\bm{J} = -(\mu_r\lambda_L^2)^{-1}\bm{A}$. The first equation then becomes
\[\nabla\times(\mu_r^{-1}\nabla\times\bm{A}_i) + (\mu_r\lambda_L^2)^{-1}\bm{A}_i = 0 \,,\; \bm{x}\in\Omega_L\]
and the energy includes the kinetic energy of the supercurrent:
\[\mathcal{E}(\bm{A}_i) = \frac{1}{2}\int_\Omega\mu_r^{-1}\bm{B}_i\cdot\bm{B}_i\,dV + \frac{1}{2}\int_{\Omega_L}(\mu_r\lambda_L^2)^{-1}\bm{A}_i\cdot\bm{A}_i\,dV \,.\]
With the vector potential in the London gauge, every closed loop within a superconducting domain has zero fluxoid: a superconducting ring screens the flux of the sources rather than trapping flux. Then, the entries of the inductance matrix, $\bm{M}$, are given by
\[\bm{M}_{ij} = \frac{1}{I_i I_j}\mathcal{E}(\bm{A}_i+\bm{A}_j) - \frac{1}{2}\left(\frac{I_i}{I_j}\bm{M}_{ii}+\frac{I_j}{I_i}\bm{M}_{jj}\right)\]
where $I_i$ is the excitation current for port $i$, computed by integrating the source surface current $\bm{J}_s^{inc}$ over the surface of the port.
Error estimation and adaptive mesh refinement (AMR)
Error estimation is used to provide element-wise error estimates for AMR, as well as a global error indicator used to terminate AMR iterations or provide an estimate for solution accuracy. A Zienkiewicz–Zhu (ZZ) error estimator based on [5] is implemented, which measures the error in the recovered magnetic field and electric flux density. On element $K$, we have
\[\eta^2_K = \eta_{m,2}^2+\eta_{e,K}^2 = \|\mu_r^{1/2}\bm{R}_{ND}(\mu^{-1}\bm{B}) - (\mu_r^{-1/2}\bm{B})\|_{L^2(\Omega_K)}^2 + \|\varepsilon_r^{-1/2}\bm{R}_{RT}(\varepsilon_r\bm{E}) - (\varepsilon_r^{1/2}\bm{E})\|_{L^2(\Omega_K)}^2\]
where $\bm{R}_{ND}$ and $\bm{R}_{RT}$ are the smooth-space recovery operators which project their argument onto $H(\text{curl})$ and $H(\text{div})$, discretized by Nédélec and Raviart-Thomas elements, respectively. Each projection is orthogonal in the weighted $L^2$ inner product of the norm it is measured in ($\mu_r$ for $\bm{R}_{ND}$, $\varepsilon_r^{-1}$ for $\bm{R}_{RT}$), so the recovered field minimizes the estimate.
Far-field extraction
This feature is based upon Stratton-Chu's transformations [6] in the limit of $kr \gg 1$ (with $k$ wave number and $r$ observation distance). One can show (see below) that, in this limit,
\[r \mathbf{E}_p(\mathbf{r}_0) = \frac{ik}{4\pi} \mathbf{r}_0 \times \int_S [\mathbf{n} \times \mathbf{E} - Z \mathbf{r}_0 \times (\mathbf{n} \times \mathbf{H})] \exp(ik\mathbf{r} \cdot \mathbf{r}_0) dS\]
where:
- $E_p$ is the electric field at the observation point
- $k$ is the wave number
- $r₀$ is the unit vector from source to observation point, parameterized by $(\theta, \phi)$
- $n$ is the surface normal (to $S$)
- $E, H$ are the tangential fields on the surface
- $Z$ is the impedance
The integral is over the exterior surface $S$.
Note, we obtain $r \mathbf{E}_p$ because the electric field decays with $exp(ikr)/r$, so multiplying it by $r$ ensures that the quantity is finite. Note also that the solution is defined up to a global phase factor.
This equation relies on an analytic form for Green's function and is only valid in 3D and if $S$ only crosses isotropic materials.
From $r \mathbf{E}_p$, one can obtain the magnetic field assuming that the waves are propagating in free space,
\[r \mathbf{H}_p = \frac{r_0 \times r \mathbf{E}_p}{Z_0}\,,\]
with $Z_0$ impedance of free space.
With this, one can immediately compute the far-field relative radiation pattern as $|r \mathbf{E}_p|$.
How to obtain the equation above from Stratton-Chu's original equations
Let us start from Stratton-Chu's transformation for the electric field (we will get the magnetic field from $E$):
\[\mathbf{E}(\mathbf{r}_0) = \int_S \left[ i \omega \mu (\mathbf{n} \times \mathbf{H}) g(\mathbf{r}, \mathbf{r}_0) + (\mathbf{n} \times \mathbf{E}) \times \nabla g(\mathbf{r}, \mathbf{r}_0) + (\mathbf{n} \cdot \mathbf{E}) \nabla g(\mathbf{r}, \mathbf{r}_0) \right] dS\]
with Green's function (here is where the assumption of isotropicity comes in):
\[g(\mathbf{r}, \mathbf{r}_0) = \frac{e^{-i k |\mathbf{r} - \mathbf{r}_0|}}{4 \pi |\mathbf{r} - \mathbf{r}_0|}.\]
Let us take the limit for $r \to \infty$ and define $R = |\mathbf{r} - \mathbf{r}_0|$ ($R \to \infty$ when $r \to \infty$). For $r \gg r_0$ (far-field approximation):
\[R \approx r - \mathbf{r}\cdot\mathbf{r}_0\]
where $\mathbf{r}_0 = \mathbf{r}/r$ is the unit vector in the direction of $\mathbf{r}$.
The far-field approximation for Green's function becomes:
\[g(\mathbf{r}, \mathbf{r}_0) \approx \frac{e^{-i k r}}{4 \pi r} e^{i k \mathbf{r}_0\cdot\mathbf{r}}.\]
For the gradient of $g$, we start with the exact expression and expand phase and magnitude to reach:
\[\nabla g(\mathbf{r}, \mathbf{r}_0) = -\frac{e^{-i k R}}{4 \pi R}\left(\frac{1}{R} + i k\right)\hat{R}\]
where $\hat{R} = (\mathbf{r} - \mathbf{r}_0)/R$ is the unit vector pointing from $\mathbf{r}_0$ to $\mathbf{r}$.
In the far-field limit, $R \approx r$ and $\hat{R} \approx \mathbf{r}_0$, so:
\[\nabla g(\mathbf{r}, \mathbf{r}_0) \approx -i k \mathbf{r}_0 g(\mathbf{r}, \mathbf{r}_0)\]
where we've neglected the $1/R$ term since $k R \gg 1$ in the far-field.
With these ingredients, one then uses the triple vector product rule and drops the radial terms (i.e., those proportional to $\mathbf{r}_0$, in the wave zone there are only transverse fields) to arrive at the equation presented in the previous section and implemented in Palace.
References
[1] J.-M. Jin, The Finite Element Method in Electromagnetics, Wiley-IEEE Press, Hoboken, NJ, Third edition, 2014.
[2] P. Monk, Finite Element Methods for Maxwell's Equations, Oxford University Press, Oxford, 2003.
[3] L. Vardapetyan and L. Demkowicz, Full-wave analysis of dielectric waveguides at a given frequency, Mathematics of Computation 72 (2003) 105-129.
[4] J. Wenner, R. Barends, R. C. Bialczak, et al., Surface loss of superconducting coplanar waveguide resonators, Applied Physics Letters 99, 113513 (2011).
[5] S. Nicaise, On Zienkiewicz-Zhu error estimators for Maxwell’s equations, Comptes Rendus Mathematique 340 (2005) 697-702.
[6] J. A, Stratton and L. J. Chu, Diffraction theory of Electromagnetic Waves, Physical Review, 56, 1, (1939), 99-107.
[7] P. Benner, D. C. Sorensen, and V. Mehrmann, Eds., Dimension Reduction of Large-Scale Systems, Lecture Notes in Computational Science and Engineering, vol. 45, Springer, 2005. doi: 10.1007/3-540-27909-1.
[8] A. C. Antoulas, Approximation of Large-Scale Dynamical Systems, SIAM, (2005). doi: 10.1137/1.9780898718713.
[9] D. Pradovera, Toward a certified greedy Loewner framework with minimal sampling, Advances in Computational Mathematics 49, 92 (2023). doi: 10.1007/s10444-023-10091-7.
[10] D. Pradovera, Interpolatory rational model order reduction of parametric problems lacking uniform inf-sup stability, SIAM Journal on Numerical Analysis 58 (2020) 2265-2293. doi: 10.1137/19M1269695.
[11] R. B. Marks and D. F. Williams, A general waveguide circuit theory, J. Res. Natl. Inst. Stan. 97, 533 (1992).
[12] D. M. Pozar, Microwave engineering, Fourth edition. John Wiley & Sons, Hoboken, NJ, 2012.
[13] Y. Su and Z. Bai, Solving rational eigenvalue problems via linearization, SIAM Journal on Matrix Analysis and Applications 32 (2011) 201-216.