tidy3d.plugins.smatrix.LumpedPort#

class LumpedPort[source]#

Bases: AbstractLumpedPort, Box

Class representing a single rectangular lumped port

Parameters:
  • attrs (dict = {}) – Dictionary storing arbitrary metadata for a Tidy3D object. This dictionary can be freely used by the user for storing data without affecting the operation of Tidy3D as it is not used internally. Note that, unlike regular Tidy3D fields, attrs are mutable. For example, the following is allowed for setting an attr obj.attrs['foo'] = bar. Also note that Tidy3D` will raise a TypeError if attrs contain objects that can not be serialized. One can check if attrs are serializable by calling obj.json().

  • center (Union[tuple[Union[float, autograd.tracer.Box], Union[float, autograd.tracer.Box], Union[float, autograd.tracer.Box]], Box] = (0.0, 0.0, 0.0)) – [units = um]. Center of object in x, y, and z.

  • size (Union[tuple[Union[pydantic.v1.types.NonNegativeFloat, autograd.tracer.Box], Union[pydantic.v1.types.NonNegativeFloat, autograd.tracer.Box], Union[pydantic.v1.types.NonNegativeFloat, autograd.tracer.Box]], Box]) – [units = um]. Size in x, y, and z directions.

  • name (ConstrainedStrValue) – Unique name for the port.

  • impedance (Union[tidycomplex, ComplexNumber] = 50) – [units = ohm]. Reference port impedance for scattering parameter computation.

  • num_grid_cells (Optional[PositiveInt] = 3) – Number of mesh grid cells associated with the port along each direction, which are added through automatic mesh refinement. A value of None will turn off automatic mesh refinement.

  • voltage_axis (Literal[0, 1, 2]) – Specifies the axis along which the E-field line integral is performed when computing the port voltage. The integration axis must lie in the plane of the port.

Example

>>> port1 = LumpedPort(center=(0, 0, 0),
...             size=(0, 1, 2),
...             voltage_axis=2,
...             name="port_1",
...             impedance=50
...         )

Attributes

current_axis

Integration axis for computing the port current via the magnetic field.

injection_axis

Injection axis of the port.

attrs

Methods

compute_current(sim_data)

Helper to compute current flowing through the port.

compute_voltage(sim_data)

Helper to compute voltage across the port.

to_current_monitor(freqs, snap_center)

Field monitor to compute port current.

to_load(snap_center)

Create a load resistor from the lumped port.

to_source(source_time, snap_center, grid)

Create a current source from the lumped port.

to_voltage_monitor(freqs, snap_center)

Field monitor to compute port voltage.

Inherited Common Usage

voltage_axis#
property injection_axis#

Injection axis of the port.

property current_axis#

Integration axis for computing the port current via the magnetic field.

to_source(source_time, snap_center, grid)[source]#

Create a current source from the lumped port.

to_load(snap_center)[source]#

Create a load resistor from the lumped port.

to_voltage_monitor(freqs, snap_center)[source]#

Field monitor to compute port voltage.

to_current_monitor(freqs, snap_center)[source]#

Field monitor to compute port current.

compute_voltage(sim_data)[source]#

Helper to compute voltage across the port.

compute_current(sim_data)[source]#

Helper to compute current flowing through the port.

__hash__()#

Hash method.