A Python library for HFSS antenna radiation pattern analysis and gain optimization
Project description
pyemf: Python Antenna Radiation Analysis and Optimization Library
pyemf is a Python library designed for antenna radiation pattern analysis and gain optimization. The package leverages SciPy, NumPy, Matplotlib, and ANSYS HFSS (via pyaedt) to automate high-frequency structure simulations, process electromagnetic data, and visualize results.
Key Features
- Gain Calculation and Optimization: Provides methods to calculate antenna gain with multiple optimization options, including exhaustive, heuristic, and SciPy-based optimizations.
- Radiated Power Density and Cumulative Distribution: Calculates and visualizes cumulative distribution functions (CDFs) for radiation characteristics.
- Custom Radiation Pattern and Gain Distribution Plots: Offers multiple plotting functions to visualize radiated power density, gain, and other related data.
- Integration with HFSS: Automates the export of far-field data from HFSS simulations for further analysis and optimization.
Installation
You can install the package using pip:
pip install pyemf
Note: Ensure that
pyaedtand ANSYS HFSS are installed to fully utilize all functionalities in this package.
Dependencies
This package requires the following libraries:
numpyscipymatplotlibpyaedt
Quick Start
1. Basic Usage Example
The following example demonstrates how to use pyemf to calculate and visualize antenna gain:
from pyemf import Ffd, Beam, Plane, hfss_design
# Initialize HFSS design and export FFD files
hd = hfss_design()
folder = "path_to_ffd_folder"
hd.export_ffds(folder, 'Setup1 : Sweep', '30.0GHz')
# Load FFD files
ffds = get_ffds(folder)
# Create a Beam object and optimize gain
beam = Beam({ffd_obj: (1, 0) for ffd_obj in ffds.values()})
optimized_beam = beam.optimize_gain(40, 60)
# Visualize the gain contour plot
optimized_beam.plot_realized_gain_contour()
2. Create a Custom Plane and Plot Cumulative Distribution
# Set up multiple beams and create a Plane
plane = create_plane("MyPlane", beam, [(0, 0), (90, 90)], fast=True)
plane.plot_rGain_cdf()
plane.plot_eirp_cdf()
Module Overview
Modules and Classes
Ffd: Manages far-field data, including settingEthetaandEphi, and calculates radiated power density.Cdf: Handles cumulative distribution function (CDF) calculations and plotting.Beam: Represents a single antenna beam, with support for various gain optimization methods.Plane: Represents a plane of multiple beams, providing distribution plots and cumulative distributions for gain and radiated power density.hfss_design: Interacts with ANSYS HFSS to export far-field data and set source excitations.
Key Methods and Functionalities
- Gain Calculation: Methods such as
optimize_gain_exhaustive,optimize_gain_heuristic, andoptimize_gainoffer different approaches to optimizing antenna gain. - Plotting: Functions like
plot_realized_gain_contour,plot_rGain_cdf, andplot_eirp_cdfhelp visualize antenna gain and radiation patterns effectively. - HFSS Integration: The
hfss_designclass facilitates automatic far-field data export and the application of different beams for analysis.
Version Information
- Version: 0.1.0
- Author: Ming Chih Lin
- License: MIT License
Contact
If you have any questions or feedback, feel free to reach out:
- Email: mingchih.lin8@gmail.com
- GitHub: pyemf Repository
License
This project is licensed under the MIT License. For more details, see the LICENSE file.
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file pyemfield-0.1.2.tar.gz.
File metadata
- Download URL: pyemfield-0.1.2.tar.gz
- Upload date:
- Size: 11.2 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.1 CPython/3.10.11
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
e71fdca17714502fb5f530dd3ca3d31ecfaa1aa4086020fe97a8b3a5de50412d
|
|
| MD5 |
768722424a8fcc87d2e70cdd262be372
|
|
| BLAKE2b-256 |
0e1be0e683c052e158e1a01eea7087d3b7cc578c2d9192e6b8c22a2bb5ef61ab
|
File details
Details for the file pyemfield-0.1.2-py3-none-any.whl.
File metadata
- Download URL: pyemfield-0.1.2-py3-none-any.whl
- Upload date:
- Size: 9.7 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.1 CPython/3.10.11
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
fdbaec25c0c5792fab1d76a56bb905f76e71ae6e491d802d13a9c83641c5872b
|
|
| MD5 |
6a8d7956e19e98de1f625b571e5cf2b7
|
|
| BLAKE2b-256 |
10e4ed4d77e3fcbf260bd3de147911d35ee05e9b55669a07debc1c5df2a5e1ad
|