.. DO NOT EDIT. .. THIS FILE WAS AUTOMATICALLY GENERATED BY SPHINX-GALLERY. .. TO MAKE CHANGES, EDIT THE SOURCE PYTHON FILE: .. "examples\02-HFSS\Probe_Fed_Patch.py" .. LINE NUMBERS ARE GIVEN BELOW. .. only:: html .. note:: :class: sphx-glr-download-link-note :ref:`Go to the end ` to download the full example code. .. rst-class:: sphx-glr-example-title .. _sphx_glr_examples_02-HFSS_Probe_Fed_Patch.py: HFSS: Probe-fed patch antenna --------------------------------------------------------- This example shows how to use the ``Stackup3D`` class to create and analyze a patch antenna in HFSS. Note that the HFSS 3D Layout interface may offer advantages for laminate structures such as the patch antenna. .. GENERATED FROM PYTHON SOURCE LINES 12-14 Perform imports ~~~~~~~~~~~~~~~~~~ .. GENERATED FROM PYTHON SOURCE LINES 14-21 .. code-block:: Python import os import pyaedt import tempfile from pyaedt.modeler.advanced_cad.stackup_3d import Stackup3D .. GENERATED FROM PYTHON SOURCE LINES 22-25 Set AEDT version ~~~~~~~~~~~~~~~~ Set AEDT version. .. GENERATED FROM PYTHON SOURCE LINES 25-28 .. code-block:: Python aedt_version = "2024.1" .. GENERATED FROM PYTHON SOURCE LINES 29-36 Set non-graphical mode ~~~~~~~~~~~~~~~~~~~~~~ Set non-graphical mode. ``"PYAEDT_NON_GRAPHICAL"`` is set to ``False`` to create this documentation. You can set ``non_graphical`` to ``True`` to view HFSS while the notebook cells are executed. .. GENERATED FROM PYTHON SOURCE LINES 36-41 .. code-block:: Python non_graphical = False length_units = "mm" freq_units = "GHz" .. GENERATED FROM PYTHON SOURCE LINES 42-50 Create temporary working folder ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Use tempfile to create a temporary working folder. Project data is deleted after this example is run. To save the project data in another location, change the location of the project directory. .. GENERATED FROM PYTHON SOURCE LINES 50-58 .. code-block:: Python # tmpdir.cleanup() at the end of this notebook removes all # project files and data. tmpdir = tempfile.TemporaryDirectory(suffix="_aedt") project_folder = tmpdir.name proj_name = os.path.join(project_folder, "antenna") .. GENERATED FROM PYTHON SOURCE LINES 59-62 Launch HFSS ----------- .. GENERATED FROM PYTHON SOURCE LINES 62-72 .. code-block:: Python hfss = pyaedt.Hfss(projectname=proj_name, solution_type="Terminal", designname="patch", non_graphical=non_graphical, new_desktop_session=True, specified_version=aedt_version) hfss.modeler.model_units = length_units .. GENERATED FROM PYTHON SOURCE LINES 73-77 Create patch ------------ Create the patch. .. GENERATED FROM PYTHON SOURCE LINES 77-104 .. code-block:: Python stackup = Stackup3D(hfss) ground = stackup.add_ground_layer("ground", material="copper", thickness=0.035, fill_material="air") dielectric = stackup.add_dielectric_layer("dielectric", thickness="0.5" + length_units, material="Duroid (tm)") signal = stackup.add_signal_layer("signal", material="copper", thickness=0.035, fill_material="air") patch = signal.add_patch(patch_length=9.57, patch_width=9.25, patch_name="Patch", frequency=1E10) stackup.resize_around_element(patch) pad_length = [3, 3, 3, 3, 3, 3] # Air bounding box buffer in mm. region = hfss.modeler.create_region(pad_length, is_percentage=False) hfss.assign_radiation_boundary_to_objects(region.name) patch.create_probe_port(ground, rel_x_offset=0.485) setup = hfss.create_setup(name="Setup1", setup_type="HFSSDriven", Frequency="10GHz") setup.create_frequency_sweep(unit="GHz", name="Sweep1", start_frequency=8, stop_frequency=12, sweep_type="Interpolating") hfss.save_project() hfss.analyze() .. rst-class:: sphx-glr-script-out .. code-block:: none True .. GENERATED FROM PYTHON SOURCE LINES 105-107 Plot S11 --------- .. GENERATED FROM PYTHON SOURCE LINES 107-113 .. code-block:: Python plot_data = hfss.get_traces_for_plot() report = hfss.post.create_report(plot_data) solution = report.get_solution_data() plt = solution.plot(solution.expressions) .. image-sg:: /examples/02-HFSS/images/sphx_glr_Probe_Fed_Patch_001.png :alt: Simulation Results Plot :srcset: /examples/02-HFSS/images/sphx_glr_Probe_Fed_Patch_001.png :class: sphx-glr-single-img .. rst-class:: sphx-glr-script-out .. code-block:: none No artists with labels found to put in legend. Note that artists whose label start with an underscore are ignored when legend() is called with no argument. .. GENERATED FROM PYTHON SOURCE LINES 114-117 Release AEDT ------------ Release AEDT and clean up temporary folders and files. .. GENERATED FROM PYTHON SOURCE LINES 117-120 .. code-block:: Python hfss.release_desktop() tmpdir.cleanup() .. rst-class:: sphx-glr-timing **Total running time of the script:** (2 minutes 14.577 seconds) .. _sphx_glr_download_examples_02-HFSS_Probe_Fed_Patch.py: .. only:: html .. container:: sphx-glr-footer sphx-glr-footer-example .. container:: sphx-glr-download sphx-glr-download-jupyter :download:`Download Jupyter notebook: Probe_Fed_Patch.ipynb ` .. container:: sphx-glr-download sphx-glr-download-python :download:`Download Python source code: Probe_Fed_Patch.py ` .. only:: html .. rst-class:: sphx-glr-signature `Gallery generated by Sphinx-Gallery `_