From 4529c66fc443f77b49c0596f0388517d51865279 Mon Sep 17 00:00:00 2001 From: Massimo Capodiferro Date: Mon, 13 Dec 2021 11:11:12 +0100 Subject: [PATCH 01/12] Added Spiral Example --- _unittest/test_07_Object3D.py | 6 ++ examples/02-HFSS/HFSS_Spiral.py | 163 ++++++++++++++++++++++++++++++++ pyaedt/modeler/Primitives.py | 6 +- pyaedt/modeler/Primitives3D.py | 61 ++++++++++++ 4 files changed, 235 insertions(+), 1 deletion(-) create mode 100644 examples/02-HFSS/HFSS_Spiral.py diff --git a/_unittest/test_07_Object3D.py b/_unittest/test_07_Object3D.py index 661ee8228ea..f159745b7e8 100644 --- a/_unittest/test_07_Object3D.py +++ b/_unittest/test_07_Object3D.py @@ -337,3 +337,9 @@ def test_16_duplicate_around_axis_and_unite(self): def test_17_section_object(self): o = self.aedtapp.modeler.primitives.create_box([-10, 0, 0], [10, 10, 5], "SectionBox", "Copper") o.section(plane="YZ", create_new=True, section_cross_object=False) + + def test_18_create_spiral(self): + sp1 = self.aedtapp.modeler.create_spiral(name="ind") + assert sp1 + assert sp1.name == "ind" + assert len(sp1.polyline_points) == 78 \ No newline at end of file diff --git a/examples/02-HFSS/HFSS_Spiral.py b/examples/02-HFSS/HFSS_Spiral.py new file mode 100644 index 00000000000..b793427c86c --- /dev/null +++ b/examples/02-HFSS/HFSS_Spiral.py @@ -0,0 +1,163 @@ +""" +Spiral Inductor Example +----------------------- +This example shows how you can use PyAEDT to create a spiral inductor, solve it and plot results. +""" +# sphinx_gallery_thumbnail_path = 'Resources/spiral.png' + +############################################################# +# Import packages +# + +import os +import matplotlib.pyplot as plt +from pyaedt import Hfss, constants + + +############################################################# +# Launch Hfss 2021.2 in non graphical mode. +# Change units to micron +hfss = Hfss(specified_version="2021.2", non_graphical=False, designname='A1') +hfss.modeler.model_units = "um" +p = hfss.modeler.primitives + +############################################################# +# Input Variables. Edit it to change your inductor. +# +rin = 10 +width = 2 +spacing = 1 +thickness = 1 +Np = 8 +Nr = 10 +gap = 3 +Tsub=6 + + +############################################################# +# This method standardize the usage of polyline in this +# example by fixing the width, thickness and material. +# +def create_line(pts): + p.create_polyline(pts, + xsection_type='Rectangle', + xsection_width=width, + xsection_height=thickness, matname='copper') + + +################################################################ +# Here a spiral inductor is created. +# Spiral is not parameteric but could be parametrized later on. +# + +ind = hfss.modeler.create_spiral(internal_radius=rin, width=width, spacing=spacing, turns=Nr, faces=Np, + thickness=thickness, material="copper", name="Inductor1") + + +################################################################ +# Center Return Path. +# + +x0, y0, z0 = ind.points[0] +x1, y1, z1 = ind.points[-1] +create_line([(x0 - width / 2, y0, -gap), (abs(x1) + 5, y0, -gap)]) +p.create_box((x0 - width / 2, y0 - width / 2, -gap - thickness / 2), + (width, width, gap + thickness), + matname='copper') + +################################################################ +# Port 1 creation. +# +p.create_rectangle(constants.PLANE.YZ, + (abs(x1) + 5, y0 - width / 2, -gap - thickness / 2), + (width, -Tsub + gap), + name='port1') +hfss.create_lumped_port_to_sheet(sheet_name='port1', axisdir=constants.AXIS.Z) + + +################################################################ +# Port 2 creation. +# +create_line([(x1 + width / 2, y1, 0), (x1 - 5, y1, 0)]) +p.create_rectangle(constants.PLANE.YZ, + (x1 - 5, y1 - width / 2, -thickness / 2), + (width, -Tsub), + name='port2') +hfss.create_lumped_port_to_sheet(sheet_name='port2', axisdir=constants.AXIS.Z) + + +################################################################ +# Silicon Substrate and Ground plane. +# +p.create_box([x1 - 20, x1 - 20, -Tsub - thickness / 2], + [-2 * x1 + 40, -2 * x1 + 40, Tsub], + matname='silicon') + +p.create_box([x1 - 20, x1 - 20, -Tsub - thickness / 2], + [-2 * x1 + 40, -2 * x1 + 40, -0.1], + matname='PEC') + +################################################################ +# Airbox and radiation assignment. +# + +box = p.create_box([x1 - 20, x1 - 20, -Tsub - thickness / 2 - 0.1], + [-2 * x1 + 40, -2 * x1 + 40, 100], + name='airbox', + matname='air') + +hfss.assign_radiation_boundary_to_objects('airbox') + +################################################################ +# Material override is needed to avoid validation check to fail. +# +hfss.change_material_override() + +################################################################ +# Create a setup and define a frequency sweep. +# Project will be solved after that. + +setup1 = hfss.create_setup(setupname='setup1') +setup1.props['Frequency'] = '10GHz' +hfss.create_linear_count_sweep('setup1', 'GHz', 1e-3, 50, 451, sweep_type="Interpolating") +setup1.update() +hfss.save_project() +hfss.analyze_all() + +################################################################ +# Get Report Data and plot it on matplotlib. +# Inductance. +L_formula = '1e9*im(1/Y(1,1))/(2*pi*freq)' +x = hfss.post.get_report_data(L_formula) + +plt.plot(x.sweeps["Freq"], x.data_real(L_formula)) + +plt.grid() +plt.xlabel('Freq') +plt.ylabel('L(nH)') +plt.show() + +plt.clf() + + +################################################################ +# Get Report Data and plot it on matplotlib. +# Quality Factor. + +L_formula = 'im(Y(1,1))/re(Y(1,1))' +x = hfss.post.get_report_data(L_formula) +hfss.save_project() + +plt.plot(x.sweeps["Freq"], x.data_real(L_formula)) +plt.grid() +plt.xlabel('Freq') +plt.ylabel('Q') +plt.show() + +################################################################ +# Get Report Data and plot it on matplotlib. +# Save and close the project. + +hfss.save_project() +if os.name != "posix": + hfss.release_desktop() diff --git a/pyaedt/modeler/Primitives.py b/pyaedt/modeler/Primitives.py index d279e7cb31d..95c6a4503d5 100644 --- a/pyaedt/modeler/Primitives.py +++ b/pyaedt/modeler/Primitives.py @@ -192,7 +192,6 @@ def __init__( num_seg=xsection_num_seg, bend_type=xsection_bend_type, ) - #self._positions = copy(position_list) self._positions = [i for i in position_list] # When close surface or cover_surface are set to True, ensure the start point and end point are coincident, # and insert a line segment to achieve this if necessary @@ -256,6 +255,11 @@ def end_point(self): end_vertex_id = self._primitives.get_object_vertices(partID=self.id)[-1] return self._primitives.get_vertex_position(end_vertex_id) + @property + def points(self): + """Polyline Points""" + return self._positions + @property def vertex_positions(self): """List of the ``[x, y, z]`` coordinates for all vertex positions in the diff --git a/pyaedt/modeler/Primitives3D.py b/pyaedt/modeler/Primitives3D.py index f27035f1a1f..a044367d9be 100644 --- a/pyaedt/modeler/Primitives3D.py +++ b/pyaedt/modeler/Primitives3D.py @@ -1,4 +1,6 @@ import os +from math import pi, cos, sin, tan, sqrt + from pyaedt.generic.general_methods import aedt_exception_handler from pyaedt.modeler.Primitives import Primitives from pyaedt.modeler.GeometryOperators import GeometryOperators @@ -814,6 +816,65 @@ def create_udm(self, udmfullname, udm_params_list, udm_library='syslib'): else: return False + @aedt_exception_handler + def create_spiral(self, internal_radius=10, spacing=1, faces=8, turns=10, width=2, thickness=1, elevation=0, + material="copper", name=None): + """Creates a spiral inductor from a polyne. + + Parameters + ---------- + internal_radius : float, optional + internal starting point of spiral. Default is `10`. + spacing : float, optional + internal ptich between two turns. Default is `1`. + faces : int, optional + Number of faces per turn. Default is `8` as an octagon. + turns : int, optional + Number of turns. Default is `10`. + width : float, optional + spiral width. Default is `2`. + thickness : float, optional + spiral thickness. Default is `1`. + elevation : float, optional + Spiral elevation. Default is`0`. + material : str, optional + Spiral material. Default is `"copper"`. + name : str, optional + Spiral name.Default is `None`. + + Returns + ------- + :class:`pyaedt.modeler.Object3d.Polyline` + Polyline object. + """ + assert internal_radius > 0, "Internal Radius must be greather than 0" + dtheta = 2 * pi / faces + theta = pi / 2 + pts = [(internal_radius, 0, elevation), (internal_radius, internal_radius * tan(dtheta / 2), elevation)] + rin = internal_radius * tan(dtheta / 2) * 2 + x = rin + r = rin + for i in range(faces): + r += 1 + theta += dtheta + x = x + r * cos(theta) + dr = (width + spacing) / (x - rin) + + for i in range(turns * faces - int(faces / 2) - 1): + rin += dr + theta += dtheta + x0, y0 = pts[-1][:2] + x1, y1 = x0 + rin * cos(theta), y0 + rin * sin(theta) + pts.append((x1, y1, elevation)) + + pts.append((x1, 0, elevation)) + p1 = self.create_polyline(pts, xsection_type='Rectangle', xsection_width=width, xsection_height=thickness, + matname=material) + if name: + p1.name = name + return p1 + + @aedt_exception_handler def insert_3d_component(self, compFile, geoParams=None, szMatParams='', szDesignParams='', targetCS='Global'): """Insert a new 3D component. From 79526f7cb02ea32eb277b1d591c2c5c9742e8c11 Mon Sep 17 00:00:00 2001 From: Massimo Capodiferro Date: Mon, 13 Dec 2021 11:27:22 +0100 Subject: [PATCH 02/12] Added Spiral Example --- _unittest/test_07_Object3D.py | 2 +- examples/02-HFSS/HFSS_Spiral.py | 2 +- pyaedt/modeler/Primitives.py | 2 +- pyaedt/modeler/Primitives3D.py | 7 +++---- 4 files changed, 6 insertions(+), 7 deletions(-) diff --git a/_unittest/test_07_Object3D.py b/_unittest/test_07_Object3D.py index f159745b7e8..8abb6216a05 100644 --- a/_unittest/test_07_Object3D.py +++ b/_unittest/test_07_Object3D.py @@ -342,4 +342,4 @@ def test_18_create_spiral(self): sp1 = self.aedtapp.modeler.create_spiral(name="ind") assert sp1 assert sp1.name == "ind" - assert len(sp1.polyline_points) == 78 \ No newline at end of file + assert len(sp1.points) == 78 diff --git a/examples/02-HFSS/HFSS_Spiral.py b/examples/02-HFSS/HFSS_Spiral.py index b793427c86c..00079dd3832 100644 --- a/examples/02-HFSS/HFSS_Spiral.py +++ b/examples/02-HFSS/HFSS_Spiral.py @@ -31,7 +31,7 @@ Np = 8 Nr = 10 gap = 3 -Tsub=6 +Tsub = 6 ############################################################# diff --git a/pyaedt/modeler/Primitives.py b/pyaedt/modeler/Primitives.py index 95c6a4503d5..b00884cc68e 100644 --- a/pyaedt/modeler/Primitives.py +++ b/pyaedt/modeler/Primitives.py @@ -257,7 +257,7 @@ def end_point(self): @property def points(self): - """Polyline Points""" + """Polyline Points.""" return self._positions @property diff --git a/pyaedt/modeler/Primitives3D.py b/pyaedt/modeler/Primitives3D.py index a044367d9be..770eaf2f4d8 100644 --- a/pyaedt/modeler/Primitives3D.py +++ b/pyaedt/modeler/Primitives3D.py @@ -1,5 +1,5 @@ import os -from math import pi, cos, sin, tan, sqrt +from math import pi, cos, sin, tan from pyaedt.generic.general_methods import aedt_exception_handler from pyaedt.modeler.Primitives import Primitives @@ -819,7 +819,7 @@ def create_udm(self, udmfullname, udm_params_list, udm_library='syslib'): @aedt_exception_handler def create_spiral(self, internal_radius=10, spacing=1, faces=8, turns=10, width=2, thickness=1, elevation=0, material="copper", name=None): - """Creates a spiral inductor from a polyne. + """Create a spiral inductor from a polyne. Parameters ---------- @@ -847,7 +847,7 @@ def create_spiral(self, internal_radius=10, spacing=1, faces=8, turns=10, width= :class:`pyaedt.modeler.Object3d.Polyline` Polyline object. """ - assert internal_radius > 0, "Internal Radius must be greather than 0" + assert internal_radius > 0, "Internal Radius must be greater than 0" dtheta = 2 * pi / faces theta = pi / 2 pts = [(internal_radius, 0, elevation), (internal_radius, internal_radius * tan(dtheta / 2), elevation)] @@ -874,7 +874,6 @@ def create_spiral(self, internal_radius=10, spacing=1, faces=8, turns=10, width= p1.name = name return p1 - @aedt_exception_handler def insert_3d_component(self, compFile, geoParams=None, szMatParams='', szDesignParams='', targetCS='Global'): """Insert a new 3D component. From 125c16f9b49ad37a923c6b0c7e17fd22b0f90f44 Mon Sep 17 00:00:00 2001 From: Maxime Rey <87315832+MaxJPRey@users.noreply.github.com> Date: Mon, 13 Dec 2021 16:35:09 +0100 Subject: [PATCH 03/12] Update examples/02-HFSS/HFSS_Spiral.py --- examples/02-HFSS/HFSS_Spiral.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/examples/02-HFSS/HFSS_Spiral.py b/examples/02-HFSS/HFSS_Spiral.py index 00079dd3832..75075ceb5c9 100644 --- a/examples/02-HFSS/HFSS_Spiral.py +++ b/examples/02-HFSS/HFSS_Spiral.py @@ -35,7 +35,7 @@ ############################################################# -# This method standardize the usage of polyline in this +# This method standardizes the usage of polyline in this # example by fixing the width, thickness and material. # def create_line(pts): From 6d591424127b8076359d42024b6f2098d34c7b73 Mon Sep 17 00:00:00 2001 From: Maxime Rey <87315832+MaxJPRey@users.noreply.github.com> Date: Mon, 13 Dec 2021 16:37:53 +0100 Subject: [PATCH 04/12] Update pyaedt/modeler/Primitives3D.py --- pyaedt/modeler/Primitives3D.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pyaedt/modeler/Primitives3D.py b/pyaedt/modeler/Primitives3D.py index 770eaf2f4d8..a390f6a0b00 100644 --- a/pyaedt/modeler/Primitives3D.py +++ b/pyaedt/modeler/Primitives3D.py @@ -834,7 +834,7 @@ def create_spiral(self, internal_radius=10, spacing=1, faces=8, turns=10, width= width : float, optional spiral width. Default is `2`. thickness : float, optional - spiral thickness. Default is `1`. + Spiral thickness. Default is `1`. elevation : float, optional Spiral elevation. Default is`0`. material : str, optional From 9afbe8ed708c9ed1fe7854e918928d54a0556b22 Mon Sep 17 00:00:00 2001 From: Maxime Rey <87315832+MaxJPRey@users.noreply.github.com> Date: Mon, 13 Dec 2021 16:38:24 +0100 Subject: [PATCH 05/12] Update pyaedt/modeler/Primitives3D.py --- pyaedt/modeler/Primitives3D.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pyaedt/modeler/Primitives3D.py b/pyaedt/modeler/Primitives3D.py index a390f6a0b00..f94fa13dd96 100644 --- a/pyaedt/modeler/Primitives3D.py +++ b/pyaedt/modeler/Primitives3D.py @@ -832,7 +832,7 @@ def create_spiral(self, internal_radius=10, spacing=1, faces=8, turns=10, width= turns : int, optional Number of turns. Default is `10`. width : float, optional - spiral width. Default is `2`. + Spiral width. Default is `2`. thickness : float, optional Spiral thickness. Default is `1`. elevation : float, optional From 82dc24618f4709c898b9d786b2248fc7233598bf Mon Sep 17 00:00:00 2001 From: Maxime Rey <87315832+MaxJPRey@users.noreply.github.com> Date: Mon, 13 Dec 2021 16:39:32 +0100 Subject: [PATCH 06/12] Update pyaedt/modeler/Primitives3D.py --- pyaedt/modeler/Primitives3D.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pyaedt/modeler/Primitives3D.py b/pyaedt/modeler/Primitives3D.py index f94fa13dd96..73ecdf7a535 100644 --- a/pyaedt/modeler/Primitives3D.py +++ b/pyaedt/modeler/Primitives3D.py @@ -840,7 +840,7 @@ def create_spiral(self, internal_radius=10, spacing=1, faces=8, turns=10, width= material : str, optional Spiral material. Default is `"copper"`. name : str, optional - Spiral name.Default is `None`. + Spiral name. Default is `None`. Returns ------- From 7ef3228a83b9f77a88101a1994137c5fc492f262 Mon Sep 17 00:00:00 2001 From: Maxime Rey <87315832+MaxJPRey@users.noreply.github.com> Date: Mon, 13 Dec 2021 16:44:23 +0100 Subject: [PATCH 07/12] Update pyaedt/modeler/Primitives3D.py --- pyaedt/modeler/Primitives3D.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pyaedt/modeler/Primitives3D.py b/pyaedt/modeler/Primitives3D.py index 73ecdf7a535..8a298f5d9a9 100644 --- a/pyaedt/modeler/Primitives3D.py +++ b/pyaedt/modeler/Primitives3D.py @@ -826,7 +826,7 @@ def create_spiral(self, internal_radius=10, spacing=1, faces=8, turns=10, width= internal_radius : float, optional internal starting point of spiral. Default is `10`. spacing : float, optional - internal ptich between two turns. Default is `1`. + internal pitch between two turns. Default is `1`. faces : int, optional Number of faces per turn. Default is `8` as an octagon. turns : int, optional From 2de919ff03511d63d474db2c2cdc33905d83be12 Mon Sep 17 00:00:00 2001 From: Maxime Rey <87315832+MaxJPRey@users.noreply.github.com> Date: Mon, 13 Dec 2021 16:46:00 +0100 Subject: [PATCH 08/12] Update pyaedt/modeler/Primitives3D.py --- pyaedt/modeler/Primitives3D.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pyaedt/modeler/Primitives3D.py b/pyaedt/modeler/Primitives3D.py index 8a298f5d9a9..59bc0d27275 100644 --- a/pyaedt/modeler/Primitives3D.py +++ b/pyaedt/modeler/Primitives3D.py @@ -819,7 +819,7 @@ def create_udm(self, udmfullname, udm_params_list, udm_library='syslib'): @aedt_exception_handler def create_spiral(self, internal_radius=10, spacing=1, faces=8, turns=10, width=2, thickness=1, elevation=0, material="copper", name=None): - """Create a spiral inductor from a polyne. + """Create a spiral inductor from a polyline. Parameters ---------- From 082f43f3db863948aac539b50fb4bf5bf62b9792 Mon Sep 17 00:00:00 2001 From: Maxime Rey <87315832+MaxJPRey@users.noreply.github.com> Date: Mon, 13 Dec 2021 16:48:34 +0100 Subject: [PATCH 09/12] Update pyaedt/modeler/Primitives3D.py --- pyaedt/modeler/Primitives3D.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pyaedt/modeler/Primitives3D.py b/pyaedt/modeler/Primitives3D.py index 59bc0d27275..8947c163a0b 100644 --- a/pyaedt/modeler/Primitives3D.py +++ b/pyaedt/modeler/Primitives3D.py @@ -824,7 +824,7 @@ def create_spiral(self, internal_radius=10, spacing=1, faces=8, turns=10, width= Parameters ---------- internal_radius : float, optional - internal starting point of spiral. Default is `10`. + Internal starting point of spiral. Default is `10`. spacing : float, optional internal pitch between two turns. Default is `1`. faces : int, optional From 6f5b26f9b10250e2cbce25c50bab302ea3b65431 Mon Sep 17 00:00:00 2001 From: Maxime Rey <87315832+MaxJPRey@users.noreply.github.com> Date: Mon, 13 Dec 2021 16:48:50 +0100 Subject: [PATCH 10/12] Update pyaedt/modeler/Primitives3D.py --- pyaedt/modeler/Primitives3D.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pyaedt/modeler/Primitives3D.py b/pyaedt/modeler/Primitives3D.py index 8947c163a0b..da3bd398953 100644 --- a/pyaedt/modeler/Primitives3D.py +++ b/pyaedt/modeler/Primitives3D.py @@ -826,7 +826,7 @@ def create_spiral(self, internal_radius=10, spacing=1, faces=8, turns=10, width= internal_radius : float, optional Internal starting point of spiral. Default is `10`. spacing : float, optional - internal pitch between two turns. Default is `1`. + Internal pitch between two turns. Default is `1`. faces : int, optional Number of faces per turn. Default is `8` as an octagon. turns : int, optional From 70aaaf7f7f5752d4fcb8c76a22de298fc84ca978 Mon Sep 17 00:00:00 2001 From: Massimo Capodiferro <77293250+maxcapodi78@users.noreply.github.com> Date: Mon, 13 Dec 2021 17:20:31 +0100 Subject: [PATCH 11/12] Apply suggestions from code review Co-authored-by: Maxime Rey <87315832+MaxJPRey@users.noreply.github.com> --- pyaedt/modeler/Primitives3D.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/pyaedt/modeler/Primitives3D.py b/pyaedt/modeler/Primitives3D.py index da3bd398953..32dcb5c24ad 100644 --- a/pyaedt/modeler/Primitives3D.py +++ b/pyaedt/modeler/Primitives3D.py @@ -847,7 +847,8 @@ def create_spiral(self, internal_radius=10, spacing=1, faces=8, turns=10, width= :class:`pyaedt.modeler.Object3d.Polyline` Polyline object. """ - assert internal_radius > 0, "Internal Radius must be greater than 0" + assert internal_radius > 0, "Internal Radius must be greater than 0." + assert faces > 0, "Faces must be greater than 0." dtheta = 2 * pi / faces theta = pi / 2 pts = [(internal_radius, 0, elevation), (internal_radius, internal_radius * tan(dtheta / 2), elevation)] From aa8247de8c3c56fdbdc0090396bdac2623d97624 Mon Sep 17 00:00:00 2001 From: Massimo Capodiferro <77293250+maxcapodi78@users.noreply.github.com> Date: Tue, 14 Dec 2021 11:37:38 +0100 Subject: [PATCH 12/12] Apply suggestions from code review Co-authored-by: Maxime Rey <87315832+MaxJPRey@users.noreply.github.com> --- examples/02-HFSS/HFSS_Spiral.py | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/examples/02-HFSS/HFSS_Spiral.py b/examples/02-HFSS/HFSS_Spiral.py index 75075ceb5c9..479708ee002 100644 --- a/examples/02-HFSS/HFSS_Spiral.py +++ b/examples/02-HFSS/HFSS_Spiral.py @@ -100,7 +100,6 @@ def create_line(pts): ################################################################ # Airbox and radiation assignment. # - box = p.create_box([x1 - 20, x1 - 20, -Tsub - thickness / 2 - 0.1], [-2 * x1 + 40, -2 * x1 + 40, 100], name='airbox', @@ -144,11 +143,11 @@ def create_line(pts): # Get Report Data and plot it on matplotlib. # Quality Factor. -L_formula = 'im(Y(1,1))/re(Y(1,1))' -x = hfss.post.get_report_data(L_formula) +Q_formula = 'im(Y(1,1))/re(Y(1,1))' +x = hfss.post.get_report_data(Q_formula) hfss.save_project() -plt.plot(x.sweeps["Freq"], x.data_real(L_formula)) +plt.plot(x.sweeps["Freq"], x.data_real(Q_formula)) plt.grid() plt.xlabel('Freq') plt.ylabel('Q')