Impedance Calculator
The
ImpedanceCalculator
computes characteristic impedance from electromagnetic field data. It uses
voltage and current path integrals, and it supports three calculation methods.
| Method | Required integrals | Formula |
|---|---|---|
| V and I | Voltage and current | Z0 = V / I |
| P and V | Voltage only | Z0 = abs(V)^2 / (2 * conjugate(P)) |
| P and I | Current only | Z0 = 2 * P / abs(I)^2 |
P is the complex power flow through the cross-section.
Basic Usage
Section titled “Basic Usage”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)With Mode Solver Data
Section titled “With Mode Solver Data”The impedance calculator is commonly used with mode solver results to determine the characteristic impedance of transmission-line modes.
from flex_rf import webfrom 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)Voltage And Current Output
Section titled “Voltage And Current Output”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,)Single Integral Calculation
Section titled “Single Integral Calculation”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)Compatible Data
Section titled “Compatible Data”The impedance calculator and path integral classes work with several field-data containers:
| Data object | Use |
|---|---|
ModeSolverData | Mode profiles from a 2D mode solver. |
FieldData | Frequency-domain monitor fields. |
FieldTimeData | Time-domain monitor fields. |
MicrowaveModeSolverData | Microwave mode solver data with transmission-line quantities. |
Phase Convention
Section titled “Phase Convention”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)Related Pages
Section titled “Related Pages”| Page | Why open it |
|---|---|
| Path Integrals | Define the voltage and current integrals used by the calculator. |
| RF Mode Analysis | Configure impedance calculation directly in a mode spec. |