Skip to content

fix impedance calculation for lossy transmission lines #2552

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jun 9, 2025

Conversation

dmarek-flex
Copy link
Contributor

@dmarek-flex dmarek-flex commented Jun 6, 2025

Realized that the new methods I implemented for calculating impedance would not work for lossy transmission lines because flux is returned as a real number. I also improved a bit of the sign handling when calculating impedance.

Will add section to flexcompute/tidy3d-notebooks#297 comparing the calculations for a lossy transmission line.

Here is a plot of the different methods for computing impedance:

image

@dmarek-flex dmarek-flex self-assigned this Jun 6, 2025
@dmarek-flex dmarek-flex added the RF label Jun 6, 2025
Copy link
Contributor

github-actions bot commented Jun 6, 2025

Diff Coverage

Diff: origin/develop...HEAD, staged and unstaged changes

  • tidy3d/components/data/monitor_data.py (100%)
  • tidy3d/plugins/microwave/impedance_calculator.py (96.0%): Missing lines 80

Summary

  • Total: 35 lines
  • Missing: 1 line
  • Coverage: 97%

tidy3d/plugins/microwave/impedance_calculator.py

  76         # We explicitly take the real part, in case Bloch BCs were used in the simulation.
  77         flux_sign = 1.0
  78         # Determine flux sign
  79         if isinstance(em_field.monitor, ModeSolverMonitor):
! 80             flux_sign = 1 if em_field.monitor.direction == "+" else -1
  81         if isinstance(em_field.monitor, ModeMonitor):
  82             flux_sign = 1 if em_field.monitor.store_fields_direction == "+" else -1
  83 
  84         if self.voltage_integral is None:

@dmarek-flex dmarek-flex merged commit 46d7d5b into develop Jun 9, 2025
29 checks passed
@dmarek-flex dmarek-flex deleted the dmarek/fix-lossy-impedance branch June 9, 2025 18:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants