Skip to content

Impedance Calculator

The ImpedanceCalculator computes characteristic impedance from electromagnetic field data. It uses voltage and current path integrals, and it supports three calculation methods.

MethodRequired integralsFormula
V and IVoltage and currentZ0 = V / I
P and VVoltage onlyZ0 = abs(V)^2 / (2 * conjugate(P))
P and ICurrent onlyZ0 = 2 * P / abs(I)^2

P is the complex power flow through the cross-section.

from flex_rf.tidy3d import (
AxisAlignedCurrentIntegral,
AxisAlignedVoltageIntegral,
ImpedanceCalculator,
)
voltage_integral = AxisAlignedVoltageIntegral(
center=(0, 0, 0),
size=(0, 0, 2),
sign="+",
extrapolate_to_endpoints=True,
snap_path_to_grid=True,
)
current_integral = AxisAlignedCurrentIntegral(
center=(0, 0, 0),
size=(4, 2, 0),
sign="+",
snap_contour_to_grid=True,
)
z_calculator = ImpedanceCalculator(
voltage_integral=voltage_integral,
current_integral=current_integral,
)
impedance = z_calculator.compute_impedance(mode_data)

The impedance calculator is commonly used with mode solver results to determine the characteristic impedance of transmission-line modes.

from flex_rf import web
from flex_rf.tidy3d import GridSpec, ModeSimulation
mode_sim = ModeSimulation(
size=(10, 10, 0),
grid_spec=GridSpec.auto(wavelength=0.3),
structures=[...],
monitors=[mode_monitor],
freqs=[1e9, 2e9, 3e9],
)
mode_sim_data = web.run(mode_sim, task_name="mode_solver")
z0 = z_calculator.compute_impedance(mode_sim_data.modes)

Set return_voltage_and_current=True to retrieve impedance, voltage, and current together.

z0, voltage, current = z_calculator.compute_impedance(
mode_data,
return_voltage_and_current=True,
)

If only the voltage or current integral is provided, the calculator uses the complex power flow automatically.

z_calc_v = ImpedanceCalculator(
voltage_integral=voltage_integral,
current_integral=None,
)
z_from_v = z_calc_v.compute_impedance(mode_data)
z_calc_i = ImpedanceCalculator(
voltage_integral=None,
current_integral=current_integral,
)
z_from_i = z_calc_i.compute_impedance(mode_data)

The impedance calculator and path integral classes work with several field-data containers:

Data objectUse
ModeSolverDataMode profiles from a 2D mode solver.
FieldDataFrequency-domain monitor fields.
FieldTimeDataTime-domain monitor fields.
MicrowaveModeSolverDataMicrowave mode solver data with transmission-line quantities.

Flex RF follows the Tidy3D physics phase convention e^{-i omega t}. Some RF simulation tools and textbooks use e^{i omega t}. This affects calculated S-parameters and impedance values. Use complex conjugation to convert between the two conventions.

import numpy as np
z_engineering = np.conjugate(z_physics)
z_physics = np.conjugate(z_engineering)
PageWhy open it
Path IntegralsDefine the voltage and current integrals used by the calculator.
RF Mode AnalysisConfigure impedance calculation directly in a mode spec.