tidy3d.ImpedanceCalculator#
- class ImpedanceCalculator[source]#
Bases:
MicrowaveBaseModelTool for computing the characteristic impedance of a transmission line.
- Parameters:
voltage_integral (Optional[Union[
AxisAlignedVoltageIntegral,Custom2DVoltageIntegral]] = None) – Definition of path integral for computing voltage.current_integral (Optional[Union[
AxisAlignedCurrentIntegral,Custom2DCurrentIntegral,CompositeCurrentIntegral]] = 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
Raise validation error if both
voltage_integralandcurrent_integralare not provided.compute_impedance(em_field[, ...])Compute impedance for the supplied
em_fieldusingvoltage_integralandcurrent_integral.compute_voltage_current(em_field)Compute voltage and current for the supplied
em_fieldusingvoltage_integralandcurrent_integral.- voltage_integral#
- current_integral#
- compute_voltage_current(em_field)[source]#
Compute voltage and current for the supplied
em_fieldusingvoltage_integralandcurrent_integral. None is returned for the integral that is not defined.- Parameters:
em_field (
IntegrableMonitorDataType) – The electromagnetic field data that will be used for computing the voltage and current.- Returns:
Tuple of (voltage, current). None is returned for the integral that is not defined.
- Return type:
tuple[VoltageIntegralResultType, CurrentIntegralResultType]
- compute_impedance(em_field, return_voltage_and_current=False)[source]#
Compute impedance for the supplied
em_fieldusingvoltage_integralandcurrent_integral. If only a single integral has been defined, impedance is computed using the total flux inem_field.- Parameters:
em_field (
IntegrableMonitorDataType) – The electromagnetic field data that will be used for computing the characteristic impedance.return_voltage_and_current (bool = False) – When
True, returns additionalIntegralResultTypethat 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). Ifreturn_voltage_and_current=True, tuple of (impedance, voltage, current).- Return type:
IntegralResultTypeor tuple[VoltageIntegralResultType, CurrentIntegralResultType, ImpedanceResultType]