You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The :class:`.TerminalComponentModeler` is the core simulation object for 3D RF/microwave simulations in Tidy3D. Its primary function is to simulate the system over ``N`` number of ports and ``M`` number of frequency points, with the end result being a ``MxNxN`` S-parameter matrix.
16
+
The :class:`~tidy3d.rf.TerminalComponentModeler` is the core simulation object for 3D RF/microwave simulations in Tidy3D. Its primary function is to simulate the system over ``N`` number of ports and ``M`` number of frequency points, with the end result being a ``MxNxN`` S-parameter matrix.
17
17
18
18
.. code-block:: python
19
19
@@ -24,45 +24,52 @@ The :class:`.TerminalComponentModeler` is the core simulation object for 3D RF/m
24
24
...
25
25
)
26
26
27
-
The key parts of a :class:`.TerminalComponentModeler` are:
27
+
The key parts of a :class:`~tidy3d.rf.TerminalComponentModeler` are:
28
28
29
-
* The :class:`.Simulation` field defines the underlying Tidy3D `Simulation object <../simulation.html>`_. This base :class:`.Simulation` object contains information about the simulation domain such as structures, boundary conditions, grid specifications, and monitors. Note that sources should not be included in the base simulation, but rather in the ``ports`` field instead.
30
-
* The ``ports`` field defines the list of source excitations. These are commonly of type :class:`LumpedPort` or :class:`.WavePort`. The number of ports determines the number of batch jobs in the :class:`.TerminalComponentModeler` and the dimensionality of the S-parameter matrix.
29
+
* The :class:`~tidy3d.Simulation` field defines the underlying Tidy3D `Simulation object <../simulation.html>`_. This base :class:`~tidy3d.Simulation` object contains information about the simulation domain such as structures, boundary conditions, grid specifications, and monitors. Note that sources should not be included in the base simulation, but rather in the ``ports`` field instead.
30
+
* The ``ports`` field defines the list of source excitations. These are commonly of type :class:`~tidy3d.rf.LumpedPort` or :class:`~tidy3d.rf.WavePort`. The number of ports determines the number of batch jobs in the :class:`~tidy3d.rf.TerminalComponentModeler` and the dimensionality of the S-parameter matrix. **Note:** Port names cannot contain the '@' symbol (reserved for internal indexing).
31
31
* The ``freqs`` field defines the list of frequency points for the simulation.
32
32
33
-
More information and explanation for additional fields can be found in the documentation page for the :class:`.TerminalComponentModeler`. In order to submit the simulation, use ``tidy3d.web.upload()``, ``tidy3d.web.start()``, ``tidy3d.web.monitor()``, and ``tidy3d.web.load()``.
33
+
More information and explanation for additional fields can be found in the documentation page for the :class:`~tidy3d.rf.TerminalComponentModeler`.
34
+
35
+
Workflow
36
+
~~~~~~~~
37
+
38
+
In order to submit the simulation, use ``web.upload()``, ``web.start()``, ``web.monitor()``, and ``web.load()``.
To get the S-matrix from the results, use the ``smatrix()`` method of the :class:`.TerminalComponentModelerData` object.
65
+
To get the S-matrix from the results, use the ``smatrix()`` method of the :class:`~tidy3d.rf.TerminalComponentModelerData` object.
59
66
60
67
.. code-block:: python
61
68
62
69
# Get S-matrix from results
63
70
my_s_matrix = my_tcm_data.smatrix()
64
71
65
-
The S-matrix is stored as a :class:`.MicrowaveSMatrixData` whose ``data`` property contains a :class:`.TerminalPortDataArray` instance. To obtain a specific ``S_ij`` value, use the ``port_in`` and ``port_out`` coordinates with the corresponding port name. To obtain a specific frequency, use the ``f`` coordinate.
72
+
The S-matrix is stored as a :class:`~tidy3d.rf.MicrowaveSMatrixData` whose ``data`` property contains a :class:`~tidy3d.rf.TerminalPortDataArray` instance. To obtain a specific ``S_ij`` value, use the ``port_in`` and ``port_out`` coordinates with the corresponding port name. To obtain a specific frequency, use the ``f`` coordinate.
66
73
67
74
.. code-block:: python
68
75
@@ -71,19 +78,7 @@ The S-matrix is stored as a :class:`.MicrowaveSMatrixData` whose ``data`` proper
71
78
72
79
.. note::
73
80
74
-
At this moment, Tidy3D uses the physics phase convention :math:`e^{-i\omega t}`. Other RF simulation software and texts may use the electrical engineering convention :math:`e^{i\omega t}`. This affects the calculated S-parameters and impedance values. To convert between the two, simply use the complex conjugation operation, e.g. ``np.conjugate()``.
75
-
76
-
To access simulation data for a given port excitation, use the ``data`` attribute of the :class:`.TerminalComponentModelerData`.
77
-
78
-
.. code-block:: python
79
-
80
-
# Get simulation data for a given port "my_port"
81
-
sim_data = my_tcm_data.data["my_port"]
82
-
83
-
# Get monitor data from a given monitor "my_monitor"
84
-
my_monitor_data = sim_data["my_monitor"]
85
-
86
-
The ``data`` attribute holds the simulation data in a dictionary with the respective port name as keys. The data for each monitor can then be accessed from the simulation data object using the monitor name as the dictionary key.
81
+
At this moment, Tidy3D uses the physics phase convention :math:`e^{-i\omega t}`. Other RF simulation software and texts may use the electrical engineering convention :math:`e^{i\omega t}`. This affects the sign of the imaginary part of calculated S-parameters and impedance values. To convert between the two, simply use the complex conjugation operation, e.g. ``np.conjugate()``.
87
82
88
83
.. seealso::
89
84
@@ -97,7 +92,7 @@ The ``data`` attribute holds the simulation data in a dictionary with the respec
97
92
+ `Performing visualization of simulation data <../../notebooks/VizData.html>`_
98
93
+ `Advanced monitor data manipulation and visualization <../../notebooks/XarrayTutorial.html>`_
99
94
100
-
Please refer to the following example models to see the :class:`.TerminalComponentModeler` in action:
95
+
Please refer to the following example models to see the :class:`~tidy3d.rf.TerminalComponentModeler` in action:
The :class:`~tidy3d.ImpedanceCalculator` computes characteristic impedance from electromagnetic field data using voltage and current path integrals. It supports three calculation methods depending on which integrals are provided:
13
+
14
+
* **V and I method**: :math:`Z_0 = V / I` (when both voltage and current integrals are provided)
15
+
* **P and V method**: :math:`Z_0 = |V|^2 / (2P^*)` (when only voltage integral is provided)
16
+
* **P and I method**: :math:`Z_0 = 2P / |I|^2` (when only current integral is provided)
17
+
18
+
where :math:`P = \frac{V I^*}{2}` is the complex power flow through the cross-section.
19
+
20
+
**Basic Usage**
21
+
22
+
.. code-block:: python
23
+
24
+
import tidy3d as td
25
+
26
+
# Define voltage integration path
27
+
voltage_integral = td.AxisAlignedVoltageIntegral(
28
+
center=(0, 0, 0),
29
+
size=(0, 0, 2), # Vertical line
30
+
sign="+",
31
+
extrapolate_to_endpoints=True,
32
+
snap_path_to_grid=True
33
+
)
34
+
35
+
# Define current integration contour
36
+
current_integral = td.AxisAlignedCurrentIntegral(
37
+
center=(0, 0, 0),
38
+
size=(4, 2, 0), # Rectangular loop
39
+
sign="+",
40
+
snap_contour_to_grid=True
41
+
)
42
+
43
+
# Create impedance calculator
44
+
# Note: The impedance calculator can also accept "None" for either the "voltage_integral" or the "current_integral",
45
+
# which determines the method for computing the impedance. This alternative method is detailed below.
46
+
Z_calculator = td.ImpedanceCalculator(
47
+
voltage_integral=voltage_integral,
48
+
current_integral=current_integral
49
+
)
50
+
51
+
# Compute impedance from mode data
52
+
mode_data =# ... obtain from ModeSimulation or ModeSolver
You can also retrieve the voltage and current values along with impedance:
79
+
80
+
.. code-block:: python
81
+
82
+
# Get impedance, voltage, and current
83
+
Z, V, I = Z_calculator.compute_impedance(
84
+
mode_data,
85
+
return_voltage_and_current=True
86
+
)
87
+
88
+
print(f"Impedance: {Z} Ω")
89
+
print(f"Voltage: {V} V")
90
+
print(f"Current: {I} A")
91
+
92
+
**Single Integral Calculation**
93
+
94
+
When only voltage or current integral is specified, the complex power flow is automatically used:
95
+
96
+
.. code-block:: python
97
+
98
+
# Calculator with only voltage integral
99
+
Z_calc_V = td.ImpedanceCalculator(
100
+
voltage_integral=voltage_integral,
101
+
current_integral=None
102
+
)
103
+
104
+
# Computes: Z = V^2 / (2*P)
105
+
Z_from_V = Z_calc_V.compute_impedance(mode_data)
106
+
107
+
# Calculator with only current integral
108
+
Z_calc_I = td.ImpedanceCalculator(
109
+
voltage_integral=None,
110
+
current_integral=current_integral
111
+
)
112
+
113
+
# Computes: Z = 2*P / I^2
114
+
Z_from_I = Z_calc_I.compute_impedance(mode_data)
115
+
116
+
.. note::
117
+
118
+
For detailed information on path integral classes (voltage integrals, current integrals, composite integrals, custom paths, etc.), see :ref:`path_integrals`.
119
+
120
+
**Field Data Compatibility**
121
+
122
+
The impedance calculator and path integral classes work with various types of field data:
123
+
124
+
* :class:`~tidy3d.ModeSolverData`: Mode field profiles from 2D mode solver
125
+
* :class:`~tidy3d.FieldData`: Frequency-domain field data from monitors
126
+
* :class:`~tidy3d.FieldTimeData`: Time-domain field data from monitors
127
+
* :class:`~tidy3d.MicrowaveModeSolverData`: Microwave mode solver data (includes pre-computed integrals)
Tidy3D uses the physics phase convention :math:`e^{-i\omega t}`. Some RF simulation software and textbooks use the electrical engineering convention :math:`e^{i\omega t}`. This affects calculated S-parameters and impedance values.
141
+
142
+
To convert between conventions, use complex conjugation:
143
+
144
+
.. code-block:: python
145
+
146
+
import numpy as np
147
+
148
+
# Convert from physics to engineering convention
149
+
Z_engineering = np.conjugate(Z_physics)
150
+
151
+
# Convert from engineering to physics convention
152
+
Z_physics = np.conjugate(Z_engineering)
153
+
154
+
.. seealso::
155
+
156
+
Related documentation:
157
+
158
+
+ :ref:`path_integrals`
159
+
+ :ref:`microwave_mode_solver`
160
+
161
+
Tutorials and examples:
162
+
163
+
+ `Computing the characteristic impedance of transmission lines <../../notebooks/CharacteristicImpedanceCalculator.html>`_
Copy file name to clipboardExpand all lines: docs/api/microwave/index.rst
+23-1Lines changed: 23 additions & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,12 +1,26 @@
1
1
Microwave & RF |:satellite:|
2
2
==============================
3
3
4
+
.. toctree::
5
+
:hidden:
6
+
7
+
component_modeler
8
+
material
9
+
rf_material_library
10
+
path_integrals
11
+
impedance_calculator
12
+
mode_solver
13
+
ports/lumped
14
+
ports/wave
15
+
radiation_scattering
16
+
output_data
17
+
4
18
Overview
5
19
--------
6
20
7
21
.. warning::
8
22
9
-
RF simulations will be subject to new license requirements in the future.
23
+
RF simulations and functionality will require new license requirements in an upcoming release. All RF-specific classes are now available within the sub-package 'tidy3d.rf'.
10
24
11
25
.. warning::
12
26
@@ -22,9 +36,13 @@ The following sections discuss:
22
36
* `RF Materials Models`_: Typical material types in microwave/RF simulation
23
37
* `RF Materials Library`_: The RF material library contains various dispersive models for real-world RF materials.
Note that the unit of ``conductivity`` is ``S/um`` and the unit of ``freq_range`` is ``Hz``. The :class:`.LossyMetalMedium` class implements the surface impedance boundary condition (SIBC). It can accept surface roughness specifications using the Hammerstad or Huray models. Please refer to their respective documentation pages for details. Edge singularity correction is also available but turned off by default at this time.
27
+
Note that the unit of ``conductivity`` is ``S/um`` and the unit of ``freq_range`` is ``Hz``. The :class:`~tidy3d.rf.LossyMetalMedium` class implements the surface impedance boundary condition (SIBC). It can accept surface roughness specifications using the Hammerstad or Huray models. Please refer to their respective documentation pages for details. Edge singularity correction is also available but turned off by default at this time.
28
28
29
29
.. note::
30
30
31
-
When modeling lossy metals, always be sure to check the skin depth --- if the skin depth is significant compared to the geometry size, then :class:`.LossyMetalMedium` may be not accurate. In that case, use a regular dispersive medium instead.
31
+
When modeling lossy metals, always be sure to check the skin depth --- if the skin depth is significant compared to the geometry size, then :class:`~tidy3d.rf.LossyMetalMedium` may be not accurate. In that case, use a regular dispersive medium instead.
32
32
33
33
34
34
.. autosummary::
@@ -38,7 +38,7 @@ Note that the unit of ``conductivity`` is ``S/um`` and the unit of ``freq_range`
38
38
tidy3d.Medium
39
39
tidy3d.plugins.dispersion.FastDispersionFitter
40
40
41
-
To model lossless dielectrics, use the regular :class:`.Medium`.
41
+
To model lossless dielectrics, use the regular :class:`~tidy3d.Medium`.
0 commit comments