Skip to content

Commit 292a2ad

Browse files
FIX: Fix spisim.py in compute_erl (#5976)
Co-authored-by: pyansys-ci-bot <[email protected]>
1 parent 23c3147 commit 292a2ad

File tree

4 files changed

+8
-2
lines changed

4 files changed

+8
-2
lines changed

doc/changelog.d/5976.fixed.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Fix spisim.py in compute_erl

src/ansys/aedt/core/circuit.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1659,6 +1659,7 @@ def create_tdr_schematic_from_snp(
16591659
use_convolution=True,
16601660
analyze=True,
16611661
design_name="LNA",
1662+
impedance=50,
16621663
):
16631664
"""Create a schematic from a Touchstone file and automatically setup a TDR transient analysis.
16641665
@@ -1685,6 +1686,8 @@ def create_tdr_schematic_from_snp(
16851686
Whether to automatically assign differential pairs. The default is ``False``.
16861687
design_name : str, optional
16871688
New schematic name. The default is ``"LNA"``.
1689+
impedance : float, optional
1690+
TDR single ended impedance. The default is ``50``. For differential tdr, it will be computed by PyAEDT.
16881691
16891692
Returns
16901693
-------
@@ -1717,6 +1720,7 @@ def create_tdr_schematic_from_snp(
17171720
pos_y = unit_converter(delta_y - left * 1000, input_units="mil", output_units=self.modeler.schematic_units)
17181721
left += 1
17191722
new_tdr_comp = tdr_probe.place("Tdr_probe", [center_x, center_y + pos_y], angle=-90)
1723+
new_tdr_comp.parameters["Z0"] = 2 * impedance if differential else impedance
17201724
try:
17211725
if isinstance(probe_pin, int):
17221726
p_pin = probe_pin
@@ -1742,7 +1746,7 @@ def create_tdr_schematic_from_snp(
17421746
name=pin.name, location=[loc[0] + loc1, loc[1]]
17431747
)
17441748
p1.pins[0].connect_to_component(pin, use_wire=True)
1745-
1749+
p1.impedance = [f"{impedance}ohm", "0ohm"]
17461750
_, first, second = new_tdr_comp.pins[0].connect_to_component(p_pin)
17471751
self.modeler.move(first, [0, 100], "mil")
17481752
if second.pins[0].location[0] > center_x:

src/ansys/aedt/core/visualization/post/compliance.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -866,7 +866,7 @@ def _create_parameters(self, pdf_report):
866866
if not isinstance(trace_pin[0], int):
867867
try:
868868
ports = list(_design.excitation_names)
869-
thrus4p = [ports.index(i) for i in trace_pin]
869+
thrus4p = [ports.index(i) + 1 for i in trace_pin]
870870
trace_pin = thrus4p
871871
except IndexError:
872872
_design.logger.error("Port not found.")

src/ansys/aedt/core/visualization/post/spisim.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,7 @@ def __init__(self, touchstone_file=""):
5151
self.desktop_install_dir = os.environ[env_value(settings.aedt_version)]
5252
else:
5353
self.desktop_install_dir = os.environ[env_value(aedt_versions.current_version)]
54+
os.environ["ANSYSEM_ROOT_PATH"] = self.desktop_install_dir
5455
self.logger = settings.logger
5556
self._working_directory = ""
5657

0 commit comments

Comments
 (0)