Sources#
Overview#
Sources in Tidy3D provide the necessary excitation to investigate the EM behaviour of the structures under simulation. The type of source used in a simulation tends to very application-specific. For instance, a PlaneWave
source may be used for a unit cell simulation in a metalens; whereas a ModeSource
would be more appropriate for a waveguide crossing problem.
A generic source can be thought of as composed of two parts: a spatial profile and a temporal profile. The former dictates the field distribution in space, whereas the latter determines the frequency band covered by the source, and by extension, the overall simulation.
The following section describes how to specify source time-dependence:
The following sections describe the available spatial source distributions in Tidy3D:
Source Time Dependence#
Source time dependence that describes a Gaussian pulse. |
|
Source time dependence that ramps up to continuous oscillation and holds until end of simulation. |
|
Base class describing the time dependence of a source. |
|
Custom source time dependence consisting of a real or complex envelope modulated at a central frequency, as shown below. |
Each source requires the source_time
parameter to be defined, which provides the time-dependence of the source.
# frequency information
my_center_frequency = 200e12 # center frequency in Hz
my_bandwidth = 20e12 # bandwidth
# my source time
my_source_time = GaussianPulse(
freq0=my_center_frequency,
fwidth=my_bandwidth
)
# a point dipole source
my_dipole_source = PointDipole(
center=(0,0,0),
source_time=my_source_time,
polarization='Ex'
)
In the example above, we defined a PointDipole
source with a modulated Gaussian pulse time-dependence. This is well-suited for simulations with a specified center frequency and bandwidth, and thus is by far the most common type of time-dependence used.
For niche applications, the user may wish to define a ContinuousWave
excitation or even a CustomSourceTime
function. Please refer to their respective documentation page for more details.
Dipole and Uniform Current#
Uniform current source with a zero size. |
|
Source in a rectangular volume with uniform time dependence. |
The PointDipole
represents an infinitesimally small isotropic radiator.
my_point_dipole = PointDipole(
center=(0,0,0),
source_time=my_source_time,
polarization='Ex'
)
The UniformCurrentSource
represents a 1D line, 2D sheet, or 3D box of uniform current.
# define a 2D sheet of current polarized in the z-direction
my_uniform_current_source = UniformCurrentSource(
center=(0,0,0),
size=(1,0,1),
source_time=my_source_time,
polarization='Ez'
)
See also
Example applications:
Plane Wave#
Uniform current distribution on an infinite extent plane. |
The PlaneWave
class represents an incident plane wave of a certain polarization and orientation. This is typically used in conjunction with periodic boundary conditions, e.g. in a unit cell simulation.
# define a x-polarized plane wave travelling at a 45 degree angle
# from the positive z-axis
my_plane_wave_source = PlaneWave(
center=(0,0,-1),
size=(td.inf, td.inf, 0), # extend source to simulation edge
source_time=my_source_time,
direction='+',
angle_theta=np.pi/4,
pol_angle=0,
)
See also
For more detailed explanation and examples, please see the following learning center resources:
Example applications:
Gaussian Beam#
Gaussian distribution on finite extent plane. |
|
The simple astigmatic Gaussian distribution allows both an elliptical intensity profile and different waist locations for the two principal axes of the ellipse. |
The GaussianBeam
and AstigmaticGaussianBeam
classes implement the paraxial form of the Gaussian beam.
# define a y-polarized gaussian beam propagating in the +x direction
# with waist radius = 3 um
my_gaussian_beam = GaussianBeam(
size=(0,10,10), # size of the source plane
direction='+',
source_time=my_source_time,
pol_angle=0,
waist_radius=3,
waist_distance=5,
)
Note
The paraxial approximation to the Gaussian beam is only appropriate when the waist_radius
is larger than the source wavelength.
Mode Source#
Injects current source to excite modal profile on finite extent plane. |
|
Stores specifications for the mode solver to find an electromagntic mode. |
|
PEC source frame. |
The ModeSource
class represents a propagating mode in a given structure cross section.
Behind the scenes, the desired mode is initially obtained by running the mode solver on the ModeSource
plane. The ModeSpec
class provides the settings for the mode solver. Once the desired mode is found, it is injected into the 3D simulation along the plane normal. The user does not need to evoke the mode solver explicitly; it is performed automatically whenever a ModeSource
or ModeMonitor
is included in a Tidy3D simulation.
# custom mode specification tells the mode solver to search for
# two modes around effective index = 1.5
my_mode_spec = ModeSpec(num_modes=2, target_neff=1.5)
# custom mode source injects the first mode along the +x direction
my_mode_source = ModeSource(
size=(0,10,10),
source_time=my_source_time,
direction='+',
mode_spec=my_mode_spec,
mode_index=0,
)
See also
For more detailed explanation and examples, please see the following learning center resources:
For a short introduction to the use of mode sources, see the following FDTD101 lecture:
Total-Field/Scattered-Field (TFSF)#
Total-field scattered-field (TFSF) source that can inject a plane wave in a finite region. |
The TFSF
class represents an incident plane-wave wave source that is confined to a specific TFSF region. This type of source is typically used for scattering simulations. Within the TFSF region, the overall field comprises of the incident plane wave and the scattered field. At the edges of the TFSF region, the incident plane wave field is deliberately cancelled out, such that outside the TFSF region, the total field only contains the scattered field.
See also
For more detailed explanation and examples, please see the following learning center resource:
Example applications:
User-defined#
Implements a source corresponding to an input dataset containing |
|
Implements a source corresponding to an input dataset containing |
It is possible to define an arbitrary field source in Tidy3D using CustomFieldSource
or CustomCurrentSource
. Possible usage scenarios include defining a field profile that is not currently available in Tidy3D, or injecting a source that is based on the output of a previous simulation.
Please see the learning center article linked below for more details.
See also
For more detailed explanation and examples, please see the following learning center resource: