Download this example

Download this example as a Jupyter Notebook or as a Python script.


Antenna Cosite Interference#

This example shows how to create a project in EMIT for the simulation of an antenna cosite interference scenario.

88708e9f980442ccb77470a487f196ec

Keywords: EMIT, Antenna.

Prerequisites#

Perform imports#

[1]:
import os
import tempfile
import time

import ansys.aedt.core
from ansys.aedt.core.emit_core.emit_constants import ResultType, TxRxMode
from ansys.aedt.core.emit_core.nodes.generated import AntennaNode, RadioNode

Define constants#

Constants help ensure consistency and avoid repetition throughout the example.

[2]:
AEDT_VERSION = "2026.1"
NG_MODE = False  # Open AEDT UI when it is launched.

Create temporary directory#

Create a temporary working directory. The name of the working folder is stored in temp_folder.name.

Note: The final cell in the notebook cleans up the temporary folder. If you want to retrieve the AEDT project and data, do so before executing the final cell in the notebook.

[3]:
temp_folder = tempfile.TemporaryDirectory(suffix=".ansys")

Launch application#

Launch AEDT with EMIT. The Emit class initializes AEDT and creates an EMIT design in the project.

[4]:
project_name = os.path.join(temp_folder.name, "antenna_cosite.aedt")
aedtapp = ansys.aedt.core.Emit(
    project=project_name,
    version=AEDT_VERSION,
    non_graphical=NG_MODE,
    new_desktop=True,
)
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 1.0.dev0.
PyAEDT INFO: Initializing new Desktop session.
PyAEDT INFO: AEDT version 2026.1.
PyAEDT INFO: New AEDT session is starting on gRPC port 61472.
PyAEDT INFO: Starting new AEDT gRPC session on port 61472.
PyAEDT INFO: Launching AEDT server with gRPC transport mode: wnua
PyAEDT INFO: Electronics Desktop started on gRPC port 61472 after 9.9 seconds.
PyAEDT INFO: AEDT installation Path C:\Program Files\ANSYS Inc\v261\AnsysEM
PyAEDT INFO: Connected to AEDT gRPC session on port 61472.
PyAEDT INFO: Non-graphical mode detected. Disabling Desktop logs.
PyAEDT INFO: Project antenna_cosite has been created.
PyAEDT INFO: No design is present. Inserting a new design.
PyAEDT INFO: Added design 'EMIT_FC2' of type EMIT.
PyAEDT INFO: AEDT objects correctly read
PyAEDT INFO: ModelerCircuit class has been initialized! Elapsed time: 0m 0sec
PyAEDT INFO: ModelerEmit class has been initialized!
PyAEDT INFO: Importing EmitApiPython from: C:\Program Files\ANSYS Inc\v261\AnsysEM\Delcross\EmitApiPython
PyAEDT INFO: Loaded Ansys EMIT API (Beta) 2026.1.0
PyAEDT INFO: Active Design set to EMIT_FC2

Model Preparation#

Create radios and antennas and connect them in the EMIT schematic.

Create and connect EMIT components#

Create a radio and connect an antenna to it.

[5]:
rad1: RadioNode = aedtapp.schematic.create_component("New Radio")
ant1: AntennaNode = aedtapp.schematic.create_component("Antenna")
if rad1 and ant1:
    aedtapp.schematic.connect_components(rad1.name, ant1.name)
PyAEDT INFO: Using component 'New Radio' from library 'Radios' for type 'New Radio'.
PyAEDT INFO: Using component 'Antenna' from library 'Antennas' for type 'Antenna'.
PyAEDT INFO: Successfully connected components 'Radio' and 'Antenna'.

Place radio/antenna pairs#

Use the create_radio_antenna() method to place additional radio/antenna pairs. The first argument is the type of radio. The second argument is the name to assign to the radio.

[6]:
rad2, ant2 = aedtapp.schematic.create_radio_antenna("GPS Receiver")
rad3, ant3 = aedtapp.schematic.create_radio_antenna("Bluetooth Low Energy (LE)", "Bluetooth")
PyAEDT INFO: Using component 'GPS Receiver' from library 'Radios\Navigation Systems\GPS-GLONASS' for type 'GPS Receiver'.
PyAEDT INFO: Using component 'Antenna' from library 'Antennas' for type 'Antenna'.
PyAEDT INFO: Successfully connected components 'Antenna 2' and 'GPS Receiver'.
PyAEDT INFO: Using component 'Bluetooth Low Energy (LE)' from library 'Radios\Commercial Unlicensed Systems\Bluetooth' for type 'Bluetooth Low Energy (LE)'.
PyAEDT INFO: Using component 'Antenna' from library 'Antennas' for type 'Antenna'.
PyAEDT INFO: Successfully connected components 'Antenna 3' and 'Bluetooth'.

Define the RF environment#

Specify the RF coupling among antennas. This functionality is not yet implemented in the API, but it can be entered from the UI.

e98c2ad5033b4b8f9b528130478ae045

Run analysis#

Run the EMIT simulation.

[7]:
if AEDT_VERSION > "2023.1":
    rev = aedtapp.results.analyze()

Postprocess#

Evaluate the worst-case EMI between the GPS receiver and Bluetooth radio.

[8]:
if AEDT_VERSION > "2023.1":
    rx_bands = rev.get_band_names(radio_name=rad2.name, tx_rx_mode=TxRxMode.RX)
    tx_bands = rev.get_band_names(radio_name=rad3.name, tx_rx_mode=TxRxMode.TX)
    domain = aedtapp.results.interaction_domain()
    domain.set_receiver(rad2.name, rx_bands[0], -1)
    domain.set_interferer(rad3.name, tx_bands[0])
    interaction = rev.run(domain)
    worst = interaction.get_worst_instance(ResultType.EMI)
    if worst.has_valid_values():
        emi = worst.get_value(ResultType.EMI)
        print("Worst case interference is: {} dB".format(emi))
PyAEDT INFO: Project antenna_cosite Saved correctly
Worst case interference is: 16.64 dB

Finish#

Save the project#

[9]:
aedtapp.save_project()
aedtapp.release_desktop()
# Wait 3 seconds to allow AEDT to shut down before cleaning the temporary directory.
time.sleep(3)
PyAEDT INFO: Project antenna_cosite Saved correctly
PyAEDT INFO: Desktop has been released and closed.

Clean up#

All project files are saved in the folder temp_folder.name. If you’ve run this example as a Jupyter notebook, you can retrieve those project files. The following cell removes all temporary files, including the project folder.

[10]:
temp_folder.cleanup()

Download this example

Download this example as a Jupyter Notebook or as a Python script.