Path Integrals
Path integrals compute voltage and current from electromagnetic field data by integrating electric and magnetic fields along specified paths. They are used to characterize transmission lines and to compute characteristic impedance.
Voltage Path Integrals
Section titled “Voltage Path Integrals”Voltage path integrals compute voltage by integrating the electric field along a line path.
V = - integral(E dot dl)Use
AxisAlignedVoltageIntegral
for a simple axis-aligned path.
from flex_rf import webfrom flex_rf.tidy3d import AxisAlignedVoltageIntegral
voltage_integral = AxisAlignedVoltageIntegral( center=(0, 0, 0), size=(0, 0, 2.0), sign="+", extrapolate_to_endpoints=True, snap_path_to_grid=True,)
mode_data = web.run(mode_solver, task_name="mode_solver")voltage = voltage_integral.compute_voltage(mode_data)Use
Custom2DVoltageIntegral
for a path defined by vertices in a 2D plane.
import numpy as npfrom flex_rf.tidy3d import Custom2DVoltageIntegral
vertices = np.array([ [0, 0], [0, 1], [1, 1],])
custom_voltage = Custom2DVoltageIntegral( axis=2, position=0.0, vertices=vertices,)
voltage = custom_voltage.compute_voltage(mode_data)The sign parameter determines integration direction. Use "+" to integrate
toward the positive axis and "-" to integrate toward the negative axis.
Current Path Integrals
Section titled “Current Path Integrals”Current path integrals compute current using Ampere’s circuital law by integrating the magnetic field around a closed contour.
I = contour_integral(H dot dl)Use
AxisAlignedCurrentIntegral
for a rectangular loop.
from flex_rf.tidy3d import AxisAlignedCurrentIntegral
current_integral = AxisAlignedCurrentIntegral( center=(0, 0, 0), size=(3, 2, 0), sign="+", snap_contour_to_grid=True,)
current = current_integral.compute_current(mode_data)Use
Custom2DCurrentIntegral
for an arbitrary closed contour. For positive current in the positive axis
direction, order vertices counterclockwise when viewed from the positive axis.
import numpy as npfrom flex_rf.tidy3d import Custom2DCurrentIntegral
vertices = np.array([ [0, 0], [2, 0], [2, 1], [0, 1], [0, 0],])
custom_current = Custom2DCurrentIntegral( axis=2, position=0.0, vertices=vertices,)
current = custom_current.compute_current(mode_data)Use
CompositeCurrentIntegral
to combine multiple current paths for geometries such as differential lines.
from flex_rf.tidy3d import AxisAlignedCurrentIntegral, CompositeCurrentIntegral
path_1 = AxisAlignedCurrentIntegral( center=(-2, 0, 0), size=(1, 1, 0), sign="+",)
path_2 = AxisAlignedCurrentIntegral( center=(2, 0, 0), size=(1, 1, 0), sign="+",)
composite_current = CompositeCurrentIntegral( path_specs=(path_1, path_2), sum_spec="sum",)
current = composite_current.compute_current(mode_data)sum_spec="sum" adds all currents together. sum_spec="split" keeps
phase-separated contributions, which is useful when identifying dominant
current directions.
Usage With Impedance Calculator
Section titled “Usage With Impedance Calculator”Path integrals are commonly passed to
ImpedanceCalculator
to compute characteristic impedance.
from flex_rf.tidy3d import ImpedanceCalculator
z_calculator = ImpedanceCalculator( voltage_integral=voltage_integral, current_integral=current_integral,)
z0 = z_calculator.compute_impedance(mode_data)
z0, voltage, current = z_calculator.compute_impedance( mode_data, return_voltage_and_current=True,)Specification Classes
Section titled “Specification Classes”The integral classes above compute directly on field data. For
MicrowaveModeSpec
configuration, use the corresponding specification classes:
| Spec | Use |
|---|---|
AxisAlignedVoltageIntegralSpec | Axis-aligned voltage path for mode impedance. |
Custom2DVoltageIntegralSpec | Custom 2D voltage path for mode impedance. |
AxisAlignedCurrentIntegralSpec | Axis-aligned current contour for mode impedance. |
Custom2DCurrentIntegralSpec | Custom 2D current contour for mode impedance. |
CompositeCurrentIntegralSpec | Composite current contour for mode impedance. |
Best Practices
Section titled “Best Practices”| Integral | Recommendation |
|---|---|
| Voltage | Follow the electric field path between conductors. |
| Current | Enclose the current-carrying region. |
| Grid alignment | Use snap_path_to_grid=True or snap_contour_to_grid=True when available. |
| Endpoints | Use extrapolate_to_endpoints=True when voltage endpoints lie on conductor boundaries. |
| Direction | Keep sign consistent with the desired power-flow direction. |
Related Pages
Section titled “Related Pages”| Page | Why open it |
|---|---|
| RF Mode Analysis | Use path integral specs with MicrowaveModeSpec. |
| Impedance Calculator | Convert path-integral voltage and current into impedance. |