Sources and monitors

How Maxwell excites fields with a spatial source and a time signal, and how monitors turn time-stepped fields into frequency-domain outputs.

A source puts energy into the grid and a monitor records what the fields do. In FDTD both are tied to time: sources follow a time signal, and monitors accumulate a running discrete Fourier transform (DFT) of the fields at the frequencies you ask for. This page explains that model so you can choose sources, frequencies and monitors that fit each other.

A source is a shape plus a time signal#

Every source has two parts:

  1. Where and how it injects: the source class. PointDipole drives one field component at a point; PlaneWave, GaussianBeam and AstigmaticGaussianBeam launch a wave from a plane; ModeSource launches a waveguide mode; TFSF separates total and scattered fields inside a box or slab; UniformCurrentSource, CustomCurrentSource and CustomFieldSource take your own currents or fields.
  2. When: a source-time object passed as source_time=.
Source timeSignalTypical use
CW(frequency, amplitude=1.0, phase=0.0)Continuous sinusoidOne frequency, steady state
GaussianPulse(frequency, fwidth, ...)Gaussian-modulated carrierBroadband: many frequencies from one run
RickerWavelet(...)Second derivative of a GaussianBroadband, no DC content
CustomSourceTime(...)Your own samples or callableMeasured or designed waveforms

A GaussianPulse is centred at frequency and its spectrum spreads over a band set by fwidth. One broadband run gives the response at every frequency inside that band, which is why FDTD is efficient for spectra. A CW source gives one frequency and needs enough cycles to reach steady state.

Full parameter lists are on the Sources API page; Choose sources and waveforms covers the trade-offs.

Frequencies and the DFT#

Simulation.fdtd(scene, frequencies=[...]) sets the default frequencies, in hertz, at which monitors record. While the solver steps, it multiplies the fields by a complex exponential at each frequency and sums them, so at the end each monitor holds a complex phasor per frequency. Choose frequencies inside the source band: outside it the source has no energy and the result is noise.

A monitor can override the frequencies with its own frequencies= argument.

SpectralSampler(window=..., normalize_source=False) controls the DFT:

  • window="hanning" (the default) weights the samples with a Hann window over the sampling interval. "ramp" applies a raised-cosine ramp over the first 10 % of the interval and full weight after it. "none" keeps the plain sum, which is the natural choice for a pulse that has fully decayed by the end of the run.
  • normalize_source=True divides the recorded spectra by the incident source spectrum. All sources must then share one spectrum.

Monitors#

A monitor is declared on the scene with a name and read back with result.monitor(name), which returns a dictionary of tensors.

MonitorRecords
PointMonitor(name, position, fields=("Ez",))Field phasors at one point
PlaneMonitor(name, axis, position, fields, frequencies)Field phasors on a full grid plane
FinitePlaneMonitorField phasors on a bounded rectangle
FluxMonitor(name, axis, position, frequencies, normal_direction="+")Power through a plane (Poynting flux)
FieldTimeMonitor, FluxTimeMonitorTime-domain samples instead of phasors
ModeMonitorOverlap with waveguide modes (experimental)
DiffractionMonitorPower in each diffraction order of a periodic structure
ClosedSurfaceMonitorTangential fields on a closed box, for near-to-far field transforms
DipoleEmissionMonitorEmitted power of a dipole, for Purcell factors
PermittivityMonitor, MediumMonitorThe compiled material on a region
PowerLossMonitor, IncidentPowerDensityMonitor, BreakdownMonitor, ComponentStressMonitor, WireMonitorAbsorbed power, exposure, breakdown, component stress, thin-wire currents

Monitors cost memory for every frequency and component they keep, and plane monitors cost one complex plane each. Request only the components you need. full_field_dft=True on Simulation.fdtd records the whole grid, which is convenient for plots but the most expensive option.

The Monitors API lists the arguments and the dictionary keys each monitor returns.

From monitors to engineering quantities#

Monitor data feed the postprocessing functions in witwin.maxwell.postprocess: near-to-far field transforms, directivity, bistatic radar cross section, S-parameters, mode overlaps, Purcell factors and SAR. Most of them take the Result or a monitor dictionary and return tensors, so they stay differentiable. See Far field, directivity and RCS and the Postprocess API.

Ports#

For RF work, ports combine a source and a monitor at one reference plane: ModePort and WavePort for waveguide modes, LumpedPort and TerminalPort for a voltage gap between conductors. A port records incident and reflected waves, so the result carries S-parameters directly. See Mode ports and S-parameters and Lumped ports and RF networks.