Problem Types

Eigenmode problems

For eigenmode simulations, config["Problem"]["Type"]: "Eigenmode", the user should specify a nonzero (but arbitrarily small) frequency above which to search for eigenmodes. The computed eigenvalues are written to an ASCII file named eig.csv, in the directory specified by config["Problem"]["Output"]. Also in this file are the mode quality factors and errors (absolute and backward) computed for each eigenpair.

With adaptive mesh refinement, the eigenvalue solves of later adaptation iterations can start from the eigenmodes of the previous one, transferred to the refined mesh, and then need fewer Krylov restarts. Setting config["Solver"]["Eigenmode"]["StartVector"] to false turns this off.

With a frequency-dependent permittivity, the eigenvalue problem is nonlinear in the frequency. When the Drude, Debye, Lorentz, and PoleResidue terms of the materials are its only frequency-dependent terms, the default "Hybrid" setting of config["Solver"]["Eigenmode"]["NonlinearType"] solves it as a linear eigenvalue problem, with SLEPc or ARPACK. The linearization that is used for problems with losses gets one more unknown for each pole of a material, on the region of that material [13]. Each of these unknowns is stored as a vector of the size of the whole problem, however small the material: each pole adds the memory of one such vector to every basis vector of the eigenvalue solver. With SLEPc, the modes are then those nearest above Target, as for constant materials, on both sides of a material resonance and where they accumulate at it. ARPACK selects the eigenvalues $\theta = 1/(\lambda-\sigma)$ of the shift-and-invert problem ($\lambda = i\omega$, $\sigma$ at Target) with the smallest imaginary part, which ranks a mode by $\Delta\omega/|\lambda-\sigma|^2$, with $\Delta\omega$ its angular frequency above Target: a strongly damped mode, as in a strongly lossy Drude or Debye material, can be passed over for a mode farther above Target with less loss. Each step of the eigenvalue solver solves one linear system at the target, so the errors in eig.csv cannot be smaller than the accuracy of these solves: with a small config["Solver"]["Eigenmode"]["Tol"], reduce config["Solver"]["Linear"]["Tol"] too. With "NonlinearType": "SLP", or with SLEPc and "PEPLinear": false, the nonlinear eigensolver described next is used instead.

Other frequency-dependent terms are not solved in this way: wave ports, second-order absorbing boundaries, finite conductivity and rational impedance boundaries, absorbing boundaries next to a frequency-dependent material, and DjordjevicSarkar terms. With any of them, for constant and frequency-dependent materials alike, the nonlinear eigensolver of "NonlinearType" is used. With "Hybrid", its starting values come from the same linearization of the pole terms of the materials, with only the other frequency-dependent terms interpolated between Target and TargetUpper. It returns converged modes, but not always the ones nearest the target: a small error for a returned mode does not show that no lower mode was missed. Changing Target, TargetUpper, or the number of modes changes its starting values. It can also converge fewer modes than were requested, for example near a material resonance with a wave port or an absorbing boundary next to the material, or with "SLP" or "PEPLinear": false, which do not linearize the pole terms; the solve then stops with an error. A wave port or an absorbing boundary next to a frequency-dependent material can make it miss modes nearest the target also without a resonance, as with a Debye or Drude material, and Palace warns of such a boundary on this route. A wave port mode solve at a complex frequency that does not converge is fatal.

The divergence-free projection is disabled for frequency-dependent permittivity: a fixed high-frequency projector does not impose the frequency-dependent interface condition, and longitudinal modes at a permittivity zero can be physical. In a material with no conductivity and no London penetration depth, at the complex frequency where its permittivity is zero, every gradient field which vanishes outside that material solves the equations, with no magnetic field. (With a conductivity or a London response, the complete coefficient of the field in the material must vanish, not the permittivity alone.) This eigenvalue is infinitely degenerate in the continuous problem, and its multiplicity in the discrete problem grows with the mesh. A request for modes near it returns these fields, not the electromagnetic modes above them: place Target above the frequency of the zero to pass it. Palace warns which of the computed modes have a magnetic energy below $10^{-8}$ of their electric field energy with $\epsilon_\infty$ (with the permittivity of the constant materials), as these fields do, and keeps them in eig.csv.

Calculations related to energy-participation ratio (EPR) quantization can be performed with Palace when the user specifies lumped ports corresponding to the linearized lumped circuit elements in the model. In this case, the participation matrix for inductive elements is automatically generated for the specified number of modes and number of inductive lumped ports. The participation matrix is output in an ASCII file named port-EPR.csv.

The EPR framework can be used to characterize the dissipative elements in the model as well. In particular, lumped ports with nonzero resistance in the model will trigger coupling rate and quality factor calculations based on input-output (I-O) line coupling loss: By specifying resistive lumped ports in the model, the mode coupling quality factors will be computed as $Q_{ml} = \mathrm{Re}\{\omega_m\}/|\kappa_{ml}|$. The magnitude of the coupling rate $\kappa_{ml}$ is the time-averaged power dissipated in the resistive boundary of port $l$ divided by the total stored energy of mode $m$, twice its time-averaged electric-side energy $U$ (see Energy and postprocessing), and its sign is the sign of the real part of the port current. For a mode whose voltage across the port cancels, this current is at the level of round-off and the sign has no meaning: only the magnitude does. This power includes field that does not match the voltage mode of the port, so when the port does not match the field it can be much larger than the I-O line coupling loss $|V_{ml}|^2/(2R_l)$. The output file port-Q.csv will be created in the output directory containing these mode quality factor contributions. For bulk and interface dielectric loss calculations, which are not unique to the eigenmode simulation type, see the sections Domain postprocessing and Boundary postprocessing of this guide.

Driven problems in the frequency domain

For frequency domain driven simulations, config["Problem"]["Type"]: "Driven", the model is excited by a time harmonic incident field (port boundary) or surface current. The user can specify a port excitation using lumped ports or numeric wave ports.

The default frequency sweep behavior for frequency domain driven simulations is to perform a uniform sampling from the minimum to the maximum specified frequency of interest, using the user specified step size. An adaptive fast frequency sweep strategy can also be used, activated by specifying a nonzero value for "AdaptiveTol" under the config["Solver"]["Driven"] object. In this case, using the high-dimensional model solution computed at a few automatically selected frequency samples, a low-cost model is constructed and used to compute the frequency response over the entire frequency range of interest. The specified error tolerance ensures that the approximate low-cost model is reliably accurate relative to the high-dimensional model within the frequency band of interest. This is particularly useful for fine-resolution sweeps containing many sample points, where it can yield a significant speedup over the default strategy.

Port scattering parameters, or S-parameters, are postprocessed for the column of the scattering matrix corresponding to the driven port index automatically for this simulation type and stored in an ASCII file named port-S.csv, in the directory specified by config["Problem"]["Output"]. Both the $\text{dB}$ magnitude ($20\log_{10}(|S_{ij}|)$) and the phase $\angle(S_{ij})$ (in degrees) are written to the file. In the case that more than a single lumped or wave port is excited or surface current excitations are used, scattering parameter output will be disabled for the simulation (though other quantities of interest are still postprocessed). When lumped ports are present, the peak complex lumped port voltages and currents computed for each excitation frequency are written to ASCII files named port-V.csv and port-I.csv, respectively, Additionally, the surface current excitations are written to surface-I.csv.

It is often the case that a user wants to compute the entire scattering matrix rather than just a single column. In this case, each column can be computed in parallel by running Palace multiple times. For example, consider the following short Python code which modifies a base configuration file config.json to generate a complete 4x4 scattering matrix by running 4 Palace simulations, each with 2 MPI processes:

import json
import os
import subprocess

# Base configuration file
config_path = "config.json"

for i in range(4):
    # Prepare configuration file for simulation
    with open(config_path, "r") as f:
        config_json = json.loads(f.read())
    for port in config_json["Boundaries"]["LumpedPort"]:
        port["Excitation"] = (1+i == port["Index"])

    # Write new config file
    config_path_i = os.path.splitext(config_path)[0] + f"-{1+i}.json"
    with open(config_path_i, "w") as f:
        f.write(json.dumps(config_json))

    # Run Palace simulation (alternatively, use Popen and wait)
    subprocess.run(["palace", "-np", 2, config_path_i])

Driven problems in the time domain

The previous simulation types describe simulations based on frequency domain formulations of Maxwell's equations. Time domain simulations are also possible through the transient simulation type: config["Problem"]["Type"]: "Transient".

Similar to the driven simulation type in the frequency domain, transient simulations involve simulating the response of the system to a time-dependent excitation field specified at lumped ports or surface current excitations in the model. The system is always started from rest with zero initial conditions and time-integrated for a user specified duration, given in nanoseconds. There are several available excitation types which define the time dependence of the pulse or excitation waveform. These are specified under the config["Solver"]["Transient"] object using the "Excitation" keyword.

The time histories of the lumped port voltages and currents are postprocessed and automatically written to ASCII files named port-V.csv and port-I.csv, respectively, in the directory specified by config["Problem"]["Output"]. Additionally, surface current excitation time histories are written to surface-I.csv.

Electrostatic problems

For electrostatic simulations, (config["Problem"]["Type"]: "Electrostatic", the user should specify a number of terminal boundaries (config["Boundaries"]["Terminal"]) as well as boundaries which are grounded (config["Boundaries"]["Ground"]). For each terminal, an electrostatic field is computed by assigning the terminal of interest a positive unit voltage and all other terminals and grounded boundaries a zero voltage. The resulting fields are then used to compute the Maxwell capacitance matrix and its inverse, which are written to an ASCII file named terminal-C.csv and terminal-Cinv.csv, respectively, in the directory specified by config["Problem"]["Output"]. The mutual capacitance matrix is also computed and written to terminal-Cm.csv in the same directory.

Magnetostatic problems

For magnetostatic simulations (config["Problem"]["Type"]: "Magnetostatic"), the user can specify excitations using either surface current boundaries or flux loop boundaries.

Surface current boundaries: Specify a number of source current boundaries to apply unit currents to specified surfaces. For each current source, a magnetostatic field is computed by applying a unit current to the source of interest. Surfaces which are expected to carry current should be labeled as perfectly conducting (PEC), which prescribes a zero magnetic flux, or magnetic insulation, boundary condition.

The treatment of the inactive current ports during each step of the sweep is controlled by config["Solver"]["Magnetostatic"]["InactivePorts"]. The default, "Open", applies a natural (zero surface current) boundary condition so that no current flows across an inactive port. Setting "Short" instead treats inactive ports as perfect conductors (PEC), allowing induced screening currents to flow across them. The mode can be overridden on a per-port basis using config["Boundaries"]["SurfaceCurrent"]["InactiveMode"], which takes precedence over the global default for that port.

The inactive-port treatment affects which inductance entries are well-defined. A port that is "Open" when inactive is never an essential (Dirichlet) boundary, so every excitation of an "Open" port is solved with the same operator (any "Short" ports acting as fixed screening conductors) and only the right-hand side changes. The resulting mutual entries are reciprocal and represent the mutual inductance in the presence of the shorted screens. A port that is "Short" when inactive, by contrast, is added to the essential set on every step except the one that excites it, so exciting a "Short" port uses a different operator than the other excitations; its cross-energy with another column mixes two different boundary-value problems and does not correspond to a reciprocal mutual inductance.

Palace therefore reports the self-inductance (diagonal) for every port, but writes a mutual inductance $M_{ij}$ only between ports that are both "Open" when inactive. Off-diagonal entries involving a "Short" port are written as NaN, and terminal-Minv.csv and terminal-Mm.csv are computed over the reciprocal "Open"-"Open" sub-block only (their "Short"-port rows and columns are likewise NaN). With all ports "Open" (the default) this reduces to the usual full, symmetric inductance matrix (no screening boundaries).

Flux loop boundaries (config["Boundaries"]["FluxLoop"]): Prescribe magnetic flux through specified holes in conducting surfaces. For each flux loop, a magnetostatic field is computed by applying flux through the loop of interest, leaving all other flux loops with zero flux. Loops can instead be driven together as one excitation, in which case the stored energy of that state is reported in place of the inductance matrix; see the flux boundary.

Surface-current and flux-loop excitations can be combined in the same magnetostatic simulation, in which case the two excitation types are driven with complementary constraints: a current excitation holds every flux loop at zero flux, while a flux excitation leaves every current port open. As a result the reported self-inductances are not directly the entries of a single inductance matrix — the current-port block comes out screened by the zero-flux loops (a Schur complement) and the flux-loop block comes out as a reluctance — and the coupling between the two types is invisible to the energy-based formula, because a current state carries no loop flux and a flux state carries no port current, making the two states energy-orthogonal.

To recover a single inductance matrix in henries, Palace measures the coupling directly. Every surface-current element must specify an "Aperture" with "Attributes" tiling a surface spanning that element's current loop and a Cartesian "Direction" defining its positive orientation. The direction accepts the usual "+X", "-X", and similar Cartesian shorthands or a nonzero three-vector. It selects the sign of the local geometric normal in the surface integral $\int \bm{B}\cdot\hat{n}\,dS$; it is not a direction onto which $\bm{B}$ is projected. The aperture direction and the element's current "Direction" should follow the right-hand rule so that positive current and positive linked flux are conjugate coordinates.

For a multielement surface-current port, each element owns its aperture. Because the unit port current is divided equally between its parallel elements, Palace combines their linked fluxes using the same weights rather than summing them. The selected aperture surfaces may be tiled by several attributes, but each must admit a consistent orientation by its reference direction. A direction tangent to the surface is rejected.

Writing $\bm{G}$ for the matrix of these linked fluxes normalized by the driving fluxes, the blocks are converted as $\bm{M}_{ff} = \bm{H}_{ff}^{-1}$, $\bm{M}_{cf} = \bm{G}\bm{M}_{ff}$, and $\bm{M}_{cc} = \bm{H}_{cc} + \bm{G}\bm{M}_{ff}\bm{G}^T$, where the last term un-screens the current-port block. Only the flux-flux block is inverted, exactly as in the flux-only case. The aperture flux can contain nearly cancelling contributions and may therefore converge more slowly under mesh refinement than energy-based diagonal entries.

Mixed extraction requires a complete aperture for every current element and requires every current port's effective "InactiveMode" to be "Open". Invalid or incomplete combinations are rejected rather than producing a matrix containing a mixture of bare, screened, and unknown entries.

Superconductors: A superconducting conductor is modeled either as a "Superconductor" boundary, a sheet with the kinetic sheet inductance of a film, or as a domain whose material has a "LondonDepth", in which the London supercurrent flows (see the reference). The domain model resolves the current through the conductor, so it holds for any thickness and width, including strips a few penetration depths thick and wide where the sheet models do not apply, but its elements must resolve the penetration depth at the conductor surfaces. In both, the inductance includes the kinetic energy of the supercurrent, which the magnetic field energies in domain-E.csv do not. Superconducting loops hold zero fluxoid, except the holes of films driven by a flux loop, which therefore must not touch a London domain.

When running on GPU, the 2D surface curl solve for flux loop boundary conditions is performed on the host while the main 3D magnetostatic solve uses GPU acceleration.

The resulting fields are used to compute the inductance matrix and its inverse, which are written to an ASCII file named terminal-M.csv and terminal-Minv.csv, respectively, in the directory specified by config["Problem"]["Output"]. A "mutual" inductance matrix which has the same form as the mutual capacitance matrix (its entries are based on current differences between ports rather than absolute currents) is computed and written to terminal-Mm.csv in the same directory.

Mode analysis problems

For mode analysis simulations, config["Problem"]["Type"]: "BoundaryMode", Palace computes the propagation constants and field profiles of guided electromagnetic modes on a 2D waveguide cross-section at a specified operating frequency. This is useful for characterizing transmission line parameters such as effective index, characteristic impedance, and per-unit-length inductance and capacitance.

The mode analysis solver accepts either a native 2D mesh or extracts a 2D cross-section submesh from a 3D mesh. In the latter case, the user specifies config["Solver"]["BoundaryMode"]["Attributes"] to identify the 3D boundary faces from which the 2D submesh is extracted. Boundary conditions from the parent 3D problem (PEC, impedance, conductivity, absorbing) are automatically transferred to the submesh.

The user specifies an operating frequency and optionally a target effective index under config["Solver"]["BoundaryMode"]. When the target is zero, it is computed automatically from the material properties. The eigenvalue solver uses a shift-and-invert spectral transformation to find modes near the target.

The computed propagation constants $k_n$ and effective indices $n_\text{eff} = k_n / k_0$ (where $k_0 = \omega / c_0$ is the free-space wavenumber) are written to an ASCII file named mode-kn.csv, in the directory specified by config["Problem"]["Output"]. Both backward and absolute error estimates are included for each eigenvalue. For a mode below cutoff, $k_n$ is the root with $\text{Im}\{k_n\} < 0$, for which the mode decays in the direction of propagation.

When impedance postprocessing boundaries are specified under config["Boundaries"]["Postprocessing"]["Impedance"], the complex characteristic impedance is computed using the power-voltage definition $Z_\text{PV} = |V|^2 / (2P^*)$, with the complex time-averaged power $P$ of the mode, and, when a current path is also specified, the voltage-current definition $Z_\text{VI} = V / I$ (see the reference for details). The per-unit-length inductance $L = \text{Re}\{n_\text{eff} Z\} / c_0$ and capacitance $C = \text{Re}\{n_\text{eff} / Z\} / c_0$ are derived from each impedance $Z$, from the series impedance $i k_n Z = R + i\omega L$ and shunt admittance $i k_n / Z = G + i\omega C$ per unit length of the line. The results are written to mode-Z.csv. Similarly, when voltage postprocessing boundaries are specified under config["Boundaries"]["Postprocessing"]["Voltage"], the complex mode voltages are written to mode-V.csv.

Domain energy postprocessing for energy participation ratios is also available, as described in Domain postprocessing.