Skip to content

Monitors

This page describes user-defined monitors in Flexcompute RF (also Flex RF).

The full space-time distribution of the electromagnetic (EM) field is typically too large to efficiently store on disk or send over the cloud. Instead, we use monitors to record specific subsets of the field distribution, or derived quantities, that are relevant to our simulation goals.

Use the FieldMonitor to record the EM field within a spatial region at certain frequency points. Field monitors are allowed to be 0D, 1D, 2D, or 3D, depending on how many components of their size attribute are set to zero.

# Define a 2D field monitor at frequencies f_min, f0
my_field_monitor = FieldMonitor(
center=(0,0,0),
size=(10,10,0),
name='My field monitor',
freqs=[f_min, f0],
)

Use the FieldTimeMonitor to record the field at a specified time interval. Use interval to control the number of solver time steps between each recording.

# Define a 1D field-time monitor starting at 0.5ns, recording every 500 time steps
my_fieldtime_monitor = FieldTimeMonitor(
center=(0,0,0),
size=(10,0,0),
name='My fieldtime monitor',
start=0.5e-9,
interval=500, # number of solver time steps between each measurement
)

The FluxMonitor records EM flux through a 2D surface or 3D bounding box at specified frequency points. The FluxTimeMonitor does the same at a specified time interval.

# Define 2D flux monitor at frequency f0 to record power flux in the +z direction
my_flux_monitor = FluxMonitor(
center=(0,0,0),
size=(10,10,0),
name='My flux monitor',
normal_dir='+',
freqs=[f0],
)
# Define a 3D flux-time monitor to record outgoing power vs time
my_fluxtime_monitor = FluxTimeMonitor(
center=(0,0,0),
size=(10,10,10),
name='My flux-time monitor',
interval=500,
)

The DiffractionMonitor records the diffraction coefficients of the allowed diffraction orders in a periodic simulation.

# Define a diffraction monitor at 20 freq points between 50 and 100 GHz
# for outgoing fields in the +z direction
my_diffraction_monitor = DiffractionMonitor(
center=(0,0,10),
size=(100, 100, 0),
freqs=np.linspace(50e9, 100e9, 20),
name='My diffraction monitor',
normal_dir='+',
)

The DirectivityMonitor projects the simulated near-field into the far-field and calculates common antenna metrics, such as gain, directivity, polarization, and axial ratio. For best results, the DirectivityMonitor should always enclose the structure of interest completely, and its center should coincide with the radiation phase center.

# Define elevation and azimuthal angular observation points
# Theta is the elevation angle and defined relative to global +z axis
theta = np.linspace(0, np.pi, 101)
# Phi is the azimuthal angle and defined relative to global +x axis
phi = np.linspace(-np.pi, np.pi, 201)
# Create the DirectivityMonitor
my_directivity_monitor = DirectivityMonitor(
center=(0, 0, 0),
size=(500, 500, 500),
freqs=[f_target],
name="My directivity monitor",
phi=phi,
theta=theta,
)
# Include the directivity monitor in the TerminalComponentModeler
my_tcm = TerminalComponentModeler(
radiation_monitors = [my_directivity_monitor],
...
)

Unlike the other user-defined monitors on this page, the DirectivityMonitor should typically be used in the radiation_monitors parameter of the TerminalComponentModeler, instead of the monitors parameter of the base Simulation.

The SurfaceFieldMonitor records EM fields on PEC (PECMedium) and lossy metal (LossyMetalMedium) surfaces within a 3D region at specified frequency points. The SurfaceFieldTimeMonitor does the same except at a specified time interval. These monitors store the normal E- and tangential H-fields on these surfaces.

# Define a frequency-domain surface field monitor
my_surface_monitor = SurfaceFieldMonitor(
center=(0, 0, 10),
size=(50, 50, 50),
fields=['E', 'H'],
freqs=[1e9, 10e9],
name='surface_monitor',
)
# Define a time-domain surface field monitor
my_surface_time_monitor = SurfaceFieldTimeMonitor(
center=(0, 0, 10),
size=(50, 50, 50),
fields=['H'],
start=1e-13,
stop=5e-13,
interval=500,
name='surface_time_monitor',
)

The PermittivityMonitor is used to record local relative permittivity data in the region of interest. These data can be useful for post-simulation calculations that require permittivity values, such as absorption density.

my_permittivity_monitor = PermittivityMonitor(
center=(0,0,0),
size=(8,8,8),
freqs=[1e9, 10e9],
name='my permittivity monitor',
)