Copyright (C) 2023 - 2025 ANSYS, Inc. and/or its affiliates. SPDX-License-Identifier: MIT

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the “Software”), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

Bowtie antenna synthesis#

This example demonstrates how to synthesize a bowtie antenna using the BowTieRounded class. It initiates AEDT through PyAEDT, sets up an empty HFSS design, and proceeds to create the antenna.

Perform required imports#

Import the antenna toolkit class and PyAEDT.

[1]:
import tempfile
[2]:
import ansys.aedt.core
[3]:
from ansys.aedt.toolkits.antenna.backend.antenna_models.bowtie import BowTieRounded

Set AEDT version#

Set AEDT version.

[4]:
aedt_version = "2025.1"

Set non-graphical mode#

Set non-graphical mode.

[5]:
non_graphical = True

Create temporary directory#

[6]:
temp_dir = tempfile.TemporaryDirectory(suffix="_ansys")
project_name = ansys.aedt.core.generate_unique_project_name(root_name=temp_dir.name, project_name="bowtie_example")

Create antenna object only for synthesis#

Create antenna object.

[7]:
oantenna1 = BowTieRounded(None)
print(
    "Arm length: {}{} at {}{}".format(
        str(oantenna1.synthesis_parameters.arm_length.value),
        oantenna1.length_unit,
        oantenna1.frequency,
        oantenna1.frequency_unit,
    )
)
Arm length: 3.7mm at 10.0GHz

Change synthesis frequency#

Modify resonance frequency and modify parameters.

[8]:
oantenna1.frequency = 12.0
print(
    "Arm length: {}{} at {}{}".format(
        str(oantenna1.synthesis_parameters.arm_length.value),
        oantenna1.length_unit,
        oantenna1.frequency,
        oantenna1.frequency_unit,
    )
)
Arm length: 3.03mm at 12.0GHz

Create an empty HFSS design#

Create an empty HFSS design.

[9]:
app = ansys.aedt.core.Hfss(project=project_name, version=aedt_version, non_graphical=non_graphical)
PyAEDT INFO: Python version 3.10.11 (tags/v3.10.11:7d4cc5a, Apr  5 2023, 00:38:17) [MSC v.1929 64 bit (AMD64)].
PyAEDT INFO: PyAEDT version 0.16.1.
PyAEDT INFO: Initializing new Desktop session.
PyAEDT INFO: Log on console is enabled.
PyAEDT INFO: Log on file C:\Users\ansys\AppData\Local\Temp\pyaedt_ansys_cd27eead-4452-4d9f-87a4-9dd5f8566b3b.log is enabled.
PyAEDT INFO: Log on AEDT is disabled.
PyAEDT INFO: Debug logger is disabled. PyAEDT methods will not be logged.
PyAEDT INFO: Launching PyAEDT with gRPC plugin.
PyAEDT INFO: New AEDT session is starting on gRPC port 61578.
PyAEDT INFO: Electronics Desktop started on gRPC port: 61578 after 6.14632248878479 seconds.
PyAEDT INFO: AEDT installation Path C:\Program Files\ANSYS Inc\v251\AnsysEM
PyAEDT INFO: Ansoft.ElectronicsDesktop.2025.1 version started with process ID 9748.
PyAEDT INFO: Project bowtie_example has been created.
PyAEDT INFO: No design is present. Inserting a new design.
PyAEDT INFO: Added design 'HFSS_YBW' of type HFSS.
PyAEDT INFO: Aedt Objects correctly read

Create antenna in HFSS#

Create antenna object, change frequency synthesis, create antenna, and set up in HFSS.

[10]:
oantenna1 = BowTieRounded(app)
PyAEDT INFO: Modeler class has been initialized! Elapsed time: 0m 1sec
PyAEDT INFO: Materials class has been initialized! Elapsed time: 0m 0sec
[11]:
# Create antenna in HFSS.
oantenna1.model_hfss()
PyAEDT WARNING: Property Command is read-only.
PyAEDT INFO: Parsing design objects. This operation can take time
PyAEDT INFO: Refreshing bodies from Object Info
PyAEDT INFO: Bodies Info Refreshed Elapsed time: 0m 0sec
PyAEDT INFO: 3D Modeler objects parsed. Elapsed time: 0m 0sec
PyAEDT INFO: Union of 2 objects has been executed.
PyAEDT WARNING: Property Command is read-only.
PyAEDT WARNING: Property Command is read-only.

Create antenna setup.

[12]:
oantenna1.setup_hfss()
PyAEDT INFO: Boundary Perfect E PerfE_26P0FB has been created.
PyAEDT INFO: Boundary Perfect E PerfE_XQ83SE has been created.
PyAEDT INFO: Boundary AutoIdentify port_Patch_Y2DH4T_1 has been created.
[12]:
True

Change default name.

[13]:
oantenna1.name = "MyAmazingAntenna"

Create antenna in HFSS#

Create antenna object, change origin parameter in the antenna definition, create antenna, and set up in HFSS.

[14]:
oantenna2 = BowTieRounded(app, origin=[2, 5, 0], name="MyAntenna")
oantenna2.model_hfss()
oantenna2.setup_hfss()
PyAEDT WARNING: Property Command is read-only.
PyAEDT INFO: Parsing design objects. This operation can take time
PyAEDT INFO: Refreshing bodies from Object Info
PyAEDT INFO: Bodies Info Refreshed Elapsed time: 0m 0sec
PyAEDT INFO: 3D Modeler objects parsed. Elapsed time: 0m 0sec
PyAEDT INFO: Union of 2 objects has been executed.
PyAEDT WARNING: Property Command is read-only.
PyAEDT WARNING: Property Command is read-only.
PyAEDT INFO: Boundary Perfect E PerfE_C27FDY has been created.
PyAEDT INFO: Boundary Perfect E PerfE_2FW9SW has been created.
PyAEDT INFO: Boundary AutoIdentify port_MyAntenna_1 has been created.
[14]:
True

Plot HFSS model#

Plot geometry with PyVista.

[15]:
app.plot()
PyAEDT INFO: Parsing C:/Users/ansys/AppData/Local/Temp/tmpjrixa8w8_ansys/pyaedt_prj_OE0/bowtie_example.aedt.
PyAEDT INFO: File C:/Users/ansys/AppData/Local/Temp/tmpjrixa8w8_ansys/pyaedt_prj_OE0/bowtie_example.aedt correctly loaded. Elapsed time: 0m 0sec
PyAEDT INFO: aedt file load time 0.0
PyAEDT INFO: PostProcessor class has been initialized! Elapsed time: 0m 0sec
PyAEDT INFO: PostProcessor class has been initialized! Elapsed time: 0m 0sec
PyAEDT INFO: Post class has been initialized! Elapsed time: 0m 0sec
[15]:
<ansys.aedt.core.visualization.plot.pyvista.ModelPlotter at 0x28a6ad5b7b0>

Release AEDT#

Release AEDT.

[16]:
app.release_desktop(True, True)
PyAEDT INFO: Desktop has been released and closed.
[16]:
True

Clean temporary directory#

[17]:
temp_dir.cleanup()