tidy3d.plugins.microwave.ImpedanceCalculator#

class ImpedanceCalculator[source]#

Bases: MicrowaveBaseModel

Tool for computing the characteristic impedance of a transmission line.

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().

  • voltage_integral (Union[AxisAlignedVoltageIntegral, Custom2DVoltageIntegral, NoneType] = None) – Definition of path integral for computing voltage.

  • current_integral (Union[AxisAlignedCurrentIntegral, Custom2DCurrentIntegral, CompositeCurrentIntegral, NoneType] = None) – Definition of contour integral for computing current.

Example

Create a calculator with both voltage and current path integrals defined.

>>> v_int = AxisAlignedVoltageIntegral(
...     center=(0, 0, 0),
...     size=(0, 0, 2),
...     sign="+",
...     extrapolate_to_endpoints=True,
...     snap_path_to_grid=True,
... )
>>> i_int = AxisAlignedCurrentIntegral(
...     center=(0, 0, 0),
...     size=(1, 1, 0),
...     sign="+",
...     extrapolate_to_endpoints=True,
...     snap_contour_to_grid=True,
... )
>>> calc = ImpedanceCalculator(voltage_integral=v_int, current_integral=i_int)

You can also define only one of the integrals. At least one is required.

>>> _ = ImpedanceCalculator(voltage_integral=v_int)

Attributes

Methods

check_voltage_or_current(val,Β values)

Raise validation error if both voltage_integral and current_integral are not provided.

compute_impedance(em_field[,Β ...])

Compute impedance for the supplied em_field using voltage_integral and current_integral.

Inherited Common Usage

voltage_integral#
current_integral#
compute_impedance(em_field, return_voltage_and_current=False)[source]#

Compute impedance for the supplied em_field using voltage_integral and current_integral. If only a single integral has been defined, impedance is computed using the total flux in em_field.

Parameters:
  • em_field (IntegrableMonitorDataType) – The electromagnetic field data that will be used for computing the characteristic impedance.

  • return_voltage_and_current (bool) – When True, returns additional IntegralResultType that represent the voltage and current associated with the supplied fields.

Returns:

If return_voltage_and_current=False, single result of impedance computation over remaining dimensions (frequency, time, mode indices). If return_voltage_and_current=True, tuple of (impedance, voltage, current).

Return type:

IntegralResultType or tuple[VoltageIntegralResultType, CurrentIntegralResultType, ImpedanceResultType]

classmethod check_voltage_or_current(val, values)[source]#

Raise validation error if both voltage_integral and current_integral are not provided.

__hash__()#

Hash method.